32 seconds of browser gameplay on MAP12 with four practice bots. Original AIOI music and game audio; no commentary.

We played Doom2D as kids, and we've wanted a browser version for a long time. We wanted to send someone a link and play a few rounds together, without having to walk them through an installation first.

We've now built it together with Astra. It's a Rust rewrite of Doom2D Forever, and you can play it here. The campaign runs in your browser, and there's a server for multiplayer. The video above was recorded from the browser client playing a match with bots.

What we rebuilt

We used Doom2D Forever's source as the reference for the new Rust engine. That includes movement, weapons, monsters and map logic, along with the code that loads resources, draws the game and handles networking. The maps, graphics and sounds come from the existing game.

The browser runs the Rust code through WebAssembly. The server uses the same gameplay code, compiled as a native application. For single-player, the game runs locally and saves your progress in browser storage. We also added keyboard rebinding, gamepad support and touch controls.

Getting a match going

Multiplayer needed its own browser-compatible networking. The client connects to our Rust server using WebTransport over QUIC. The server runs each room and decides what gets hit, who dies and how the score changes. You can play co-op, deathmatch, team deathmatch or capture the flag.

Your movement appears immediately in the browser rather than waiting for a reply from the server. The client then corrects it against the server's updates and smooths the movement of other players between updates. There's a fair amount of code behind something you mostly notice when it goes wrong: pressing a key and having your character respond.

One problem we ran into was capture the flag being greyed out in the room menu. The mode was implemented, but the server also needed the CTF maps. We wanted both the campaign and CTF available on the same server, so we combined the 23 campaign maps from Doom2D/DF-Assets with the six maps in DF_CTF_MAPS.wad from the Standart_DF pack. The CTF maps have separate names in the combined archive, keeping the campaign maps intact.

If nobody else is around, you can start a practice room with bots in co-op, deathmatch or team deathmatch. Those matches stay out of the leaderboard. That's what we're playing in the video and screenshots here.

Browser gameplay on MAP01: players and practice bots exchange fire across green platforms.
MAP01: a practice match with four bots.
Browser gameplay on MAP12: players fight on raised platforms beside an exit door.
MAP12: a frame from the recorded multiplayer session. Open either image for the full view.

What we optimized

We cut out rendering work for things you can't see. Offscreen sprites are discarded before their geometry is built. For what's on screen, compatible draw calls are batched together and sprites share texture atlases. That means fewer drawing calls and texture switches, while keeping the order that puts each sprite in front of or behind the others.

The renderer also keeps its vertex and draw-list storage between frames. It clears the old entries and fills the same storage again, cutting repeated memory allocations during play.

On the network side, the server tracks changes to monsters, items and map panels. It skips unchanged state between periodic refreshes, reducing the traffic sent to each player. Those refreshes let clients catch up if an update was lost.

We also avoid encoding the same public update separately for everyone in a room. The server prepares those packets once and reuses them across the room's connections. That saves repeated server work as more players join; each player's movement corrections are still handled separately.

Thanks to the original authors

Doom2D Forever was created by rs.falcon and DEAD and developed by the Doom2D.org team and community, following Prikol Software's DOOM 2D. We're grateful for the game we grew up with and for having its source available to work from. The maps, artwork, sound and music retain their original credits, including resources from id Software's games.

Our Rust source is public, with build instructions and tests. The engine code is GPL-3.0-only; game assets have separate terms, and we've documented their provenance and the permissions still unresolved in the licensing notes.

We're still working on compatibility and performance, and the rewrite doesn't yet match everything in the original. But it's ready for a game. Try it in your browser, try a few maps and bring a friend into a room. For multiplayer you'll need a browser with WebTransport support and a network that allows UDP.