No description
  • TypeScript 36.7%
  • Python 28.9%
  • C 26.2%
  • C++ 7.4%
  • Lua 0.8%
Find a file
2026-10-11 17:11:22 -04:00
client Source link in OPTIONS (AGPL section 13, VITE_SOURCE_URL); comments cite the notes in the RE repo; Node 22.18 2026-10-11 17:11:22 -04:00
data/work Initial public release 2026-10-11 02:11:19 -04:00
docs Source link in OPTIONS (AGPL section 13, VITE_SOURCE_URL); comments cite the notes in the RE repo; Node 22.18 2026-10-11 17:11:22 -04:00
server Source link in OPTIONS (AGPL section 13, VITE_SOURCE_URL); comments cite the notes in the RE repo; Node 22.18 2026-10-11 17:11:22 -04:00
sim Source link in OPTIONS (AGPL section 13, VITE_SOURCE_URL); comments cite the notes in the RE repo; Node 22.18 2026-10-11 17:11:22 -04:00
tests Source link in OPTIONS (AGPL section 13, VITE_SOURCE_URL); comments cite the notes in the RE repo; Node 22.18 2026-10-11 17:11:22 -04:00
tools Source link in OPTIONS (AGPL section 13, VITE_SOURCE_URL); comments cite the notes in the RE repo; Node 22.18 2026-10-11 17:11:22 -04:00
.gitignore Add the tests, the Flycast probe and the RE helper tools; walkers no longer need a captured pose 2026-10-11 13:55:41 -04:00
LICENSE Initial public release 2026-10-11 02:11:19 -04:00
README.md Source link in OPTIONS (AGPL section 13, VITE_SOURCE_URL); comments cite the notes in the RE repo; Node 22.18 2026-10-11 17:11:22 -04:00

Alien Front Online, rebuilt for the browser

A from-scratch rebuild of Alien Front Online (Sega Dreamcast, 2001) that runs in a web browser: the single-player campaign, arcade battles against computer players, and online matches with a lobby and text chat. It is not an emulator. The game's rules were worked out from the original and written anew as a deterministic simulation (C compiled to WebAssembly) that the browser and the match server both run.

This repository contains no game data. You build the game from your own disc image: the models, textures, sounds, music, maps and mission scripts are read from it on your machine and never leave it. Don't publish a build (it carries the game's data) anywhere you aren't entitled to.

What you need

  • Your disc image of the game (there was one release, USA): a GDI or a Redump BIN/CUE, with its track files beside it. A CHD is converted first with MAME's chdman: chdman extractcd -i "Alien Front Online.chd" -o afo.gdi. CDI images (repacked self-boot copies) aren't supported.
  • Python 3.11 or newer, and pip install -r tools/requirements.txt (numpy, Pillow, and ziglang, which is the C compiler used for the simulation).
  • Node.js 22.18 or newer (it runs TypeScript files directly, which older versions do only with a flag).

Build and play (offline)

python tools/build_from_disc.py "path/to/afo.gdi"
cd client
npm install
npm run dev

The first command checks the disc is the retail game and writes everything the client loads into client/public/data (under a minute). npm run dev prints a local address (http://localhost:5173/): open it. TACTICS is the campaign, ARCADE a battle against computer players; ONLINE needs a server (below). Keyboard and controller both work, and OPTIONS has the bindings.

To get a folder you can put on any static web host instead: npm run build, then serve client/dist. Opening index.html straight from the disk doesn't work (browsers won't load the game's files that way).

Online play

One Node process hosts the lobby and the matches; see docs/SERVER.md. The short version, on your own machine:

cd server && npm install && cd ..
node server/main.ts --stages 0,1,2,3,4,5 --modes tdm,ctf,fortress

then open the client with ?net=ws://localhost:8090 after its address.

Enhanced art (optional)

The client can show upscaled textures and screens instead of the originals (OPTIONS > GAMEPLAY > ART), if you make them: python tools/make_upscale_kit.py writes the game's images and a brief for an upscaler into upscale/, your upscaler fills upscale/output, upscale/validate.py checks the result, and python tools/build_from_disc.py --skip-extract --enhanced upscale/output builds them in. Without this step the game is built with the original art only.

Checking it against the original

The rebuild's rules were recovered from the original game and each piece was checked against it: the original runs in the Flycast emulator with a small Lua probe (tools/flycast/afo_probe.lua, driven by tools/probe.py) that plays scripted inputs and records chosen values every frame; the tests in tests/ then feed the same inputs to this simulation and compare, value by value.

The recordings and the notes are in a second repository, alien-front-online-reverse-engineering: what was worked out about the game and how, what is verified exactly, what is approximate and what is missing. To run the comparisons yourself, clone it beside this one, then:

python tools/get_traces.py
python sim/build.py
python tests/replay_gun.py

(tests/replay_*.py and tests/check_*.py compare against the recordings.) To record your own, and to check ours against the game, see "Re-recording the evidence yourself" in the reverse-engineering repository's README.

Comments in the code cite those notes as RE:notes/re-notes.md "Section": the file notes/re-notes.md of the reverse-engineering repository, at that heading.

Layout

Folder What
sim/ The simulation (C, built to WebAssembly): vehicles, weapons, AI, rules, missions
client/ The browser client (TypeScript, three.js)
server/ The lobby and match server (Node, runs the same simulation)
tools/ Disc image to game data; the probe and helpers used to study the original
tests/ Comparisons against recordings of the original, and match / lobby / mission runs

License

The code in this repository is free software under the GNU Affero General Public License, version 3 (see LICENSE): if you run a modified version as a server for other people, you must offer them its source. The client links to its source in OPTIONS > GAMEPLAY > SOURCE CODE; if you host a modified copy, build it with VITE_SOURCE_URL set to where your version's source is (e.g. VITE_SOURCE_URL=https://example.com/my-fork npm run build). The font in client/public/fonts (Exo 2) is under the SIL Open Font License; its text is beside it. The game's own data is not part of this repository and not covered by its license.

Alien Front Online is a trademark of Sega. This project is not affiliated with or endorsed by Sega.