Victor's Devblog

If you are interested to receive those weekly articles as a newsletter, poke me offline! Automated subscription is disabled because of bots...

Otherwise, Atom feed is here!

Car Control Infancy

I couldn't work a lot this week as I had some family visiting, expect the shortest update so far. All I could do was to start working on car control, in particular with the following constraints:
- car automatically gear shifts up or down
- player's input on throttle and break is binary
- wheels should slide, depending on surface, at least as player first accelerates or breaks strongly and until car's velocity "catches up" tires speed

I attempted a couple approaches, here is current result over 3 different surfaces:

It is off course very difficult to get a feel for the difference between those surfaces just with a video, without any sound of visual effects.

The results are good enough for a day of work, but I am still very dissatisfied with them. In particular, it seems my current approach stores "energy" in the engine, so as RPM increases on ice but car keeps sliding if car goes on asphlat it suddenly gains an absurd amount of energy.

Finally here is a blooper encountered along the way, no input, car just started spinning on its own because of a positive feedback loop around wheel's friction and engine RPM: