BAKUL

2026 · SHIPPED · BUILD

hdgame.me

One deterministic simulation, running on both ends of the wire

  • Next.js
  • TypeScript
  • Three.js
  • Node 22
  • Colyseus
  • uWebSockets
  • Rapier3D WASM
  • Docker
  • Nginx

hdgame.me is a monorepo for a multi-title .io platform: three 3D games, one modular core, one box. The site is a Next.js App Router PWA rendering with Three.js; the game server is Node 22 running Colyseus on uWebSockets; and between them sits a shared package containing the deterministic 3D simulation that both ends execute.

The deployment is deliberately small — one VPS, one Nginx terminating TLS for three hostnames, one docker-compose file. The interesting engineering is in refusing to let the client and server physics be two separate implementations.

Problem

Real-time multiplayer breaks in a specific way: the client predicts, the server corrects, and if the two are running even slightly different physics, the correction is visible as a snap. Multiply that by three separate game titles and the divergence problem multiplies too.

Question

Can three different 3D games share one simulation core such that the client and the server are provably running the same physics — and can the whole thing be deployed from one box with one command?

Approach

Make the simulation a shared package that both halves import. Rapier3D compiled to WASM runs identically in the browser and in Node, so client prediction and server authority are the same code path rather than two implementations that agree by accident. Nginx terminates TLS for all three hostnames and Docker Compose brings up the whole platform.

System

Open any stage to see what it does.

Demo

Three 3D titles on one platform at hdgame.me, with the Colyseus game server at api.hdgame.me. Installable as a PWA.

Result

  • Three 3D game titles run on one modular core and one deployment.
  • Client prediction and server authority execute the same Rapier3D WASM simulation from a shared package.
  • The full platform — nginx, web, api, certbot — comes up on a single VPS through one docker-compose file.

Lesson

Determinism is not a physics problem, it is a packaging problem. Every desync I chased turned out to be two copies of the simulation drifting apart, not floating-point exotica. Making the simulation a single shared dependency removed a whole category of bug that I had been treating as inherent to netcode.

Source

Connected

  • GUB PortalBoth are WEB and SYSTEMS and CLOUD work, and both are built with Next.js, TypeScript.
  • TeleFlowBoth are WEB and SYSTEMS and CLOUD work, and both are built with Next.js, TypeScript, Docker.
  • Bnlang for VS CodeBoth are SYSTEMS and CREATIVE CODING work, and both are built with TypeScript.
  • BazarioBoth are WEB and SYSTEMS work, and both are built with Next.js, TypeScript.