UE5

Collect some information about UE5 and my thoughts and analysis on the current Epic News.

UE5.1 releases its first preview: Unreal Engine 5.1 Preview
UE5.0 is officially released! Update log: Unreal Engine 5.0 Release Notes

Articles related to UE5 in the blog:

Game Feature

Game Feature is a modular gameplay mode introduced in UE 4.27 and UE5. I conducted a preliminary research and analysis on it, and support hot patching to package Game Feature, achieving true Modular Gameplay from gameplay to resource packaging.
For details, see the article: UE5: Game Feature Research

ECS Support

Oodle Compression

As I originally anticipated, on 2021.04.01’s Feeds: Epic integrated Oodle into UE4.27 and UE5.

They will provide four Oodle compression algorithms:

  • Oodle Data Compression: The fastest and highest compression algorithm, suitable for data compression, packaging compression, etc.
  • Oodle Texture: Used to compress Texture, it can compress BC1-BC7 Texture, reducing Texture size by 50% (official data).
  • Oodle Network Compression: Compresses TCP/UDP data, reducing bandwidth consumption for server transmission.
  • Oodle Lossless Image Compression: Lossless image compression algorithm, significantly smaller than PNG and has very high decompression speed.

Currently (2021.04.05), you can pull the master branch of UE, after downloading the dependencies in the following directory:

1
2
E:\UnrealEngine\Source\UnrealEngine\Engine\Plugins\Compression
E:\UnrealEngine\Source\UnrealEngine\Engine\Plugins\Developer\TextureFormatOodle

Includes the OodleData, OodleNetwork, and TextureFormatOodle three plugins. Note that dependencies must be downloaded; otherwise, the code will only have the .h interface without the linkage libraries for each platform.

It’s regrettable that earlier engine versions do not support this. I extracted this part of the code from UE’s development branch and placed it in a separate repository: oodle-compression. The code does not rely on anything from the new version of the engine, but actually enabling it in earlier versions will lead to compilation errors, which I have fixed. The implementation in the plugin also adds Oodle to UE’s Compression’s Modular Feature through the SDK and can also be used according to the methods I described in my previous article: ModularFeature: Integrating ZSTD Compression Algorithm into UE4

Note: Enabling Oodle during the default packaging requires adding the OodleData plugin dependency to UnrealPak, which necessitates recompiling UnrealPak.

To specify Oodle, pass the command line parameter -compressionformats=Oodle to UnrealPak, and use -compresslevel=Leviathan to specify the compression level. After testing, a pak file compressed with zlib at 295M was reduced to 282M using Oodle, but Oodle’s decompression speed has a clear advantage over zlib.

The compression performance of Oodle is compared on the RAD site: Oodle Compression

Other comparison data:

The choice of compression algorithm is a trade-off between compression ratio and decompression speed. The compression ratio of the lowest Selkie is slightly better than zlib, but the decompression speed is more than ten times faster than zlib. For games, decompression speed significantly impacts game performance, which should be the reason UE chose to acquire RAD.

Other resources:

Epic Acquires RAD Game Tools

Epic has acquired RAD Game Tools, initiating a buying spree. The Oodle compression algorithm used in Fortnite is developed by this company.

I briefly looked at what this company has developed, covering video decoding, compression algorithms, profiling, art asset processing, audio tools, and more. It’s a good thing for improving UE’s toolchain ecosystem.

I believe for Epic, acquiring it is particularly important to gain the technical accumulation related to compression, which is crucial for UE5, as UE5 can directly use film-level asset resources. The size of these resources and their corresponding loading times may become bottlenecks (I think this is also the main reason UE5’s first demo was on PS5), so a customized resource compression scheme for UE5 is needed. I hope UE5 can successfully release a beta version by the end of the first quarter of 2021 without delays.

Epic Verse

Progress on Haskell eXchange

The Verse Calculus: a Core Calculus for Functional Logic Programming: (backup)

Beyond Functional Programming: The Verse Programming Language: (backup)

Related discussions on ycombinator: Beyond Functional Programming: The Verse Programming Language

Introduction to Epic Verse Syntax

I carefully looked at the Epic Verse code presented in Inside Unreal: 2020 Year In Review, and it appears that the new script language resembles a combination of pascal and Python, with a bit of Ruby flavor. Verse has static typing, and some syntax is very similar to SkookumScript.

In early 2019, Epic acquired Agog Labs (and SkookumScript), likely aiming to create a scripting language for UE5, which is reasonable given that UE5’s syntax structure resembles SkookumScript. Based on the presentation in the video, I think UE5’s scripting language is probably developed by Agog Labs.

However, this presentation did not showcase how this scripting language interacts with the engine, nor did it present the symbolic information within the engine. Current interaction with C++ can only be observed. Below, I will introduce the language content displayed in the video.

The code showcased in the video is as follows:




Transcribing the text:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This is a BoxFight prototype game.
BoxFight=class(FortGameScriptBase):
GameStarted^: bool=false
GameEnded^: bool=false
CurrentRound^: int=0
RunGame()
# Pause until all players in the matchmaking session
# have connected to the server.
MaitForPlayersToJoin()

# Start the game.
GameStarted := true
for(i = 1..NumberofRounds):

# Perform round setup.
currentRound := i
EnableBarriers()
SetBuildingDisallowed()
if(!SetupPlayersAndSpawnPoints()?):

# We hit an error and are unable to start the round.
ShutdownGame()
return

else:
# Begin the round start countdown.
Players.PutAllInStasisAllowEmotes()
Players.SetAllInvulnerable(true)
SimpleUI.ShowcountDown(7)
Wait(2)

# Enable building at the end of the countdown.
SimpleUI.ShowMessage("Building Enabled")
SetBuildingAllowed()
Players.RemoveAllFromStasis()
Players.SetAllInRound()
# Wait for the start countdown to complete.
Wait(4.7)
SimpleUI.HideMessage()
# Begin combat and initialize the storm.

Players.SetAllInvulnerable(false)
DisableBarriers()

# Hide the round start after it's had a second to display.
Wait(1.3)
simpleUI.HideCountDown()
Storm.Startstorm(60.0, CurrentRound^)

#Wait for the round end conditions
if(IsSoloGame()?):
race:
#Setup Solo specific end conditions for testing
WaitForZeroRemaining()
WaitForRoundTimeout()
else:
race:
# Setup Solo specific end conditions for testing
WaitForOneRemaining()
WaitForZeroRemaining()
WaitForRoundTimeout()

# Handle round complete.
# Give everyone a quick completion message.
SimpleUI.ShowMessage("Round Complete")
Wait(2.0)

# Disable combat and the storm.
SimpleUI.HideMessage()
Players.PutAllInstasisAllowEmotes()
Players.SetAllInvulnerable(true)
SetBuildingDisallowed()
Storm.stopstorm()
Players.SetAllEndRound()

# Display the scoreboard.

Class Definition

First is the class definition (tentatively marked as inheritance):

1
BoxFight = class(FortGameScriptBase):

Variable Declaration

Static typing is used, and no ; is required.

1
2
GameStarted^: bool = false
CurrentRound^: int = 0

Variable Assignment

Similar to pascal language (SkookumScript is also like this).

1
GameStarted := 1

Code Blocks

Indentation similar to Python is required, using : to indicate:

1
2
3
4
5
6
7
8
if(!SetupPlayerAndSpwanPoints()?):
ShutdownGame()
return
else:
Players.PutAllInStasisAllowEmotes()
Players.SetAllInvulnerable(true)
SimpleUI.ShowcountDown(7)
Wait(2)

? in SkookumScript is a predicate and can only be applied to boolean objects. In the SkookumScript documentation, it is optional, used to indicate a return value of boolean type:

Optional ‘?’ used as convention to indicate predicate variable or method of return type Boolean (true or false).

Loop Statement

Integer iteration:

1
for(i = 1..NumberOfRounds):

This form is somewhat reminiscent of the Ruby language’s for statement:

1
for i in 0..100 do

Function Call

Use . to call member functions:

1
Players.SetAllInRound()

Coroutine-like Form

1
2
3
4
5
6
7
8
9
if(IsSoloGame()?):
race:
WaitForZeroRemaining()
WairForRoundTimeout()
else:
race:
WaitForOntRemaining()
WaitForZeroRemaining()
WaitForRoundTimeout()

The meaning of the code here is similar to Sequences‘ nodes in UE’s behavior tree; it only succeeds if all of its child nodes execute successfully (completed).

This scripting language seems more like a combination based on SkookumScript, mixed with several programming languages. Currently, the code exhibited is still too little to determine how it feels to use; continuous attention is necessary.

Possible Scripting Language in UE5

In Epic’s Inside Unreal: 2020 Year In Review, a brand new scripting language was introduced, potentially named Epic Verse.

Discussions about the scripting language on Reddit: Epic showed off their new Unreal Verse scripting language that will probably end up in UE5

Blueprints in UE4 significantly lower the entry barrier for non-professional developers. The graphical programming method is easily understandable from a linear perspective but can also lead to confusion. Larger scale projects still require a textual scripting language to solve the following problems:

  1. Textual scripting facilitates collaborative development without causing resource conflicts (BP is a resource).
  2. Easier and more intuitive diffs.
  3. Easier migration between engine versions without resource upgrade/downgrade issues.

Moreover, I believe a scripting language should ideally be strongly typed. Having been accustomed to static strong typed languages like C++, it can be quite uncomfortable using weakly typed languages like Lua. Previously, there was a language called AngelScript that was a static strongly typed scripting language very similar to C++. It was integrated by third parties into UE, but currently only supports PC and console platforms, not mobile devices.

For mainstream scripting language support in mobile game development currently in UE4, Tencent has open-sourced two plugins: UnLua and SLua, both integrated by reflection, with some implementation drawbacks and insufficient community support. I hope Epic will release an officially supported scripting tool; initially, I thought there was a significant chance for Python because UE has good support for Python in the editor and a large user base, making it easy to get started.

If a new scripting language is introduced, the programming methods available in UE would be:

  1. C++
  2. Blueprints
  3. Python (editor)
  4. Epic Verse

Handling different needs with different languages can be overly complex.

Currently, it is still unclear what the specific performance and syntax form of this new scripting language in UE will be. In fact, adding a new language considerably increases the learning cost for users. It is also unclear how UE will design the relationship between BP and the new scripting language; I’ll wait for the latest updates.

Two years ago, Tim had some related replies and discussions on Reddit: It seems people at Epic are considering adding some intermediate script language between C++ and Blueprints

Community thread discussion: Verse, the new unreal scripting language.
Leak information about Fortnite Creative 2.0: Fortnite Creative 2.0: Release date, new features, and more

UE5 PS5 Real Machine Video

Epic released a real machine video of UE5 on PS5:

Introduction in Epic Feeds: A first look at Unreal Engine 5

The biggest change in UE5 should be the introduction of Lumen and Nanite, two core rendering technologies. The effects in the video look amazing; I wonder how the support for mobile ends up when it releases.

Articles discussing and analyzing these two technologies:

For the current UE4 projects, the article mentions that Epic is developing forward compatibility for UE5, enabling UE4 projects to upgrade to UE5. From this perspective, the upgrade to UE5 isn’t a complete overhaul; I understand it as a major version updated based on UE4.

We’re designing for forward compatibility, so you can get started with next-gen development now in UE4 and move your projects to UE5 when ready.

UE5 is expected to release a preview version in early 2021 and the official version by the end of the year, hoping it doesn’t get delayed. Epic NB!