Hacker News new | past | comments | ask | show | jobs | submit login
Dethrace: Reverse engineering the 1997 game Carmageddon (github.com/dethrace-labs)
137 points by mariuz on April 29, 2023 | hide | past | favorite | 38 comments

Carmageddon (and 2) seemed to have a physics engine qualitatively different to the modern norm, seemingly modelling the time of impact and the impulse response to that, rather than correcting everything after intersection has already happened. It also seemed to have different static and sliding friction and modelled air friction and wheel dynamics to the extent that a power-up increasing acceleration and grip could make your car flip up like a hot rod.

It made a huge difference to the feel of the physics and made things far less springy and slippery than box3d, havok and almost every modern game that uses a dynamic physics engine.

This did mean that you could sometimes do things that made the physics take a noticeable amount of time and cause lag, but it also made things feel far more real than any physics engine I've seen since.

Hopefully, someone will be able to reproduce that, now.

Edit: I believe it even incidentally reproduced the intermediate axis theorem [1] on cars spinning through the air, presumably as an emergent phenomenon, which I've not seen any other physics engine do.

[1] https://en.wikipedia.org/wiki/Tennis_racket_theorem

Dethrace author here: I was lucky enough to talk to a couple of the original engineers. They also thought looking back that it was the vehicle physics engine that made the game so fun to play. Once you’d got over the initial excitement of running over pedestrians at least!

Agree, Carmageddon 2's physics still feel modern to this day. I can't think of any other game except Beam NG perhaps that achieves the same level. But the impacts in Carma 2 seem to suprass even that one.

"Carmageddon: Reincarnation" had even more advanced physics engine, although game ran a bit slow, so later iteration - "Carmageddon: Max Damage" used less detailed physics engine, suitable for consoles.

I remember trying (and funding) Reincarnation and finding it hard to really explore the physics, as it lacked set-pieces and seemed less fun when compared to Carmageddon 2. It's possible that I played after the big physics downgrade of maybe 2015 [1], or on a machine that couldn't handle it.

I do wish there was a way to set up physics demonstrations, in all the games, for comparison with other engines. Certainly, the common boxes-made-of-jelly issue [2] is something I'm sure you wouldn't see from Carmageddon, though you'd probably see devastating performance issues with that same test.

Carmageddon 2 did notably lack (as far as I could tell) simulations of aerofoils and other surface dynamics and their effects on handling; cars seemed to be modelled as near-blocks as far as drag was concerned.

[1] https://steamcommunity.com/app/249380/discussions/0/34378855...

[2] https://kripken.github.io/box2d.js/demo/webgl/box2d.html

I believe Carma Reincarnation used a completely new system, I believe they talked about that in the dev blog. While the system may have been similarly powerful in theory, I distinctly remember it also being less fun than the Carma 2's system, somehow less reactive. Carma 2's approach essentially allowed for the car to be crushed into any polygonal form, best illustrated when you drove the car into the underside edge of an angled bridge or similar. It was rad and so much fun, considering and that was 1998 which still blows my mind.

This was my immediate thought when I saw this. Car collision physics seems to be mostly in src/DETHRACE/common/car.c and src/DETHRACE/common/crush.c.

Kerbal Space Program can reproduce the intermediate axis theorem, as demonstrated here: https://www.reddit.com/link/10zd76y/video/gt9kpti7whha1/play... Of course, KSP just uses the Unity physics engine which is based on PhysX; this is more of an emergent property of things being represented by several separate physics objects connected by joints, rather than a single object.

From what I have heard about Patrick Buckland (the primary author of Carmageddon) he was quite into "banger racing" and so took his joy of the sport very seriously when coding what was I believe originally supposed to be a banger racing sim.

This was one of the first games that really opened my eyes to how computers worked in High School.

IIRC it compiled a collection of ancient text files, and so if you wanted to mod the game it was as simple as finding the right args in the right .txt and then modifying the flag or value. Like I recall the demo had "no blood" but all it did was replace the HEX for "red" with HEX for "green." Switching that turned on blood, which of course was a BIG improvement for 1997.

Anyway, this is super cool and I really wish it was simpler to mess with games like this now. Incidentally Noita is one of the few games that you can still kinda do this with, though you need to know lua :/

I remember changing the weight of some of the cars in the game, making Stella a 20 ton beast.

It was not fun when you played against the modded cars. I got totally crushed when I forgot to revert the changes

tons of games use lua for gameplay scripting indeed, if there was one language to learn for modding i reckon that is the one.

kenshi also has a txt file based modding system and barebones tools too

Civilization, OpenRA, Wesnoth. Three of my favourite games, all use Lua.

There’s also OpenC1, which is an almost complete open source remake of Carmageddon. Jeff also has posted a ton of content around the internal workings and file formats etc on his dev blog - http://1amstudios.com/projects/openc1/.

