← Lab

A stick-shift simulator that shows you why you stalled

Driving games let you stall without telling you why. This one is a glass box: clutch slip, torque and turbo lag are visible and replayable. It's modelled on my own 2019 Golf and driven with the wheel and pedals I already own. Stalling and shudder come out of the physics, not scripted rules, and how the real car behaves is the test suite.

  • C# / .NET 10
  • physics at 1,000 steps a second
  • raylib
  • SDL3 force feedback
Engine rpmClutch engagedStall threshold
bite point: rpm sags, idle control catches it

Illustrative. Real telemetry once the physics core lands.

The design is the program

Before the first agent run I wrote down four things:

The physics model

Three rotating parts (engine, clutch, wheels) connected by friction and gears, stepped a thousand times a second. Stalling has to come out of that model, not from an if-statement.

The ground truth

I have no data logger on my car, so the truth is how it behaves when I drive it. Each behaviour I know became an automated test: release the clutch slowly on the flat and the car creeps without stalling; dump it and it stalls; stop on a hill and the car holds for about two seconds, then rolls back.

The rules

A short file the agent reads on every run.

The milestones

Hardware check, physics core, drivable prototype, first release. One at a time.

Five rules that do most of the work

  • The physics core has zero dependencies.
  • Behaviour must emerge from physics. No special cases.
  • Never weaken a test to make it pass.
  • No new hardware. Use what’s on the desk.
  • One milestone at a time.

Each rule exists because an agent, left alone, will happily do the opposite. Ask it to make a stall test pass and the quickest route is a special case that detects the test. Ask it for force feedback and it may suggest buying a better wheel. The rules close those doors before the agent reaches them.

Split the work by what needs your hands

The physics core needs nothing but a computer, so agents build and test it on their own. Anything that touches the wheel and pedals waits for me at my desk, because only a person can tell whether a clutch feels right. That split lets the agents work while I’m busy, and keeps my time for the part only I can judge.

WritingDesign docs are the new source code

↑ ↓ to move · Enter to open · Esc to close · J / K: next / previous section