Profile
Back to NewsBack
GitHub Trending 6 min
Reader Mode
Glenn332/Empire-At-War-Browser-Edition: Star Wars: Empire at War and Forces of Corruption in your browser, on a new engine built for huge battles. Bring your own copy of the game.

Glenn332/Empire-At-War-Browser-Edition: Star Wars: Empire at War and Forces of Corruption in your browser, on a new engine built for huge battles. Bring your own copy of the game.

22 hours ago

Star Wars: Empire at War - Browser Edition

Play now at playeaw.com  ·  Windows app  ·  Progress  ·  Discord

Support me on Ko-fi Join our Discord

Empire at War: Browser Edition

Star Wars: Empire at War came out in 2006, and Forces of Corruption followed it. Nearly twenty years on, people still play them, and the modding community keeps them alive with huge total-conversion mods. The original engine has not kept up. It is 32-bit and single-threaded, and it was built for the hardware of its day. Large mod battles can bring a modern PC to its knees.

This project brings the game back on a new engine that runs in your browser. It reads your own copy of the game, so you get the same units, maps, models, sounds, scripts and AI, and it is built to keep big battles running smoothly.

Where to play

The app finds your Steam install and your Workshop mods by itself, and it updates itself.

You need your own copy of Star Wars: Empire at War - Gold Pack (the base game and Forces of Corruption), for example from Steam. Nothing of the game is hosted or shipped here. On first start, you point the game at your installed game folder. You can also import the folder once as a single archive, which works in every browser and lets you play offline afterwards. The start page walks you through both options.

What you can play

  • Space skirmish: the original maps, factions, units, heroes, abilities and HUD, against the computer or
friends.
  • Land skirmish: ground battles with reinforcement points, buildings, garrisons and turrets.
  • Galactic conquest: the campaigns and the galaxy map, with invasions that lead into real space and land
battles. This mode is still in progress.
  • Multiplayer: internet and LAN games through the original lobby screens, including saving a multiplayer game.
  • Mods: Steam Workshop and local mods load the way the original loads them, and you can stack several in your
own order. Fixes are made in the engine, never for one particular mod.

progression.md shows exactly what is finished, what is partial and what is still missing.

Built for big battles

The point is to play battles the original engine struggles with:

  • Hundreds of ships and fighters at once. The built-in benchmark starts at 100 against 100 and goes up to 400 ships
per side.
  • Hot paths such as route planning and the soldiers' animation run in WebAssembly. The space battle can step on a
thread of its own, apart from the drawing.
  • Rendering uses WebGL or WebGPU, with instancing and batching, so dense mod battles stay fluid.
  • Press F2 in any battle or on the galaxy map to see frame times live.

Faithful to the original

The engine is new code, not a port of the original executable. It behaves like the original because it reads the same files and follows the same rules: the XML unit database, the .meg archives, the models and animations, particles, maps, the Lua story and AI scripts, the audio events and the game's own dialogs. Where the original's behaviour is not obvious from its data, it is worked out from how the original engine does it. Where something is still our own approximation, the progress list says so.

Controls

The controls are the same as the original:

| | | |---|---| | Left click / drag | select, box-select (Shift adds, double click selects the same type) | | Right click | move, or attack what is under the cursor | | Ctrl + right click | attack-move | | M / T / F / G / X | move, attack, attack-move, guard, stop | | WASD / arrows / screen edge / middle-drag | pan | | Wheel / Q, E | zoom / rotate | | Ctrl + middle-drag | turn and tilt the camera, also on the galaxy map (remap it under Controls → Other) | | Ctrl+1…9, 1…9 | set / recall a control group | | P, + / - | pause, game speed | | Esc | cancel, deselect, menu |

For developers

It is plain JavaScript modules on three.js, with no build step needed to run it.

npm install
npm start

This starts a development server on http://localhost:8377/. It serves the game data straight out of an install next to this folder (../Star Wars Empire at War) or from SWR_GAME=. Add --mod to lay a mod over it.

Some useful addresses:

  • play.html?autostart&faction=Empire&enemy=Rebel&map=KUAT skips the setup screen.
  • play.html?mode=land starts a land battle.
  • play.html?benchmark=100 starts the space benchmark, and play.html?mode=land&benchmark=30 the land one.
  • viewer.html?model=EV_STARDESTROYER.ALO opens the model viewer.
Other commands:

| Command | What it does | |---|---| | npm run wasm | rebuild the WebAssembly modules from wasm/ | | npm run build:prod | build the site into dist/ | | npm run deploy:prod | build and publish the site and the multiplayer lobby (lobby/) to Cloudflare | | npm run app | build the desktop app for the system it runs on (src-tauri/, Tauri; Windows, macOS or Linux) | | npm run app:android | build the Android app (an APK; needs JDK 17, ANDROID_HOME and NDK_HOME; -- --debug for a test build, -- --tester for a release APK signed with the SDK debug key to share with testers) |

The code lives in a few places:

  • public/ is the whole site.
  • public/js/ holds the file formats, rendering and audio.
  • public/js/game/ holds the simulation, AI, HUD, land battles and galactic conquest.
  • tools/ has Node helpers and tests.

Use of AI

This project is AI-assisted. I use AI to:

  • study how the original engine behaves, which is where it helps the most,
  • write functions, from editor autocomplete to fully generated functions,
  • write most of the automated tests,
  • write git commit messages.
Implementation is done with Anthropic's Claude models and testing with OpenAI's GPT models.

I inspect and test every generated function myself, and everything that ships is my responsibility. Game behaviour is checked by hand against the original game and against the mods people have sent me, and automated tests guard against regressions.

The project has no generated assets. Every model, texture, sound and voice line comes from your own copy of the game.

License

Copyright (C) 2026 Glenn332

The engine's code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. It is distributed in the hope that it will be useful, but without any warranty. See LICENSE for the full text.

Bundled libraries keep their own licenses: three.js and Fengari are MIT (public/vendor/three/LICENSE, public/vendor/fengari/LICENSE), and the FFmpeg core is GPL-2.0-or-later (public/vendor/ffmpeg/COPYING.GPLv2, source in public/vendor/ffmpeg/SOURCE.md).

Legal

This is a non-commercial fan project. It is not affiliated with or endorsed by Lucasfilm, Disney, Petroglyph or Electronic Arts. Star Wars, Star Wars: Empire at War and its game data are © and ™ Lucasfilm Ltd. / Petroglyph. The license above covers only this project's own code. It grants no rights to the game, its data, or the Star Wars names and trademarks. The engine contains none of the original game's code or data; you need your own copy of the game to play.

Chat with me