This is cool, but I'm confused by the licensing. The LICENSE file says GPL, but then there's also a legal section in the README that says it's public domain but also non-commercial use only:

> Dethrace is released to the Public Domain. The documentation and function provided by Dethrace may only be utilized with assets provided by ownership of Carmageddon.

> The source code in this repository is for non-commerical use only. If you use the source code you may not charge others for access to it or any derivative work thereof.

If you release something to the public domain, you can't place restrictions on its use, so which is it?

According to a comment in the issues the license is GPL3 and that part of the readme was copy/pasted from another project that they forgot to remove.

But then that comment was made in 2021 :-P

Dethrace author here - yep, we really need to tidy that up. The problem is that it’s less fun than reversing code :)

I always find it fascinating that games like Carmageddon are made by a small team in a short period of time.

Nowadays such an accomplishment seems impossible.

Page 16 of the manual has a list of all developers:


Impossible? Clearly you haven't been paying attention. Plenty of modern games have been created by a team of 1, let alone 10 guys. Not everything is AAA

Nice, but bad licensing. Don't invent your own, just slap something common on it, please. There's plenty to choose from.


> Dethrace is released to the Public Domain.

And this:

> The source code in this repository is for non-commerical use only. If you use the source code you may not charge others for access to it or any derivative work thereof.

Don't align with each other. If it's public domain, then commercial use is perfectly fine.

This. It happened with Dungeon/Zork. Tons of people it's ilegally slapping it a bad public domain/or even a stapled GPLv2 license on custom forks where Dungeon it's non commercial only until Lars Brinkoff and the rest of Zork creators from MIT approve it. (they're close).

Hear, hear.

I saw those two things and was wondering if they really meant to add additional terms after saying something is public domain... not a lawyer, still: I don't think that makes (legal) sense.

I would really like to now how to compile this (C#) under Linux:


Is this even possible?

The correct repo is https://github.com/dethrace-labs/dethrace

(OpenC1 is different - it’s a discontinued fan remake)

I can’t get my head around the fact that people were complaining about carmageddon and mortal combat because of the blood, but now we have “unrecord”, which is pretty shocking. No lawsuits or anything there

Society has had thirty-odd years to adjust to the presence of blood-and-guts violence in video games since Mortal Kombat. It's no longer shocking and controversial, even if it's often more realistic.

Can't wait until we get a good writeup of MegaRace https://en.wikipedia.org/wiki/MegaRace

Watching my older brother play Carmageddon and Dizzy were days I wish I could just relive. I just don't have motivation for today's games.

Even the Windows 95 companion disc with Hover! was seriously fun.

I was seriously contemplating creating a Hover remake, but I feel that the game mechanics probably didn't age well. It was fun for its time though.

had so much fun getting "Artistic Impressions" in that game

Had tons of fun playing with 7??? other people on LAN. Non stop action. The second installment, and everything after that, didn't have that effect on me.

Can't say I liked the "campaign". People do dumb, unexpected shit. That's where the fun is for me. Maybe future bots would be better

We had a group from, I'd guess, 1997 to summer 1998, who played Carmageddon on a LAN in a student house more or less whenever possible. We whittled it down to a single mode of the game that we hadn't found a game breaking exploit in, and we played so tight to the bounds of what was possible that if you screwed up you were invariably dead - e.g. you take the correct short cut, you car is repairable, you win, you go a little early, car is destroyed, you lose, you go a little late, your car is less damaged but you've lost far too much time to compete with people who went earlier. We'd play in teams, one driver, one co-pilot giving directions, like rally driving.

I remember playing Carmageddon for a couple of hours after handing in my final undergraduate project, I hadn't slept for at least 24 hours, but the adrenaline meant I couldn't sleep after I finished either so we played Carmageddon. After a few matches I fell asleep on the stairs and woke up the next day, but being so young I was actually just fine.

amazing story :-D

We never played that hardcore but carmageddon was definitely a staple of LAN parties (sigh I miss those less than convenient days of lugging your box around to someone's house or a rented hall then spending at least two hours trying to network everyone up right, the excessive caffeinated soda drinks, the cheap and cheerful pizza and the LOADS of shared porn/Pirated apps etc lol)

I don't think we have to wait that long. The bots of „Halo: Infinite“ received a lot of praise, and they are "handcrafted". See this recent video by Tommy Thompson from AI & Games: https://youtu.be/4bOsJSRk0i8

Am I going crazy but didn’t the original developers re release the game on iOS a Few years ago??

This is so cool! Carmageddon was my very first video game.

Electro-bastard death ray will forever be the root of some of my fondest gaming memories


Internally they are called proximity rays :)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact