The racing simulation engine consists of a modular framework which covers a vehicle dynamics engine, graphics, sound, input handling, force feedback, networking and telemetry. All of these are modules that can be individually upgraded, replaced or omitted when not needed.
Although the engine was built from the ground up by The Last Garage and is made available under a proprietary license, it leverages several crucial open source projects. With a background in open source development, we love being part of such communities and contributing back to them wherever possible, so here we not only explain the different modules that make up the Racing Simulation Engine, but also any open source components that are part of such a module.
Note that this engine is still in active development. Get in touch if you are interested, but be aware that it is not yet available today.
Vehicle Dynamics Module
Vehicles are designed from building blocks that allow you to assemble your own custom vehicle models. You can model a chassis that includes chassis flex and various aero elements attached to it. Any number of axles can feature different types of suspensions and steering mechanisms and the driveline starts with an engine, a manual or automatic transmission, one or more diffs that feed power to one or more axles. Different tire models are supported and the terrain you drive on can be modeled as a high resolution mesh that comes from, for example, a LIDAR scan with a detailed model of the contact patch between tire and terrain as well as various different materials with different properties.
The vehicle dynamics are based on Project Chrono, an open source, cross-platform multi-physics simulation engine that provides a modeling and simulation infrastructure based on a platform-independent open-source design implemented in C++. We embed it, leveraging the multi-body physics, collision systems and tire models.
The Last Garage also actively contributes to Project Chrono, and has donated various patches and improvements back to the community. For our simulation engine we’ve embedded and extended Chrono::Vehicle with features specific to racing simulation.
Other open source projects used as part of the vehicle dynamics module are JSON for Modern C++ and the Tiny Obj Loader, both of which are used to load assets. The Perlin noise library for modern C++ is used to generate small irregularities in the terrain.
Driver Interface Module
This module supports input handling and force feedback for various controllers, pedals and direct drive wheels. On top of that, we are working with hardware partners to create an even better integration between the software and hardware through richer APIs. Inputs and force feedback are directly integrated in the real-time loop of the vehicle dynamics engine, to put the “driver in the loop”. The current interface builds on top of the DirectInput libraries for Microsoft Windows, but other platforms are targeted in the future.
Networking Module
At a high level, this module provides multiplayer sessions with scoring and timing for any number of connected drivers and spectators. For more complex simulations, the networking module can also be used to link together multiple graphics modules to increase the rendering fidelity or render to even more screens.
The low level networking stack builds on Game Networking Sockets by Valve. This is a library that was designed for real-time games and features a ton of networking features to communicate in a safe and efficient way. It also features network simulations that can emulate latency and packet loss under different conditions, allowing you to build and test robust solutions.
Telemetry Module
The simulation includes a multi-channel telemetry recording facility that can capture each channel at different frequencies or even in an event based manner, allowing you to optimize the data stream for your application. Data gets stored on disk asynchronously, and can be converted from our native format into various other formats for use in third party applications.
Graphics and Sound Modules
The graphics and sound modules are technically two separate modules as well, but currently implemented using the Godot Engine, a free, all-in-one, cross-platform game engine that makes it easy for you to develop games. We’ve implemented triple screen support already and VR support is planned for the near future. The engine uses a Vulkan based forward plus renderer. Sound is provided by an audio system that offers positional sound and extensive sound mixing capabilities which are leveraged to provide modules to easily render sounds for things like engines, drivetrains and tires.
A full day-night cycle is included with dynamic clouds and support for wind force and direction. More environmental effects are planned for the future. To view all the action, Phantom Camera provides us with a great camera movement library, for onboard and track-side cameras.
Vehicles and tracks are separate modules that can be loaded at runtime, which also has big advantages when it comes to developer workflow as each can be developed in isolation. For both, direct support for Blender is included, making the whole process of importing assets extremely easy. gd-obj is used to load 3D meshes for various purposes.
Godot is currently also used as the “glue” to link all modules at runtime. It loads the vehicle dynamics engine as a native C++ component, coupling it only through a thin API which means we can also use different graphics engines in the future. This is based on GDExtensionTemplate that adds CMake support to this extension mechanism.