Sid Meier's Alpha Centauri, in your browser

3 min read Original article ↗

About this port

This is Sid Meier's Alpha Centauri (1999) and its expansion Alien Crossfire, running in your browser. Nothing was rewritten: it's the original game code, so the AI, the rules and the quirks are the ones you remember.

How it works

  • The original Windows programs (the game itself plus its sound library) were translated instruction by instruction into C, then compiled to WebAssembly. That's static recompilation, so there's no PC emulator running underneath.
  • A small, hand-written stand-in for the parts of Windows the game uses (windows, drawing, DirectDraw, sound, files) hooks it up to the browser: a canvas for the picture, Web Audio for sound, and your browser's own storage for saves.
  • To keep it faithful, the port is regularly run side by side with the untouched original under an emulator, and every Windows call is compared.
  • Game files download as they're needed and are kept in your browser, so the second visit starts almost instantly.

What's added

  • Settings: widescreen, trackpad panning, cutscenes that fill the screen, sharper movie upscaling, and the original's hidden smooth unit animation. All optional.
  • Fit window and Fullscreen (in fullscreen the mouse stays inside the game, so you can scroll the map at the screen edges).
  • Saves stay in this browser. Export them as a .zip to back them up or move them, and import saves from a PC install: single .SAV files, the whole saves folder, or a .zip. Each game keeps its own saves (the original shared one folder, where the two overwrote each other's autosaves), and imports go to the right game by themselves.

Fixes to the original game

The game logic is left alone, bugs included, apart from two bugs that can break a game:

  • In long games, the end-of-game replay wrote past the end of its event log and corrupted memory. It's now capped at the log's size.
  • Force-ending a turn while a needlejet was still in the air made every faction replay the same year (with an extra round of income). Now the jet just uses up a turn of fuel.

Credits

  • Sid Meier's Alpha Centauri and Alien Crossfire are © 1999 Firaxis Games and Electronic Arts. This is an unofficial fan project, not affiliated with or endorsed by either.
  • Thanks to Thinker (induktio), whose notes on the engine's bugs pointed at both fixes above.
  • Text is drawn with FreeType using the Liberation fonts.

Still in active development. If something looks wrong, the Feedback button goes straight to the developer.