lockstep-tactics — a match you can verify
source & notesPlay a friend loading…
- Play Blue. Press play Blue, click one of your units (or its card), then a tile to move or an orange unit to attack. Orange is the built-in AI. Pause with space to think; orders land on the next tick.
- Play a friend. One of you creates a room and reads out the code, the other joins. The two browsers then talk directly over WebRTC; the room code only carries the handshake. By default each tick runs when both players' orders are in, three ticks ahead. With rollback ticked by the host, your orders run at once and the ticks since are re-run when the other side's arrive; the top bar counts the re-runs. Both sides compare state hashes as they go.
- Soldier beats Archer, Archer beats Knight, Knight beats Soldier. Archers shoot four tiles and are weak up close; Knights are slow and hard to kill.
- The hash is the proof. The number in the corner is the state hash after this tick. MSVC on Windows, clang on an ARM Mac and this WebAssembly build all print the same one for the same seed and orders; in an online match both browsers must too.
- Save the replay. save downloads the seed, every order and every tick's hash;
lockstep verifychecks it on any machine and names the first tick that differs.
Fixed-point C++20 compiled to WebAssembly with raylib. Nothing here uses float except the drawing. Rooms go through ntfy.sh (a public pub/sub relay) for the handshake only. Why the hash matters.