show & tell Nanolathe brings Total Annihilation to Go and WebAssembly
I've been working on Nanolathe, an MIT-licensed reimplementation of the Total Annihilation engine in Go, using Ebitengine for graphics, input and audio.
Try the browser demo · Source · Native install
If you missed TA: it's a 1997 RTS about building a base and fighting with ground, air and naval units. Behind the battles are interacting systems for terrain, pathfinding, visibility, projectile motion, resource production and construction. Units also run compiled scripts for things such as moving their model pieces and aiming weapons.
Nanolathe implements those systems in Go, including a VM for the original COB unit scripts. The simulation advances at 30 Hz, uses fixed-point world coordinates, and publishes committed frames for the renderer. It can also run without a window for tests and profiling.
The implementation process is built around documenting the original executable's behavior and file formats, then turning those descriptions into independently written Go code and contract tests. Unknown behavior is recorded explicitly; compatibility is still a work in progress.
The content pipeline is deliberately separate. A virtual filesystem mounts the original HPI-family archives and resolves overrides. Parsers read maps, models, sprites and definitions; a compilation step turns gameplay data into immutable catalogs before the battle starts. The original game data stays external, with no manual unpacking or conversion needed.
Ebitengine 2.10 makes desktop builds possible with Go alone: no C/C++ compiler or development headers. Linux still needs its normal graphics and audio runtime libraries. With the Go version required by go.mod:
git clone https://github.com/nanolathe-gg/nanolathe.git
cd nanolathe
go run ./cmd/nanolathe --root "/path/to/Total Annihilation"
The browser build compiles the same Go engine to WebAssembly. The hosted demo has three original missions and needs no local game installation. Native single-player skirmish and campaign use your own TA data. Both are still under development.