Verse is a static typed
object-oriented programming
Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impl ...
language created by
Epic Games
Epic Games, Inc. is an American Video game developer, video game and software development, software developer and video game publisher, publisher based in Cary, North Carolina. The company was founded by Tim Sweeney (game developer), Tim Sween ...
. It was released alongside
UEFN in March 2023 and was authored by a team of well-known programmers led by
Simon Peyton Jones, and Epic Games CEO
Tim Sweeney. Verse is designed to interact with
Fortnite Creative's existing devices system. As of June 2024, UEFN remains the only way to interpret, parse, compile or run Verse code; plans to implement the language into the release of Unreal Engine 6 have been discussed.
Features
Modules and importing
Verse supports
modular programming
Modular programming is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect or "concern" of the d ...
, allowing developers to import specific modules required for their scripts. Commonly used modules include the
API
An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
digests that are generated every time a project containing verse is opened. There is an API digest to access and interact with Fortnite objects, Verse objects, and Unreal Engine objects. Developers can also create their own modules and import them into scripts if needed.
Classes and objects
Verse employs a
class-based object-oriented programming model. Developers can define classes to represent various game entities and behaviors.
For example:
hello_world_device := class(creative_device):
OnBegin
():void=
Print("Hello, world!")
Print("2 + 2 = ")
The above code defines a new class inheriting from `creative_device` and prints the traditional " Hello, world" message. All classes inherited from a `creative_device' can be placed into the engine's spatial environment when compiled. The `creative_device` class is necessary to interact with the pre-existing Fortnite Creative toolset.
Functions and methods
Verse allows defining functions within classes. These can perform various operations, such as mathematical calculations, game logic, and more. The example below is a method to determine if a character is looking at a specific location.
IsLookingAtLocation(Character:fort_character, LocationToCheck: vector3, Threshold: float):logic
Event handling
The language supports event-driven programming, where events like ''EliminatedEvent''
and ''PlayerAddedEvent''
can trigger specified functions. Events can also be subscribed to and listened for.
Mathematical and spatial operations
Verse supports various mathematical functions necessary for game development, such as calculating magnitudes, normalizing vectors, and converting rotations to direction vectors. The spatial math module provides classes and functions for vector
Vector most often refers to:
* Euclidean vector, a quantity with a magnitude and a direction
* Disease vector, an agent that carries and transmits an infectious pathogen into another living organism
Vector may also refer to:
Mathematics a ...
and rotational math, essential for game development tasks like positioning and movement. Cos
, Normalize
, Distance , ArcTan
In mathematics, the inverse trigonometric functions (occasionally also called ''antitrigonometric'', ''cyclometric'', or ''arcus'' functions) are the inverse functions of the trigonometric functions, under suitably restricted domains. Specific ...
, and Lerp
are a few of the functions are available for mathematical operations.
Lambda calculus
Verse code shares several similarities with lambda calculus
In mathematical logic, the lambda calculus (also written as ''λ''-calculus) is a formal system for expressing computability, computation based on function Abstraction (computer science), abstraction and function application, application using var ...
, particularly in how it handles functions and data. In lambda calculus, functions are first-class citizens, meaning they can be passed as arguments
An argument is a series of sentences, statements, or propositions some of which are called premises and one is the conclusion. The purpose of an argument is to give reasons for one's conclusion via justification, explanation, and/or persua ...
to other functions, returned as values from other functions, and assigned to variables; while in Verse functions can be passed around and manipulated similarly, showcasing the functional programming paradigm. Examples include methods like Normalize(v1:vector3)
and DrawDebugLine(LineStart: vector3, LineEnd: vector3)
. Verse supports lambda expressions and anonymous functions, allowing for inline function definitions, similar to how lambda functions are used in languages like Python or JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
. Verse also allows for composing functions by chaining method calls and passing functions as parameters. The declarative style used in lambda calculus is also a prominent feature of Verse for defining data transformations and computations rather than an imperative control flow model. This is seen in functions like Normalize
and DrawDebugLine
which are defined declaratively.
Future plans
Epic Games has described Verse as the programming language for the metaverse
The metaverse is a loosely defined term referring to virtual worlds in which users represented by avatars interact, usually in 3D and focused on social and economic connection.
The term ''metaverse'' originated in the 1992 science fiction ...
and has factored mass scalability into its development. Until the proposed convergence with Unreal Engine
Unreal Engine (UE) is a 3D computer graphics game engine developed by Epic Games, first showcased in the 1998 first-person shooter video game '' Unreal''. Initially developed for PC first-person shooters, it has since been used in a variety of ...
, it is yet to be seen how Verse will behave interacting with various systems and processes outside of the ''Fortnite'' ecosystem.
References
External links
*
{{Programming languages
Epic Games
Object-oriented programming languages
Programming languages created in 2023
Statically typed programming languages