A devlog by Neeraj Kotwani, who builds every game on Elipar.
Hill Racer has no steering. You get a throttle, a little car on springs, and some hills. Squeeze the gas over a crest and the nose comes up; squeeze too much and you land on your roof. Managing that is the entire game.
Which means the rotation of the car is the game, and the rotation of the car is where I spent about two days going in circles.
One: it just kept flipping
First version, hold the gas for one second, and the car did two or three complete backflips. Not a wheelie. A washing machine.
I'd applied throttle torque directly to the angular velocity with no ceiling, so holding the button kept adding spin to spin it already had. Three changes together: a much smaller torque, a hard cap on angular velocity as a backstop, and a taper so the torque fades out as the nose approaches a sensible tilt and only ever pushes while the car is already rotating that way. That last one is what stops it compounding under a held button.
Two: fine on flat ground, tumbling on real hills
Wheelies were stable now. On the actual terrain the car still tumbled.
This is where a debug hook earned its keep. I added one that forces the ground perfectly flat, ran the same throttle input, and it was rock solid. So the extra rotation wasn't coming from the throttle at all, it was coming from catching air off bumps at speed and having far too little to damp it. Added a gentle self-levelling spring while airborne, plus more angular damping.
Remember that self-levelling spring. It comes back.
Three: an upside-down car stood itself back up
This one nobody reported and nobody could have. I only found it because I deliberately put the car into a state you cannot reach by playing: flipped 180 degrees, stationary, on flat ground, and then stepped the simulation forward to watch what happened.
It rolled back upright. Over about a second, smoothly, like nothing had happened.
The suspension is the simple kind. Each wheel looks at how far below the ground it is and pushes up accordingly. It has no idea which way up the car is, because it only compares heights. So an upside-down chassis looks, to the suspension, like a chassis with two very compressed springs, and it duly pushes it back over.
That meant the game's main way to lose could sort itself out on its own. The whole suspension system is now gated behind a check on which way up the car actually is, with a simple floor clamp for the flipped case so it settles on its roof instead of sinking through the world.
Four: which immediately un-fixed itself
I re-ran the upside-down test after fixing three, and it still stood back up. Slower, but it did.
The self-levelling spring from bug two. I'd written it to rescue ordinary landings and never told it to stop, so it was cheerfully rescuing genuine crashes too. It now gives up past about 69 degrees, after which gravity gets the final say.
Four bugs, each one only visible after the previous fix, two of them caused by my own earlier fixes. That is the actual texture of physics work and I don't think anybody writes it down honestly enough.
And then a player told me it never ends
Weeks later: "no any trouble no any end just run run check". Which, decoded, is exactly right.
I'd verified all four of those fixes with isolated tests. Forced states, single mechanics, stepped frame by frame. Every one passed. What I had never once done was hold the accelerator down for forty-five seconds of real time and see what happened.
Maximum tilt over that run: about 40 degrees. The flip threshold is 117. You could not crash. The fuel kept topping up from pickups. The game had no ending.
Two causes, both mine, both hiding behind the earlier fixes.
The anti-tumble work had massively overcorrected. I measured how much of the time the car is actually airborne at full speed on real terrain and it's 87 per cent, so that airborne self-levelling spring wasn't an occasional assist, it was running almost constantly and cancelling nearly all rotation. With the angular velocity cap on top of it, reckless driving physically could not accumulate enough spin to flip. I dropped the spring strength by about two thirds and raised the cap.
Then the good one. A flipped car had no friction at all. None. Rolling drag was only applied inside the branch for "wheels touching ground while upright", which, thanks to my fix for bug three, a flipped chassis can never enter. So a car that flipped while doing 12 kept doing 12 forever, sliding on its roof at constant speed, and the game-over condition wants you flipped and nearly stopped. It would have waited all day.
The reason my regression suite missed it is embarrassing and worth stating plainly: every upside-down test I'd written started the car from a standstill. I'd only ever tested a flip that was already over. Added drag for the flipped case, and now a car that flips at 12 decays to a stop inside a second and the run ends where it should.
There was a third, which I found while re-testing the second. The car could wedge itself at around 90 degrees, stationary, short of the flip threshold, and sit there indefinitely. Neither ending fired. So there's now a stuck check: stationary and tilted past about 52 degrees for long enough ends the run. 52 is chosen because you can only reach about 31 by deliberately holding a wheelie on level ground, so pulling a wheelie on purpose can never trigger it.
So
Isolated tests proved each of my fixes hadn't reintroduced the previous bug. Not one of them proved you could still lose the game. Those are different questions and I had only been asking the first.
For anything with a fail state, hold the key down for real seconds against the real clock and see if the thing you can lose is still losable. It takes thirty seconds and I should not have needed a player to tell me.
Hill Racer is free in a browser, five stages, and it ends now.