News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu

Working native port of Stunts with 8 multiplayer over Internet

Started by x29retaliator, Yesterday at 07:00:51 PM

Previous topic - Next topic

x29retaliator

Hey guys, I'm new here.

I have a working port (faithful from disassembly) of the original Stunts to modern Linux using SDL3, written in C.

I'm very concerned with all the features being faithfully implemented and I've only added features that can be toggled and aren't on by default. E.g. I have a feature to disable the "power gear" bug, but it is just on by default.

I guess the most interesting features to you guys might be:

* Supports up to 8 players simultaneously racing over UDP/IP
* 2x larger maps (optional!) than the original Stunts

Is this project of any interest to you guys? I've included a screenshot just showing three cars at the same time.

Edit 1: I also have a "lobby and game creation application" in the works where people can make rooms, join rooms, race, see results, etc. Is that of interest to the community?

Edit 2: Maybe I didn't explain it very well, but this could obviously be quite easily made to work on modern Windows, macOS, already works on Linux. It is modern C and SDL3, so it is easy to get running.

The reason I ported it is that I took a look at the original DOS disassembly and for features that I wanted, such as eventually integrating Stunts with an open world Test Drive 3 style game (basically merging the two games), adding proper network support, much larger maps, and brand new (all optional) features, it is just too painful to hack the original game. It can be done, but once you have everything written from scratch it becomes easier to both play the game without needing Dosbox (with all respect) and modern features become much more manageable.

llm

are you CommonLoon102? there are so many devs lately that doing stuff around stunts - with serveral nicknames on the different platforms - hard to keep track who is who

can you explain in more detail how you port over to C - manually, by AI help, how you kept features/bugs/behavior the same etc.
is also upgrading the 3d engine on your list?

will your project be open source?

x29retaliator

Quote from: llm on Yesterday at 09:54:20 PMare you CommonLoon102? there are so many devs lately that doing stuff around stunts - with serveral nicknames on the different platforms - hard to keep track who is who

can you explain in more detail how you port over to C - manually, by AI help, how you kept features/bugs/behavior the same etc.
is also upgrading the 3d engine on your list?

will your project be open source?


No, I don't know who that is.

The port was done through a combination of IDA Pro, manual work, heavy use of AI (on the "agentic coding" side, not on the vibe coding side, I have a CS degree).

I've also used Restunts as a starting point.

What I don't have: I don't have a super nice, polished C port that is easy to understand.

What I do have: A flat 64-bit C faithful port, not a reimplementation. Not a "this is what I think Stunts should have been", and also not "this is what feels right to me" take on Stunts.

It is Stunts. Because it just faithfully uses the original logic present in the original disassembly. I've leveraged repldump and pixel by pixel comparison with AI assistance, and my own testing.

Why is my own testing valuable at all? Because when porting over blocks of code and preserving the logic faithfully it is harder to introduce slight differences in car handling, and a lot easier to introduce (through your own bugs) something that causes either a huge difference, or that is exactly right.

And yes, obviously, there are almost certainly still quirks, weird things, etc. Hopefully not with the physics and handling of the car though. I can assure that I can trigger the power gear just as before on loops and on jumps and the car handles as it should.

A lot of the code is just literally translated directly into C, without it even being that clear what is happening, this makes it really ugly, e.g.:

    if (framespersec != 0x14)
        goto loc_17A8E;
    var_2 = 6;
    goto loc_17A93;
loc_17A8E:
    var_2 = 0xC;
loc_17A93:
    if (arg_carState->car_engineLimiterTimer == 0)
        goto loc_17AA1;
    arg_carState->car_engineLimiterTimer--;
