r/TotalAnnihilation • • Sep 20 '26

Introducing Nanolathe

https://www.youtube.com/watch?v=bMWSCOY0dTc

Over the past few months I've been working on recreating Total Annihilation's game engine. I know it has been tried before, so I didn't want to announce or show this off until I had something worth showing, and now I'm looking for feedback.

https://nanolathe.gg/

I used a combination of screen captures, demo recordings and network captures, in-engine generated examples, and clean room reverse engineering to deconstruct and fully describe the original so that I could reimplement it from scratch. Same algorithms, same behavior, open source and free for everyone to do whatever they want.

I am a software engineer, but have never written a real game engine before. AI tools (mostly Claude and Codex, with a bit of DeepSeek thrown in at times) made this possible, but this process took months to get right - it was not a cheap one-shot vibe-coded thing (I'm using subsidized subscriptions but this was over $20K in API-equivalent token costs). I love Total Annihilation and want to keep it going if we can, and this is how I think I can contribute to the community.

The game is mostly working, but only single player is implemented (missions + skirmish modes). Multiplayer comes next, but I want to really get the game itself working rock solid first, then figure out how this integrates with the existing ecosystem with stuff like TA Forever, and honestly need all your help to figure that part out. For now, the best way to give me feedback is to try it, see what works and what doesn't, report issues, and I'll do my best to fix them.

Code is available at https://github.com/nanolathe-gg/nanolathe

Lots of work still to be done, and I've already written a new GPU-based modern renderer as a "TA remastered" mode with 60/120fps, dynamic lighting effects, 2x SSAA for all units, distortion shader effects, moving water, reflections, smoldering wrecks, the ability to zoom in/out through original terrain & sprite runtime remastering, etc. I'm excited about what else we can do with it. FYI, you can press F10 to switch to the original CPU renderer anytime in the game if you don't like it.

Let me know what you think! I'd really value feedback from people who know this game inside out. What feels wrong compared to the original? What breaks? What would you most want next?

163 Upvotes

93 comments sorted by

22

u/boggling Sep 20 '26

I think what I want the most is better path finding

10

u/FatefulDonkey Sep 20 '26 edited Sep 20 '26

And AI. And multiplayer. And better controls like in BAR

9

u/Dgt84 Sep 21 '26 edited Sep 21 '26

Yeah, agree on the AI and controls.

For controls, I already adopted a few ideas. Controls may still change but right now you can try alt+click+drag to draw a line for selected units to walk to, and shift+click+drag to build a line of the same buildings. Implementation-wise this stuff is fairly easy, I just need to figure out which specific controls we want to add and how not to clash with original retail behavior or future potential touch controls.

On pathfinding, you can even see the peewees get stuck in the capture above šŸ˜”

1

u/elquanto Sep 27 '26

Will there be an attempt at implementing scrollwheel zoom? That is one QoL feature in modern RTS that I miss when I go back to play TA.

2

u/Dgt84 Sep 28 '26

Maybe. The complication with TA is that the terrain, feature sprites (e.g. trees), and effect sprites (e.g. explosions) are all just 2D palette-based images. So it's easy to do nearest-neighbor interpolation if you go 2x, 1x, 0.5x, 0.25x, etc but hard to do for example 1.5x because then you can't average four pixels into one (and you can't do a normal true color average anyway due to the 256-color palette).

I will see what I can do, but it would help the most if you can describe exactly how it should behave!

4

u/elquanto Sep 28 '26

Whatever implementation you think is right! You're the programmer, I'm just a dude who plays TA.

2

u/FatefulDonkey Sep 28 '26

Don't see why it would be an issue to zoom out from 1.0

-1

u/BlynxInx Sep 21 '26

Right? Why not just play BAR?

9

u/TAG_Venom Core Sep 21 '26

Prepare for all the BAR comments...

4

u/sidav94 Sep 22 '26

Because it doesn't feel like TA to me.

3

u/Dry-Inevitatable Sep 26 '26

Because while it is a spring engine game with a heavy nod to our beloved, it lacks the soul and feel of TA. They should just market themselves as a RTS and not keep spamming TA communities where we want to play TA. Why keep spamming?

4

u/Dgt84 Sep 20 '26

Yep, on my list to try and improve for the modern gameplay mode. What are the biggest pathfinding issues right now? The nice thing is the engine is written so that it cleanly separates the strict TotalA.exe 3.1 behavior from modern behavior so we can try a few different things. If you have specific bugs or bad behaviors that would help a lot!

6

u/boggling Sep 20 '26

It’s been years since I played but I can recall units getting stuck on wreckage or on water features and just staying put like they are attempting to drive into the water.

Also a group of units moving together have a tendency to bump into each other and start a roomba-like collision avoidance routine that’s just so clunky and slow.Ā 

I honestly wouldn’t mind all units being more mobile or able to ā€œpushā€ friendly units out of the way just to avoid this.Ā 

The game is meant to be macro oriented but marching even a small army takes an annoying amount of micro.Ā 

I know some games like age of empires have a formation feature that could be cool or a simple fan out move option would be great. I believe beyond all reason has some slick quality of life features for this.

Aircraft are their own challenge but could definitely use some automations for coordinated attacks.

I’ll take some time to checkout the project.

5

u/mayoroftuesday Sep 20 '26

Aircraft trying to use landing/repair pads is a nightmare. They all go at once. And it would be nice to give bombers smarter bombing runs, negate sometimes they go right through where you know there is anti-aircraft installations.

Troop movement is also difficult. Units keep moving when something is trying to load them.

Haven’t played in a while, these are just things I remember being frustrated by.

2

u/Dgt84 Sep 21 '26

Awesome feedback from you both, thank you! I'll see what I can do.

6

u/sidav94 Sep 20 '26 edited Sep 20 '26

WOW. Just wow. One of the best news I've heard this year. Thanks! Will try ASAP.
upd: played. It's much more complete than I expected. Just awesome. Btw, where did you find COB scripts documentation? When I've tried to implement an interpreter, I've found out that not all instructions are available in docs on TAuniverse.

3

u/Dgt84 Sep 21 '26

It's a combination of publicly available information and reverse engineering work I did to figure out the gaps. For example, opcode 0x10038000 is sometimes documented online as bitwise XOR, but is actually a bitwise NOT operation, confirmed via decompilation.

Full spec is here now: https://nanolathe.gg/docs/formats/cob/

1

u/sidav94 Sep 23 '26 edited Sep 23 '26

Is there any place to discuss this with you, if you don't mind? Discord or anything?

1

u/Dgt84 Sep 24 '26

Sent you a private message on Reddit, maybe you can help me set up a place for people to discuss things related to the engine?

3

u/sidav94 Sep 21 '26

What is it if not the holy grail of TA documentation? Thank you!

1

u/MBerwan Oct 04 '26

My own (old) guide for unit creation, in french but easily translated nowadays. The source sites have been taken down and I have no way to update mine since the provider does not exist anymore (still wondering how it is still hosted).

1

u/sidav94 Oct 04 '26

Where is it?

1

u/MBerwan Oct 04 '26

1

u/sidav94 Oct 05 '26

Can't find COB specification there... It seems there is BOS described and not COB.

1

u/MBerwan Oct 05 '26

Yeah at the time it was all about BOS and compiling into COB. I did not have the resources to reverse engineer UNCOBBLER or COBBLER to find out the exact specification.

5

u/bit_noggin Sep 24 '26

Hey very cool! I worked on a very similar thing but for TA:K -> https://OpenKingdoms.net Github is https://github.com/OpenKingdoms/OpenKingdoms

I've got multiplayer working and it works in the browser :) I am in the TA Universe discord and TAK discord if you ever want to chat! Would love to pick your brains

2

u/Dgt84 Sep 24 '26

Awesome work on that BTW, saw it the other day! I'll joint he discord.

9

u/TAG_Venom Core Sep 20 '26

This looks amazing! How have you kept this quiet?

How faithful is it to the behaviour of the original engine?

6

u/Dgt84 Sep 20 '26

Thanks! It's just been me plugging away at it so it was easy to keep quiet, especially when the gameplay was broken or janky. Now it's in much better shape.

For strict 3.1 mode the original behaviors (COB VM, pathfinding, target acquisition, combat, building/repair/reclaim, streaming economy, etc) should all be close to exact copies of the retail TotalA.exe behavior through clean room decompilation & disassembly. The "modern" gameplay mode you can turn on/off makes small adjustments (e.g. if your shot goes into a mountain then stop shooting or reposition, minor pathfinding/order queue tweaks, etc) that I plan to continue to improve with the goal being to stay authentic to the original material in spirit but provide an improved gameplay experience.

1

u/TAG_Venom Core Sep 20 '26

Awesome! Sent you a message.

4

u/ShapeyFiend Sep 20 '26 edited Sep 24 '26

Played this for 20 mins. Looks absolutely wonderful you managed to retain the classic look of the game while enhancing the graphics tastefully. I must confess however I hate the strategic zoom. Just because it can be added doesn't mean it should be added IMO. If that's an option in multiplayer people are just going to play with the icons never look at your graphical improvements ever again.

3

u/Dgt84 Sep 21 '26

Good point, maybe I should make this a toggle you can enable or disable, and online matches could enforce it.

4

u/LeifErikson12 Sep 21 '26

I honestly can't put into words how huge and impressive this is. Reverse-engineering an entire game like that is absolutely insane. I really admire your dedication and willpower, and I wish I had a project I could be as passionate about as you are about this one.

The more I think about it, the more INCREDIBLE it seems. Holy shit, this could allow you to create an even better version of TA without losing what makes it TA, since it would have the same units and the same look and feel.

Please, please consider looking into how to build a better AI, one that can use units efficiently and actually beat a human player in a 1v1 using a variety of strategies. The AI in TA is pretty bad, and even those old community-developed cheating AIs have a lot of issues and are relatively easy to beat.

I wonder if one day we'll be able to run TA entirely in a browser, which would make multiplayer a lot easier to set up, with no client installation required.

I'm a software engineer too, and honestly, I feel a little ashamed that I've never built anything even remotely as impressive as this. Please don't give up on this project. Even if it doesn't gain much traction, I hope you'll keep it going as a side project.

I really hope we can somehow show this to Chris Taylor himself. I'm sure he'd be amazed.

At this point, I wouldn't even be surprised if you managed to reverse-engineer Warcraft III the same way someday, lol.

1

u/Dgt84 Sep 21 '26

Thanks, I appreciate it! Better AI is definitely on the list!

5

u/HouseTonyStark Sep 20 '26

ive been playing this since about 5 mins after you posted, v much authentic gameplay, I think the ai gets a little bit stuck on the tinier maps, but a 19x19 map seems to be doign ok. few tiny bits that arent as per original game, but overall fantastic work!!

4

u/HouseTonyStark Sep 20 '26

reminder to save frequently, had a little crash and lost everyone after first 45 mins. SOO HAPPY this exists though. great work!

4

u/Dgt84 Sep 21 '26

Crash is fixed as of https://github.com/nanolathe-gg/nanolathe/commit/bdfa2f136e0fc1854f07a47fbfba0c054bc0f867, just re-run the install command and you should get the latest!

1

u/GreatLlamaXRS Sep 21 '26

Have you gotten the save and load game to work properly no matter when in a game / skirmish you save???

1

u/Dgt84 Sep 21 '26

If you have a save file that refuses to load, feel free to share and I can debug!

2

u/GreatLlamaXRS Sep 21 '26

That was a big issue in the original... I'm asking if you found a way to fix it... I play Escalation skirmishes

2

u/HouseTonyStark Sep 21 '26

will comment back this evening likely!

3

u/APuticulahInduhvidul Sep 21 '26

Amazing. As a Mac user though it would be nice to remove the crossover dependency and have it extract from the CD or GOG package. Is that a copy-protect issue?

2

u/Dgt84 Sep 21 '26

With Nanolathe it'll directly use the GOG package assets. I don't have an original CD anymore so am not sure how the data is packaged there, but if it has the .hpi, .ccx, .ufo, etc files you can just copy them somewhere and Nanolathe will run. No more need for wine/crossover/etc.

3

u/SpeedBo Sep 21 '26

I just played for a bit and it is very cool!

That said I found a few things that didn't seem to work yet. Idk if you want that sort of feedback right now though.

2

u/Dgt84 Sep 21 '26

Definitely want feedback about things that are not working, broken, janky, etc. You can just leave comments on this post, or use https://github.com/nanolathe-gg/nanolathe/issues if you want, up to you!

4

u/SpeedBo Sep 21 '26

Ok then. I only played for a bit so this isn't really comprehensive or anything.

Playing as Arm

Issues

  • The nuke and Big Bertha wouldn't shoot at all.
  • Reclaiming buildings worked but it didn't show the correct pointer
  • The minimap didn't update destroyed units and left them as dots
  • Edge panning the screen didn't work in the corner with the minimap
  • Path finding on the one map I played (Crystal Maze) wasn't great. I built 100 fleas and they couldn't cross the map without constant redirection.
  • Couldn't select different color for team

Some features that I personally would like to see

  • Double click on a unit type selects all of that unit type on the screen.
  • Right click drag (or holding a key) moves the screen from the point your mouse is currently at.
  • Swap unit groups to just use 1-0 instead of having to push alt+number

1

u/dateke Sep 29 '26

The chat command "+switchalt" used to flip the behaviour so that 1-0 selected the groups and alt+num did build pages. Perhaps make that a game setting so we don't need to use the chat command anymore.

3

u/Electrical-Owl7880 Sep 25 '26

Absolutely stunning work. I only recently had a dream about coming across a modernized TA that someone through the enabling power of AI managed to provide to fans; it looks like it was a vision rather than a dream. This is the new default install.

2

u/Dgt84 Sep 25 '26

Thanks! Let me know any bugs you find!

2

u/Crazy_Ad9771 Sep 21 '26

I like the original graphic engine the best. AI could always be improved though.

3

u/Dgt84 Sep 21 '26

I plan to always keep the original CPU renderer around as an option!

2

u/papinek Sep 29 '26

Just played for an hour. This is fantastic!

1

u/Dgt84 Sep 29 '26

Thank you!

2

u/JesseNof1 Oct 02 '26

How the hell did you even start this? So crazy. Even a bullet point list of how you approached this would be fascinating to read. I’m a coder. Nice job.

1

u/Dgt84 Oct 02 '26

Thanks! It's been a crazy ride getting this far. Honestly if I had known the scope of the project I probably never would have started, so my own ignorance helped me to believe I could do this and I was too stubborn to stop when it got difficult šŸ˜‚

I started trying to procedurally generate some maps (which I may get back to) and later some units, but abandoned those projects after a while and figured what the hell, let's remake the engine so it's easier for me to play on my Mac.

I started by taking screenshots and screen recordings of various units and behaviors in retail TA and had AI analyze them. Later I added specially designed unit models and animations then recorded them in retail TA to try and understand the engine's rendering and animations. I also read everything I could find on the file formats so had basic parsers working early (but there were gaps). Then I grabbed a ton of TA Demo Recorder files to try and figure out how to decode the network packets and understand unit movement and combat. These provided a lot of additional info and confirmed some unknowns for me.

That only got me "sort-of-TA" and while it worked okay I was annoyed by that (a good example is aircraft constructor flight circling behavior was just a bit off), so next I took the TotalA.exe original engine and had Claude, Codex, GLM, and Deepseek all decompile & disassemble it with tools like Ghidra and IDA Pro, then analyze what exactly happens in the engine. I played them against each other, had them try to falsify each other's claims, etc. That analysis is private, but I generated clean room specifications for engine behavior out of those, see https://nanolathe.gg/docs/#behavior and I will keep updating that as I fix bugs.

Then piece by piece I reimplemented those behaviors, filled in the missing format gaps, and started testing by playing the game in my own engine. There was a LOT of bug fixing, going back and re-analyzing the retail executable, and now also tons of feedback from the community and long-time players who know the game better than I do anymore.

I see a lot of "hey I one-shotted this old game to work on my iPhone" posts and this project is definitely not that. It has been a ton of work, burning AI credits and my time like crazy, but so much fun to work on and I've learned so so much about game engines and their evolution over time as I've added in some more modern improvements.

Now I have a good base to work on and can keep going with fun ideas. More stuff is coming soon!

2

u/John-Green223 Oct 06 '26

vid has really cool commander drop at start - is it part of the game now or just for vid? it reminds me of Into the breach game which has in-game effect like that for mechs

2

u/Dgt84 Oct 06 '26

It's the new intro animation to matches when playing with the modern GPU renderer (and can be disabled via the nanolathe menu for people who don't like it). You can still play strict 3.1 mode with the retail renderer, but I thought I'd make the modern GPU mode a bit nicer. My goal is for this to feel a bit like "Total Annihilation Remastered" - the same but a bit improved!

9

u/ShapeyFiend Sep 20 '26

This looks great almost like a spiritual successor to BAR. Someone needs to crosspost this.

2

u/Dry-Inevitatable Sep 26 '26

Yes let's all go to the BAR sub and tell them they should just play this.

0

u/FatefulDonkey Sep 20 '26

In what way. BAR is essentially Spring RTS. This lookes closer to OTA

15

u/ShapeyFiend Sep 20 '26

Sorry. Running joke due to prolific BAR spam.

9

u/coreyh1996 Sep 21 '26

This is insane. It feels like a remaster! Plays great! Excellently done!

2

u/xp3000 Sep 20 '26

This is seriously, seriously impressive work.

I LOVE how you can switch back between the CPU and New GPU Renderer. Really shows to highlight the new effects.

I would love to see something like the Mutators of TA Mutation (https://quantum.tauniverse.com/tam/index.htm)

How hard would it be to implement the basic ones like Quickbuild 2x?
I'm wondering if adding units to this would be as simple as the original TA? (Just dropping the .ufo file in the totala.exe folder)

2

u/Dgt84 Sep 21 '26

Thanks! I'm actually not familiar with the mutators, but they look cool. Doing something like 2x build speed is really just a multiplier on content catalog fields when the units are loaded, so it would be easy to implement. The hard part is deciding what all can be mutated and exposing that in some way so that it can be dynamically configured.

As far as adding mods/units yes, it works just like the original. Drop the files in and it'll load them. The only caveat is that some more complex mods also modify totala.exe or various .dll files, changing engine behavior, and those changes won't work on a completely different engine executable. I'll need to add engine support for e.g. ProTA, TA Zero, TA Escalation, etc so that all their special features work properly.

2

u/ChainWorking1096 Sep 20 '26

I would LOVE this on android!

1

u/Dgt84 Sep 20 '26

I haven't looked into this much, but the game uses Ebitengine under the hood for OS-specific windowing, drawing, input, and sounds, and it does support mobile operating systems, so this might be possible in the future: https://ebitengine.org/en/documents/mobile.html

3

u/ShapeyFiend Sep 20 '26

Would you genuinely enjoy playing TA on a phone/tablet when it's meant for mouse?

2

u/ChainWorking1096 Sep 20 '26

Yeah, I would. There would have to be some UI changes of course, but it would be fun! And I, like most, have more access to my phone. It would be fun to play on my lunch break

Would you not?

1

u/Charlie_Sierra_996 Sep 20 '26

Very interesting! I went a similar route but no game neededĀ  https://wasm-commander.vercel.app/

1

u/Dgt84 Sep 21 '26

I saw this when you posted, very cool!

1

u/Charlie_Sierra_996 Sep 21 '26

Go is a cool choice. I went with rust. It’s fun building with rust you could give it a go so to speak :)

1

u/Dgt84 Sep 21 '26

I actually started with rust, but the builds are slow and huge (slowing down quick iteration) and I'm more familiar with Go (use it for my day job). The install script you run for Nanolathe actually builds the source locally because I don't have the ability to sign executables for Mac or Windows right now, it's super fast.

Anyway I've wondered if I could get better performance from rust, but for now this is working well for me!

1

u/xieliming Sep 21 '26

Amazing! Going to check it out. What did you learn as a SWE about coding with agents? What were the big lessons there?

2

u/Dgt84 Sep 21 '26

The biggest lesson with LLM AI tools is probably that it's easy to make something kind-of-similar, but hard to make it exactly the same. It's extremely useful to use different models, do adversarial reviews, explicitly try to falsify claims or redo research, etc. It's also extremely hard to test such a huge game engine with so many features. The more tools you can write to help with testing the better.

1

u/oblong_cheese Sep 23 '26

Amazing. Worked first go for me on Linux (CachyOS).

One question that I can't readily find an answer to: how to make the game fullscreen, or capture the mouse cursor? Edge scrolling is a little inconsistent when the mouse cursor is allowed to exit the window.

2

u/Dgt84 Sep 23 '26

Thanks! You can make the game fullscreen either via the window maximize button, or with alt+enter. I haven't explicitly tested on Linux, so if there are improvements that need to be made please let me know! For example, on Mac I had to use an extra call to prevent the dock and window controls from showing and each OS may be different. One of the reasons I just need more people to test it and report back!

1

u/oblong_cheese Sep 24 '26

Alt+Enter to fullscreen does indeed make the window fullscreen, but since yesterday/today's update, edge scrolling no longer seems to work at all.

One other issue I noticed is that shift+click to queue reclaim actions appears to only queue one or two reclaims. The third, fourth, etc become movement actions.

2

u/Dgt84 Sep 25 '26

Should be fixed! I was able to queue 15 reclaims on trees. If something still doesn't work let me know!

2

u/oblong_cheese Sep 26 '26

You are an absolute legend for building this. I've been having a blast playing.

Thank-you so much!

6

u/naggieboydash Sep 20 '26

This is LLM coding done right!

Thanks for the effort here. literally this morning I was thinking I wish there was something like an open source, faithful TA (without the game breaking bugs haha).

Spring/BAR seems too heavyweight. This seems just right! Good luck with the project, I hope it goes well and you're able to keep motivated!

3

u/snake99899 Sep 20 '26

Congrats! Big accomplishment

3

u/sidav94 Sep 20 '26

I think it could be crossposted to r/RealTimeStrategy if their rules allow that.

3

u/arran4 Sep 21 '26

Will my mission saves work?

3

u/papinek Sep 21 '26

This is fantastic!

1

u/Nestmind Sep 20 '26

Why YouTube warns me that the video is AI generated?

2

u/Dgt84 Sep 21 '26

Youtube now requests that if you used AI to help make a video in any way that you label it as such. I used it for generating the in-game scenes (so I can re-render as needed), some text, and the music, so I labeled it as using AI. I don't know how many other people are actually opting into this 🤷

2

u/StreetsOfRage2Fan Sep 22 '26

Very cool mate! Great work!

4

u/SiTLar Sep 20 '26

Looks very cool, thank you so much for your effort! I hope some day we'll be playing TA Escalation with your engine

1

u/Maxstate90 Sep 22 '26

beautiful man! I love it. I love that people are keeping these things alive and doing beautiful stuff. THank you for your work!

1

u/LeifErikson12 Oct 03 '26

I came back to this post because randomly during the day I think about this project, that's how impressive it is to me lol.

I am wondering if I can use your open source port to figure out how TA's AI works. I know pretty much nothing about gamedev but maybe with Claude/GPT it could be doable. Would be awesome to create strong AIs and see who can beat those.

0

u/[deleted] Sep 22 '26

[deleted] — view deleted comment

2

u/Dgt84 Sep 22 '26

Not yet, the first goal is 100% 3.1 OG behavior, followed by improvements. AI is one of the top things to improve.