Zapt

2026 - present · Sole developer · visit site ↗

TypeScript · Canvas 2D · Vite · Node.js · WebSocket · PostgreSQL · Capacitor · Docker · GitHub Actions


Zapt: capturing territory, the open world map, a boss level and the leaderboard

Zapt is a territory-capture game in the tradition of the classic arcade ones. You leave your zone, draw a trail and come back, and everything you enclosed becomes yours. If someone touches your trail while you are out, you are gone. It has three modes: three-minute matches for eight players, a persistent open world where your land stays on the map after you quit and others can take it, and a single-player challenge mode with endless generated levels and bosses.

The game rules live in one TypeScript package that runs unchanged in the browser and on the server. That is what makes the rest possible: the tutorial plays real scenes on the real engine, offline play against bots is the same code, and the challenge leaderboard cannot be faked by posting a number - the server takes the player's recorded inputs and replays the level to arrive at the score itself.

Most of the engineering went into making a grid game feel smooth on a phone network. The server ticks thirty times a second and sends binary updates, about 7 KB per second per client. Every entity is extrapolated from its last authoritative state, and when a new frame disagrees with the prediction the difference is blended away over roughly 70 ms instead of snapping. Your own player is drawn ahead by the round-trip time, a turn is sent together with the cell you saw it happen in, and if it arrives late the server rewinds a step or two and replays it. Measured at 160 ms ping, every turn landed on the intended cell.

Scaling follows the agar.io model. A lobby hands each player the address of a game server that still has room, game servers report their load back every two seconds, and the lobby publishes how many instances it wants so an autoscaler can act on it. On one machine with a lobby and two game servers, a 200-player load test held 30 frames a second with a p99 tick of 21 ms against a 33 ms budget.

The client is Vite and Canvas 2D, wrapped with Capacitor for Google Play, in six languages including right-to-left Arabic. All backdrops are drawn in code rather than shipped as files. A push to main runs type checks and tests, builds a Docker image and deploys it over an SSH key that can run exactly one script on the server, with a rollback if the health check fails.

Highlights

← All projects