loc_17AA1:
    arg_carState->car_speeddiff = arg_carState->car_speed2 - arg_carState-          >car_lastspeed;
    arg_carState->car_lastspeed = arg_carState->car_speed2;
    arg_carState->car_lastrpm = arg_carState->car_currpm;
    if (arg_carState->car_transmission != 0)
        goto loc_17AE6;
    if (arg_carState->car_changing_gear != 0)
        goto loc_17AE6;
    if ((arg_carInputByte & 0x10) != 0)
        goto loc_17B0F;
    if ((arg_carInputByte & 0x20) != 0)
        goto loc_17B2E;
    goto loc_17B86;

I have a soft spot for the aesthetics of the 3D engine so updating that is low on my list of priorities.

I'd be happy to share the code, but I'd like to polish it first some, if there's genuine interest in it.

So in other words, if there would be some interest in e.g. maybe trying out some multiplayer action with 8 (or more) cars in Stunts, maybe with a lobby management application, then that would be motivation for me to polish it enough.

I'd rather avoid releasing something that comes across as just "80% but not enough to spark any interest", if that makes sense.

But yes: Open source, working on Windows, macOS, and Linux. I have it working on Linux already.

As a cute feature, I can also drive on the "intro disc" in the beginning, the one that floats in the universe with the stars, etc.

HerrNove

Hello and welcome, x29retaliator!

Thanks for your message! As much as I am getting fatigued by the deluge of retro ports in the post-Codex era, the presentation of your project is very tasteful and makes me curious. I do not take part in live races, but offering 8-way multiplayer as main feature shows to me that you have a good feeling for the game, where to improve it and where not to.

I'm quite sure the community could make good use of the multiplayer. Leaving DOS behind is not necessarily a progress (because with emulators I can play with my beloved huge rectangular pixels, Alain with his CRT-like shaders and Spoonboy with his phone) but I know how much easier is to work in a flat addressing space.

I'll take the freedom to advertise your project on the chatbox in the front page; this should get it more visibility.

Alain il professore

Hello my friends,

Thank you for sharing this — it is a very interesting project.

I doubt that 8-player multiplayer alone will suddenly attract far more people than the handful of pipsqueaks who sometimes take part in live events with the original game. However, quoting Indy, this code definitely belongs on GitHub and deserves to be preserved and documented.

Even beyond multiplayer, a faithful C port based on the original disassembly could become an extremely valuable reference for the Stunts community. It could help the next person climb another step on the Stunts reverse-engineering ladder — especially if the original behaviour, bugs and quirks have been carefully preserved.

The Stunts Wiki could then document the project and link to the repository.

So yes, I would definitely be interested in seeing the code released.
It is reasonable to expect that genetic influences on traits like IQ should become less important as one gains experiences with age. Surprisingly, the opposite occurs.

alanrotoi

Looks promising for live races. Is this mod played with a server or local?

x29retaliator

Thanks for the interest, guys!

"Is this mod played with a server or local? "

So, to clarify, this isn't really a mod. It isn't something you install on top of the original game, it doesn't need Dosbox, it doesn't use the original game.

It is a "line by line" implementation of the original game, on a modern system. But it doesn't feature any new graphics engine, new physics engine, it is the same original Stunts logic---resulting in the same original handling of the car, physics, graphics.

So you get just a modern binary you execute, which launches the game, yes, pixelated and just like the original game, not a modern graphics high resolution variant, or anything like that (you can get it full screen, but it becomes just as pixelated as it would in Dosbox).

The multiplayer feature is just baked into the game itself, you can select it from the options.

But I also have a modern launcher that just launches the game. The map rendering preview is just a placeholder for now.

llm

some more questions:
-did you used the partially ported C-source of restunts or is your port only based on the restunts-assembly source?
-does you port also support sound (pc-speaker, adlib and mt32 emulation?)
-are you interested in integrating the SuperSight mod (https://wiki.stunts.hu/wiki/SuperSight) of HerrNove? Video: https://marnetto.net/assets/2026-01-27--camel/ss-200x.mp4

-github release would be great
-can you release your linux binaries?
-i could help doing a windows port, if needed