Suggestion for workshop 2.0 - "Verse" programming language

Verse is the new programming language for Unreal Engine Fortnite. It is a web3 programming language that was introduced to enable game developers to create their own gameplay in Unreal Editor for Fortnite, including customizing their devices for Fortnite Creative. Verse is designed to be simple, general, productive, statically verified, performant, complete and timeless.

Verse is a multi-paradigm language that uses the best of functional programming, object-oriented programming, and imperative programming. Some of the paradigms that Verse supports are:

  • Determinism: Data is immutable by default, and given the same code and data, results will always be exactly the same.

  • Expression-oriented: Everything is an expression, which means that everything has a result.

  • Failure-based control flow: Instead of using true / false values to change the flow of your program, Verse uses failable expressions, which produce a value if they succeed or don’t if they fail.

  • Speculative execution: You can try out actions without committing them. When an expression succeeds, the effects of the expression are committed, but if the expression fails, the effects of the expression are rolled back as though the expression never happened.

  • Concurrency: You can perform actions simultaneously using language-level concurrency instead of relying on system-level threads across multiple processors.


Compared to the Overwatch Workshop, most of these features are not available.

Immutability is good to a certain extent, for example we cannot individually change the XYZ component of each 3d vector.

There are no data types to manage effect rotation.

There are no multidimensional arrays, we are restricted to declaring an array of only one dimension. We can even access multidimensional arrays, but we cannot create them. (an example of this would be the implementation of pathfinding algorithms, which need multidimensional arrays, reserving a variable for each dimension of an array is bizarre)

We do not have expression control, that is, not all functions can return something. We cannot create custom functions (only subroutines, where they are just blocks that we can call repetitively)

We do not have the concept of Concurrency. All actions are performed in sequence. In other words, if we want to create a timer, we either need to create a separate rule and wait until a condition is met (time <= 0) or force the rule to stop executing until it reaches zero.


Verse is a compiled language. This means that Verse code is translated into machine code before it can be executed by the computer. This translation process is done by a program called a compiler, which takes a Verse file as input and produces an executable file as output. The executable file can then be run by the computer without the need for the Verse file or the compiler.

The advantage of a compiled language is that it can run faster and more efficiently than an interpreted language, which is a language that is translated and executed line by line at runtime by a program called an interpreter. The disadvantage of a compiled language is that it requires more time and resources to compile the code, and that it may not be compatible with different platforms or architectures.

Unreal Verse uses a custom compiler that is integrated with Unreal Editor for Fortnite. The Verse compiler is responsible for translating the Verse code into executable instructions that can run on various platforms, such as Windows, Mac, iOS, Android, and consoles. The Verse compiler also performs static analysis and verification on the Verse code, which means it checks for errors and potential problems before running the code. The Verse compiler supports features such as:

  • Incremental compilation, which means it only recompiles the parts of the code that have changed, making the compilation process faster and more efficient.
  • Hot reload and hot restart, which means you can make changes to your Verse code and see the results in the game without restarting the game or losing your progress.
  • Live coding, which means you can edit your Verse code while the game is running and see the changes in real time, without having to recompile or reload the game.

In comparision with overwatch workshop language syntax, is a raw text based language that is (re)parsed every time custom lobby initialize the code or paste the code, this makes it very poorly optimized in terms of server structure.

The way Workshop was made, it’s completely broken for PC. The interface has problems loading and managing many rules/actions/conditions. Can’t we just drag and drop to move something? Is there no way to group the rules?

They still use Consoles as an excuse for not being able to access text editing features. But that doesn’t make any sense, today Overwatch is free, you can use a PC


Advantages and Disadvantages of Verse

Since Verse is a totally new language, we should expect that its creators have learned from several decades of experiences in every programming language, and that it would avoid many legacy mistakes.

Some advantages of using Verse over C++ for Unreal Engine are:

  • Verse is simpler and easier to learn as a first-time programmer, while C++ is complex and has a steep learning curve.

  • Verse is strongly typed and statically verified, which means it can catch many runtime errors at compile time and prevent uncaught errors in development or deployment, while C++ is weakly typed and prone to memory leaks and undefined behavior.

  • Verse is multi-paradigm and supports functional, object-oriented, and imperative programming styles, while C++ is mainly object-oriented and imperative.

  • Verse uses failable expressions and speculative execution to handle failure as control flow, which means you can try out actions without committing them and roll back the effects if they fail, while C++ uses true/false values and exception handling to change the flow of the program, which can be cumbersome and error-prone.

  • Verse supports concurrency at the language level, which means you can perform actions simultaneously without relying on system-level threads, while C++ requires external libraries or frameworks to achieve concurrency.

But no programming language can claim to be perfect, and the suitability is more relevant question than “what is the best programming language”. You should always think about how any programming language suits your project, your goals, your development style, your team, maintenance etc.

Some disadvantages of using Verse over C++ for Unreal Engine are:

  • Verse is a new and experimental language that is still in beta and may have bugs, limitations, or changes in the future, while C++ is a well-established and stable language that has been used for decades.

  • Verse is specific to Unreal Engine and may not be compatible or transferable to other engines or platforms, while C++ is a general-purpose language that can be used for a variety of applications and systems.

  • Verse has a smaller and less mature ecosystem of tools, libraries, and resources than C++, which means you may have less support or options for developing your projects.

  • Verse has a different syntax and semantics than C++, which means you may have to learn new concepts and paradigms that are not familiar or intuitive to you, such as failable expressions, speculative execution, and concurrency.

  • Verse may not have all the features or functionalities that C++ offers, such as pointers, templates, multiple inheritance, operator overloading, etc., which may limit your flexibility or creativity in some cases.

