I've been playing a lot of TrackMania recently, and got curious about what it wo...

@Screwtapello@teh.entar.net

I've been playing a lot of TrackMania recently, and got curious about what it would be like to make a game like that: arcadey, but with really detailed physics. Or at least 2D physics, let's not not set a ridiculous scope to start with.

It turns out there's a classic 2003 article called Car Physics For Games that explains the basics. I can tell it's a classic because the original site has been offline for over a decade, but searching for that title will find a bunch of mirrors different people have made over the years for their personal reference.

Unfortunately, most of them aren't *complete* mirrors. One of the resources it mentions is a collection of stats for the Chevrolet Corvette C5 (weight, dimensions, drag, etc.) you can use as a starting point for tweaking the model. Luckily, I was able to find that by digging around in the Wayback Machine.

Another thing it mentions is "cardem8b.zip", an example implementation you can run. That seems like something useful to have, but it's not even on the Wayback Machine. Luckily, I was able to find something that looked like the right file on a site called "gamedev.ru"... and it had a pre-built .exe file so I wouldn't have to mess around with building old C code!

Except that maybe I don't want to blindly run a .exe file I downloaded from a .ru domain, even though I'm sure gamedevs are very nice people. Could I actually build the code today, twenty years later, on Linux?

It turns out the demo was built with the Allegro graphics library, and Debian packages Allegro 4.4.3, which is (apparently) source compatible back to Allegro 2.0 for DOS. Sure enough, I installed liballegro4-dev, tweaked the makefile to account for the case-sensitive filesystem, added "-lm" to link the C standard math library, and it built and ran just fine.

Except I can't post a screenshot because Allegro is from that time when graphics apps ran in exclusive full-screen mode, and my window manager's screenshot key doesn't work.

Still, I'm very impressed.