Source code is available on GitHub.
A simple racing game that shows how I typically structure my work in Unreal Engine. It serves well as a reference on how to use Unreal’s game framework (Game Instance, Game Modes, Data Assets, Save Game, etc.), create a Map Selection menu with widgets, and how to setup an AI Controller with Behavior Trees.
The project includes the following features:
- Highscores are saved and loaded automatically and shown on the map selection screen.
- Vehicle Movement:
- Vehicle can not only drive, but also jump and dash.
- I want to handle those skills via the Gameplay Ability System (GAS) - but had no time to add it yet.
- Checkpoint Racing:
- A game mode where the player has to drive through checkpoints as fast as possible.
- Once a full lap is completed the time will be saved and stored on the game instance.
- AI with PID control for dynamic spline following:
- AI functionality is encapsuled in the RacingAI plugin.
- Two PID controllers are used to control steering and speed respectively. (PID control works by injecting inputs to minimize the error between actual and desired state. This enables the AI to follow the spline.)
- Once splines are placed on the map, the Spline Selection Service will find them and give them to vehicles to follow.
Video of three AI-controlled vehicles:
