Skip to content

Seerban/godot-vehicle

Repository files navigation

godot-vehicle

My own custom implementation of a 3D Raycast Vehicle, alternative to VehicleBody3D node (Not related).

Proper documentation and ease of use for custom nodes node are not a priority at the moment.

Relevant Classes:

  1. Vehicle: Handles the controls and general properties and layout of vehicle.
  2. Axle/Wheel Handles the suspension and grip. (Axle is for positioning)
  3. LightsManager: Turns meshes into working dynamic lights. (Based on node.name atm).
  4. SprintRace: Turns Node3D children into checkpoints for a race and handles timer & GhostPlayer for replays.
  5. GhostPlayer: Can record or replay actions of vehicle object.
  6. RoadCurve: Small wrapper for Path3D and CSGPolygon, updates Radar.
  7. Radar: Draws roads, checkpoints & vehicles. (Currently unoptimized and unfinished)

Adjustable Parameters

Power & Brake Force: How much force the wheels can produce. (Limited by max grip)
Brake Bias: Where the brake force is applied, causes drifty handling toward -1 (rear) and understeer toward 1 (front)
Turn Angle: Maximum wheel angle when turning.
Grip: Multiplier to maximum grip.
Grip Forgiveness: Makes acceleration and braking less costly on grip. Gives the "Arcade" feel (1 = more arcadey, grip not reduced under acceleration or braking).
Height, Strength, Damping: Suspension parameters.
Anti-roll: Counter-force to rotation. (Might cause undesired understeer)
Aero: Downforce at position of aero component. (One at rear and one at front for example vehicle)
Stabilizer: Keeps vehicle straight and less likely to spin out. (If placed behind center)

Parameters (soon to be adjustable)

Curves for acceleration, braking and others
Lights parameters
Material Properties
Center of Mass

Credits

Terrain made using Terrain3D
Placeholder materials sourced from ambientcg.com
Shader Materials from GodotShaders

How to Run:

Windows: download and run the .exe from latest release.
Linux: Run project inside editor or run using steam Proton by adding as a game to steam, selecting properties and compatibility and latest Proton version.