Notes · Deep-dives · Build logs
Notes.
A running set of deep-dives on the things I build and break — game mechanics, the modern web platform, real-time systems and provably-fair design. Written from the actual code, not marketing. New notes land here a couple of times a week.
All notes
Why "SharedArrayBuffer is not defined" is a headers problem, not a code problem: cross-origin isolation with COOP/COEP, the newer Document-Isolation-Policy, how COEP differs from CORP, and the Atomics operations (including waitAsync) you need once two threads share one buffer.
Animated page transitions on a plain multi-page site with about ten lines of CSS: the @view-transition at-rule, shared elements via view-transition-name, transition types, the pageswap/pagereveal events, and why every failure mode is one of five things.
How to hide 100ms of latency in a browser multiplayer game: a fixed tick loop, an input buffer, server reconciliation with rollback re-simulation, entity interpolation for remote players, and error smoothing that hides the corrections.
The Elo formula in plain English, a dependency-free JavaScript implementation, sane K-factor tiers, and how to turn ratings into an expanding-window matchmaking queue that doesn't leave players waiting.
How to move physics simulation into a Web Worker so your browser game stays at 60 FPS — postMessage vs Transferable vs SharedArrayBuffer, practical code with Rapier, and the interpolation trick that hides physics lag.
How to build a mobile-money payment flow that never double-charges — idempotency keys, webhook deduplication, and the state-machine pattern from real M-Pesa and EcoCash integration code.
A practical guide to the Temporal API — PlainDate, ZonedDateTime, Duration and Instant explained with real code. Why Date is finally obsolete in Node.js 26 and ECMAScript 2026, and how to migrate.
WebSocket, Server-Sent Events and WebTransport compared side by side — latency, browser support, direction, and a practical decision framework for choosing the right real-time protocol now that WebTransport is Baseline.
How online slots actually decide each spin — virtual reel strips, weighted symbol mapping, PRNG algorithms, RTP calculation, and why there is no such thing as a hot or cold machine.
How provably-fair dice and mines games turn an HMAC-SHA256 hash into a roll or mine placement — the exact byte extraction, float conversion and Fisher-Yates shuffle, with Python code to verify any round yourself.
How to transfer files between phones, PCs and tablets over Wi-Fi with no internet — a practical breakdown of WebRTC DataChannels, mDNS discovery, and the signaling trick that makes it all work offline.
Why JavaScript's garbage collector stutters your browser game at 60 FPS, and how to fix it with object pooling — a practical walkthrough with code, pool sizing, and Three.js InstancedMesh patterns.
How to implement hitscan raycasting and physics-based projectile shooting in a Three.js browser FPS — code, trade-offs, and when to use each approach.
A practical walkthrough of porting a Three.js browser game from WebGLRenderer to WebGPURenderer — the real migration steps, TSL shader conversion, compute shaders for particles, and the performance wins that actually matter.
How to use Supabase Realtime's Broadcast, Presence, and Postgres Changes to build multiplayer browser games — architecture patterns, code examples, and the trade-offs nobody mentions.
Two completely different models promise fair games — provably-fair cryptography and traditional RNG lab certification. How each works, what each guarantees, and the gaps in both.
How an HMAC-SHA256 hash becomes left-or-right bounces at every peg — the most visual way to understand provably-fair game mechanics, with a Python snippet to verify any drop yourself.
The honest engineering answer to "can I predict Aviator?" — how the crash multiplier is generated from a server seed, client seed and nonce, and why it's verifiable but never predictable.