TL;DR

In verse language you don’t need to deal with complexity of raw c++ native code, you have an interface in a simple and practical language, anyone (even if they don’t have any advanced programming knowledge) can develop anything with this language.

You don’t need to deal with memory management, its handled by engine itself.

Verse Syntax

The syntax of Verse is the set of rules that define how to write valid Verse code. The syntax covers various aspects of the language, such as:

Expressions: The smallest unit of code that produces a value when evaluated, such as *1 + 2 or

if (x > 0) {
  print ("Positive") 
}
else { 
  print ("Negative or zero") 
}

Comments: Text that explains something about the code or the programmer’s intention, but is ignored when the program runs, such as *# This is a single-line comment*

Constants and variables: Names that store information or values that the program uses, such as *PI : float = 3.14* or *var Name : string = "Alice"*

Types: Categories of values that determine their characteristics and behavior, such as int, float, string, logic, etc.

Operators: Symbols that perform operations on values, such as +, -, *, /, %, ==, !=, <, >, etc.

Control flow: Structures that change the order of execution of expressions based on conditions, such as if ... else, case ..., for ... , etc.

Functions: Blocks of code that perform a specific task and can be reused, such as

# An function called "Add" that accept integers 
# (positive/negative numbers) and return another integer.

Add (x : int, y : int) : int {
  return x + y
}

Classes: Templates that define the properties and methods of objects, such as

character := class: {
  var Health : int = 100; 

  Move (Direction : vector) { 
    # Move logic here ... 
  }
}

Modules: Collections of related code that can be imported and used by other modules, such as

module Math {
  Square (x : float) : float {
    return x * x 
  }
}

Lets take some verse code examples:

# Define an interface for flying
iFlyable := interface(): {
 Fly()<decides> : void
}
# Define an interface for swimming
iSwimmable := interface() {
 Swim()<decides> : void
}
# Define a class for animals
animal := class() {
 var Name : string
 # Define an abstract method for making sounds
 MakeSound () : void
}
# Define a class for ducks that inherits from Animal and implements IFlyable and ISwimmable
duck := class( animal, iFlyable, iSwimmable ) {
 # Override the MakeSound method from Animal
 MakeSound <override> () : void {
   print ("Quack")
 }
 # Implement the Fly method from IFlyable
 Fly () : void {
   print (Name + " is flying")
 }
 # Implement the Swim method from ISwimmable
 Swim () : void {
   print (Name + " is swimming")
 }
}

Another example:

character := class: {
 # The character's health points
 var Health : int = 100
 # The character's movement speed
 var Speed : float = 10.0
 # The character's jump force
 var Jump : float = 5.0
 # The character's damage output
 var Damage : int = 10
 # A method that makes the character move in a direction
 Move (Direction : vector):void {
   # Apply the movement speed to the direction vector
   var Velocity : vector = Direction * Speed
   # Set the character's velocity to the calculated vector
   SetVelocity (Velocity)
 }
 # A method that makes the character jump
 Jump ():void {
   # Apply the jump force to the vertical axis
   var Impulse : vector = vector (0, 0, Jump)
   # Add the impulse to the character's velocity
   AddImpulse (Impulse)
 }
 # A method that makes the character attack another character
 Attack (Target : character):void {
   # Deal damage to the target based on the character's damage output
   Target.TakeDamage (Damage)
 }
 # A method that makes the character take damage from another source
 TakeDamage (Amount : int):void {
   # Subtract the damage amount from the character's health points
   Health -= Amount
   # Check if the character's health is zero or below
   if (Health <= 0) {
     # Call the death method
     Die ()
   }
 }
 # A method that makes the character die
 Die ():void {
   # Destroy the character's actor
   DestroyActor ()
   # Add some logic to handle characters death etc.
 }
}

Read full information about Verse language developed by Epic Games
https://www.linkedin.com/pulse/unreal-engine-programming-verse-mika-mike-laaksonen/

1 Like

Nice sum up and partly good comparision to C++, modern C++ has some optimization tools to negotiate with weak typing, though C++ is not inherently weakly typed, and it is recommended to make types static by annotating a data type, so the compiler can do the optimazations on the fly. C++ is object-orientated optimized at the end of some developers days, but is also multi-paradigm in it’s design as well as general-purposely. While i see Verse more purposely on programming game logic, since it original design goal was to be a scripting language, like Lua. C++ is indeed not deterministic, alone through as mentioned via templates, generics, macros etc etc. But as explained can offer deterministic approaches and can make it straightforward. And i absolutely agree on the part that no programming language is perfect, and any one should consider their needs and purposes, if that is gathered any programming language can work for some, but you may need to strive by learning something new, thats the nature of being a programmer too, if anyone might attends to start as one. Thus a hierachy of languages is not made without a reason, to know what it’s meant to navigate through that hierachy is a big knowledge to aquire and needs time to ride on it.

1 Like