3D Anti-Gravity Racing Simulator
Role: Gameplay Programmer
Team Size: Solo
Time Frame: TBD
Engine: Unity (C#)
Github: https://github.com/DylanMather2004/Fizzy-Racing-Game
Role: Gameplay Programmer
Team Size: Solo
Time Frame: TBD
Engine: Unity (C#)
Github: https://github.com/DylanMather2004/Fizzy-Racing-Game
This AG Racing simulator was heavily inspired by the WipEout franchise, a series of racing games that I have a lot of personal history with. In this project I am attempting to recreate the vehicle mechanics from those games, with intentions of developing a full gameplay experience.
The project is being developed in Unity
This AG Racing Simulator (AGRS) is a more advanced physics simulation than my previous projects, demanding much more complex programming structures, such as a PID Controller, to achieve the Anti Gravity effect seen in WipEout and other AG Racing games. Whilst in early development, I have already created a successful prototype of the anti-gravity mechanic, and have since began programming various vehicle mechanics, such as acceleration, steering and drift.
Due to the high speeds and large scales of the track, I will need to implement a floating origin system. A construct commonly used in larger, open world games, or games with generally larger maps to avoid floating point errors.
Arguably the most important aspect of this simulation is the PID (Proportional, Integral, Derivative) controller, which uses various gain modifiers to correct imbalances in position. In this instance, it is used to correct the height of the vehicle when to close, or too far from the ground. To achieve this I have used a physics raycast casting down from the vehicle, then using the PID to adjust to a set position above the intersected ground, then applying rotation to adjust for the track surface normal. This allows the vehicle to stick to the track on loops.
Input from the PID Controller behavior is processed on the Players Controller Script, which applies forces based on the input received from the PID controller. On start, the Player controller creates its own instance of the PID Controller, which makes this system scalable for multiple ships, which may come in handy if I choose to implement networked multiplayer to this project for a full release.
I currently have an initial draft of the vehicle controls, featuring a rudimentary acceleration, steer and drift function.
The CalculateThrust function interpolates the player's speed to the max speed using a set step (acceleration variable) which can be defined in the vehicle prefab. This method also calculates deceleration if the vehicle is no longer receiving input for acceleration
The RotateShip function provides a value for rotation that is then fed to the update script to turn the vehicle
The AirBrake method alters the turn angle depending on the stage of input.