How a 3D multiplayer stealth game runs in a browser tab: shared sim, Durable Objects, a 5-byte input protocol
Night Nabbers is a free 3D stealth game that runs in a browser tab: you play a raccoon on a night street, sneak past guard dogs and searchlights, steal eggs and hatch odd little buddies. You can play solo against bots or with up to 16 players in the same street. There is no download and no sign-up. This post is a tour of how it is built and a few decisions that paid off. You can try it at…
Night Nabbers is a free, 3D stealth game that runs in a browser tab, allowing players to sneak around as a raccoon and interact with the night street environment. The game is built using TypeScript, Vite, three.js for rendering, and Preact for the UI layer. It can support up to 16 players in the same street, with no download or sign-up required.
The game utilizes shared simulation and Durable Objects to manage online rooms, with a single simulation running at a fixed 30 Hz step both in the browser and server. When a client and server are in sync, exact prediction is achieved, making client-server correction minimal. Durable Objects are used to hold multiple streets, ticking them at 10 Hz, and effectively packing many streets into one object to minimize costs.
Traffic in the game is handled via a binary protocol, with client inputs being 5 bytes and predictions using the same bytes sent. Positions are quantized within a 32m area, with wider exit radii to avoid flickering. The protocol includes a version number to ensure compatibility between clients and servers.
Room snapshots are stored for state persistence, allowing clients to reconnect quickly after a crash or redeployment. Input decoding, rate limiting, and per-address socket caps are implemented for robustness. Fuzz testing ensures resilience against random frames and simulated situations.
The game's architecture has been carefully considered, with the simulation being platform-agnostic, bytes optimized early, and failures tested thoroughly. The team behind Night Nabbers used AI tools to assist with model generation, editing, and code/text writing, while maintaining human oversight and touch. The game is free to play in a browser, on desktop or mobile devices, with no account required.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.