All case studies

DEV3 Technologies · own product

Bomber Blast: an HTML5 arena game with one rules engine for bots, players and the multiplayer server

Our own free game: a browser bomb-arena game in Phaser 3 and TypeScript with a 10-level campaign, A* AI bots and 4-player online rooms on a server-authoritative Socket.io backend, built so single-player, multiplayer and client prediction all run the same deterministic code.

Industry
Games & interactive

Live project preview

DEV3 Technologies · own product — screenshots
Open live demo
A 4-player match: flames, power-ups and the live HUD with each bomber’s loadout

A 4-player match: flames, power-ups and the live HUD with each bomber’s loadout

The challenge

Real-time multiplayer games usually end up with the rules written twice: once in the browser for responsiveness and once on the server for fairness. The two drift apart, and every bug becomes a desync. Bomb-arena games make this worse because a single flame can set off a chain of bombs, destroy blocks and kill several players in the same instant, and AI opponents need to reason about all of that in advance to avoid walking into their own blasts. The game also had to run smoothly on phones and 4K screens, accept keyboard, touch and gamepad input, and download quickly.

Our solution

We built Bomber Blast as a TypeScript monorepo whose core is a single deterministic rules engine with no DOM dependencies, used by the browser, the server and the bots alike.

Key design decisions

  • One engine, three uses. step(state, inputs) advances the game by one fixed 60 Hz tick. Single-player runs it in the browser, the Socket.io server runs it as the authority, and the client re-runs its movement code to predict the local player. Rules cannot diverge between modes.
  • Chain reactions in one tick. A detonation queue raycasts each blast and pushes every bomb it reaches, so a whole chain resolves before anyone moves again. Destroyed bricks burn for the flame's lifetime and only then roll the seeded power-up drop table, which keeps replays deterministic.
  • Bots that plan around time. A danger map stores, per tile, the seconds until it explodes, with chain reactions propagated to the earliest fuse and upcoming Sudden Death tiles included. Escape routes are a breadth-first search that only enters tiles the bot can cross before they burn, and a bot drops a bomb only if such a route exists.
  • Intents, not positions. Clients send direction and button presses with a sequence number. The server applies them, rate-limits and collapses backlogs, and broadcasts compact binary snapshots at 20 Hz. The client replays unacknowledged inputs on top of each snapshot and interpolates remote players 100 ms in the past.
  • No asset pipeline. Sprites are painted with Canvas 2D at the current tile resolution and packed into one atlas; sounds and music are synthesised into PCM. The game stays sharp at any resolution and the client is about 400 KB gzipped.
  • Input as an abstraction. Keyboard, Gamepad API and an on-screen joystick all produce the same per-tick intent, and the most recently used device takes over automatically.

Architecture

packages/shared holds the rules engine, the AI and the protocol (zod schemas for lobby JSON and a DataView codec for snapshots). apps/server is Express plus Socket.io with a room registry: codes, public listing, ready-up, host hand-over and garbage collection of stale rooms, each room running its own authoritative loop. apps/client is Vite and Phaser 3 (WebGL with Canvas fallback) behind a responsive HTML/CSS shell for menus, lobby, HUD and results; drivers feed the renderer from a local simulation or from the network.

Results

Bomber Blast ships as a complete game and a free download. By the numbers, counted from the source:

  • 10 campaign levels, 3 bot difficulties and 5 power-ups
  • 4 players per online room, 60 Hz simulation and 20 Hz binary snapshots under 1 KB
  • 3 input methods: keyboard, touch and gamepad
  • 47 Vitest tests and 8 Playwright browser tests, including a two-browser multiplayer match
  • About 400 KB gzipped for the whole client, with zero image or audio files

Play the browser demo or get the free source code on the DEV3 marketplace.

Related case studies