forerunner - a storytelling platform for composing Souls-like Action-RPGs
Tags: rust, csharp, python, gamedev
Published: 2023-03-22 22:45:55

In this article, we'll take a closer look at Forerunner's architecture and how it differs from regular game engines, especially the ones written in Rust.

The platform is cloud-based and aims to enable a new level of collaboration for artists and developers in creating Souls-like Action-RPGs, drawing on technologies used by the film industry, such as Pixar's Universal Scene Description (USD), which will serve as the foundation for a new world building experience.

### Before We Begin

First of all, I would like to express my gratitude to Remedy Entertainment for their excellent publications about the Northlight Engine, which served as a great inspiration for the creation of a new platform using Rust, C# and Python.

### Mistakes Made by Others

During the exploration of different engines and platforms for game development in Rust, learned that several huge mistakes were made by others. One of the most significant mistakes was relying on Rust-based rewrites of common formats instead of using C/C++ bindings to official implementation, which can be a security risk and cause compatibility issues, as the official builds are maintained by large teams and audited.

Another mistake was relying too heavily on a specific cross-platform, unstable rendering library, making maintenance more difficult. Attempting to support all possible platforms at once can also lead to lower quality experiences on each platform. Instead, it may be better to focus on a single platform and it's rendering API initially, and then slowly introduce support for additional platforms after the initial release.

Finally, using Rust alone, without the help of Python, makes it hard to add interop with external tooling, such as adoption of Blender, Maya and Katana for real-time world editing instead of building whole new DCC, just for the sake of editing scenes through the app that was made using engine itself.

## Architecture

The platform is built on a cloud-based architecture that allows for scalable and flexible development of Souls-like Action-RPGs. It includes the following components:

### Cloud Infrastructure

The cloud infrastructure is primarily used for the platform's asset system to easily manage and review assets, such as textures and models. The platform leverages several modern technologies to achieve efficient asset distribution. One of the key advantages of the platform's asset system is the ability to stream Pixar's USD directly to the runtime. This allows for real-time collaboration between artists and developers, who can work together to create and modify scenes in a live environment.

Platform's cloud system is primarily designed for self-hosting by gamedev studios, self-hosting ensures that the team has full control over the platform and its data, and that it complies with any specific security requirements. Additionally, self-hosting enables customization and configuration of the platform to meet the needs of the development team, such as integrating with existing tools and workflows.

### Asset Pipeline (Python)

The asset pipeline is a critical component of the platform that enables efficient management and processing of game assets. The asset pipeline is written in Python, a popular and versatile programming language, and is based on Pixar's USD. This enables seamless integration with other tools and workflows used in game development, as well as easy portability of game assets between different platforms.

### Core Runtime (Rust)

> Note that the core runtime will be windows-only before release 2.0, which will introduce support for macOS and/or Xbox Series X | S.

The backbone of the platform and is responsible for handling all abstractions on top of which you could build the game, including Entity-Component System (see [edict](https://github.com/zakarumych/edict), scene compositing, windowing, input handling, and everything else that is needed to create games out of the data and logic passed by users.

_Scene Compositing_ is the process of composing game's world out layers of the scene graph that is built-in inside Pixar's USD format. In other words, the renderer will read data from `*.usd` files to render game world in a way similar to how _render layers_ works in Unreal Engine.

### Extensible toolchain (C#)

The toolchain is a critical component of the platform that enables technical artists to efficiently manage and work with runtime's data in the custom GUI tools. The toolchain is written in C# and will expose a library that can be used by technical artists to write custom studio-specific tools.

The toolchain includes several built-in tools and features that are designed to streamline the development process. These include a profiler, an ECS inspector, and a runtime controller that allows developers to remotely manage runtime seetings, cloud interface and assets from a standalone GUI tool.

## Licensing

_forerunner_ will soon be available at my [GitHub Profile](https://github.com/HeavyRain266) under Mozilla Public License 2.0 with optional Enterprise License for studios who don't want to disclose their internal changes and who would like to get acess to the future builds for Xbox Series X|S