Motocross Simulation Game Project

Overview

I am developing a motocross simulator that prioritizes physical accuracy. Every subsystem from rigid-body dynamics to real-time rendering is built from scratch in modern C++ with OpenGL. This project serves as both a learning platform to deepen my understanding of physics simulation and a way to sharpen my programming skills. The long-term goal is to create a game that captures the authentic handling characteristics of a real off-road motorcycle.

Core Physics

The motorcycle is represented by five rigid bodies: frame, fork, swingarm, and two wheels. Six degree-of-freedom constraints link these parts. Each simulation step assembles them into a Jacobian system solved with a projected Gauss-Seidel solver, and states advance through an implicit fourth-order Runge-Kutta integrator.

The rider is modeled as an additional rigid body. Four soft positional constraints (hands and feet) attach the rider to the bike, so steering and leaning arise naturally from player input. Careful tuning of constraint softness delivers responsive controls without adding artificial forces.

Wheel-ground interaction uses a modified Pacejka model that calculates lateral force, longitudinal force, and self-aligning torque from instantaneous slip. This keeps the simulation lightweight while still producing believable grip transitions, roost, and high-speed wobble.

Ongoing Research

Realistic motocross requires deformable soil. I am evaluating two complementary approaches: a shallow viscous-layer model that carves broad ruts, and a GPU-accelerated discrete-element patch beneath each tire to account for real-time soil movement.