The developer at Embark Studios Maik Klein recently managed to integrate Rust into Unreal Engine. Klein said that making the programming language work on the platform was part of a passion project, something carried out exclusively in their spare time. Embark is a game studio based in Stockholm, Sweden which is mostly known for the free-to-play shooter ARC Raiders.
Rust is a relatively new programming language sponsored by the company behind Firefox, Mozilla. The aim was basically to increase memory safety and reduce the possibility of data races. Rust is described as “blazingly fast and memory efficient. With no runtime or garbage collector, it can power performance critical services, run on embedded devices, and easily integrate with other languages.” When it comes to reliability, the programming language has a “rich type system and ownership model” which guarantees “memory safety and thread safety, enabling you to eliminate many classes of bugs at compile time.”
“A few months ago, I asked myself ‘what if I could write a game in Rust, but use Unreal as a renderer?’ After a bit of thinking, I came to the conclusion that exposing the Unreal renderer to Rust via C Foreign Function Interface was way more work than I was willing to do,” Klein remarked on their development blog. “But what if I could just build on top of Unreal instead?”
Klein went about getting game objects to move and animations to play. “But I wanted to do more than just move things around,” the developer said. "I wanted to play sounds, do physics, have 3D pathfinding, spawn particles, create prefabs, do networking. This made me realize that I actually did not want to use Unreal just as a renderer. I wanted to use the whole engine.”
Klein eventually came up with Unreal Rust which as the name would suggest, “allows you to write games with Unreal Engine in Rust.” According to the developer, “Unreal Rust is an opinionated Rust integration for Unreal. Rust cares about ownership, mutability, and lifetimes. Mapping Unreal concepts to Rust one to one would only cause a headache. Instead, Unreal Rust will be written on top of the Unreal AActor and expose its Application Programming Interface in a Rust-friendly way.”
Unreal Rust is of course a work in progress. Klein describes the current state as “jank,” adding that “almost nothing is implemented properly and you should not use Unreal Rust in a real project yet.” Unreal Rust is currently without any form of stable versioning or serialization.
“While there are still a lot of problems, I do want to make Unreal Rust into something real,” Klein explains. “It will just take a bit of time. There is an infinite to-do list, but the next big thing will be samples. I want to heavily drive this project through real-world samples where I try to create some game mechanics.”
Source: Read Full Article