Development log

Oct 02 2026

Playing Together

TECHPOST #5
A castle falls, in slow motion
A castle falls, in slow motion

A tug-of-war game is at its best with a person on the other end of the rope, so online play came early: Castle Arena plays 1v1 through Steam. One player creates a room (friends only, or public so it shows up in the room list) and invites someone through the Steam overlay or the Invite friend button. An invite accepted while the game is closed opens the room as soon as it launches.

In the room, each player picks a faction and a perk and marks Ready, and the host sets the match length, artillery, fog of war and arena. When the match ends, Rematch sends you both back to the room with the same picks, already ready. Once both of you ask for it, the next match starts by itself in about three seconds.

Only the orders travel

The interesting part is what does not cross the internet. A battle can have 90 troops per side, each with health, a target, a path and cooldowns. Instead of streaming all of that, both computers run the exact same simulation side by side and send each other only the orders the players give: build here, upgrade that, cast the Rescue there.

That only works if the rules are perfectly predictable. Given the same start and the same orders, two machines must arrive at exactly the same battle, down to the last hit point. So every bit of chance in the rules, like a critical strike or a dodge, comes from a shared sequence of dice rolls that starts from the same seed on both sides. An automated check fails if any rule ever takes a random number from anywhere else.

In practice, an order you give runs on both machines about 200 milliseconds later. About once a second the two computers compare a fingerprint of the whole battle, and if they ever differ, the match stops rather than letting two different games quietly drift apart. Traffic goes through Steam's relay network, so players never see each other's IP address.

When someone drops

Connections fail, games crash, computers restart. If your opponent disappears, the match pauses for you with a 2:30 reconnection countdown. You can wait one more minute at a time, claim the victory after the first minute, or leave. Short hiccups only show "Unstable connection…" while the missing turns are requested again.

The player who dropped just opens the game again and picks Rejoin match on the main menu. The computer that stayed sends a full snapshot of the battle in small, confirmed pieces, and both players carry on from there. The match's replay still comes out complete. A dedicated test drops and restores both sides and loses turns on purpose, then compares the results.

Watching, live and later

A room accepts up to four spectators, before or during the match. They get a spectator panel comparing both sides, an automatic camera and the players' emotes. The host picks a broadcast delay of one or two minutes. Zero delay is only allowed in a friends-only room, because in a public room a spectator could pass the match along to a player in real time. A "LIVE −2:00" badge shows the delay, and players see how many people are watching.

Every match is also saved as a replay. Because the battle is deterministic, a replay is tiny: the match setup, its seed and the list of orders. You can watch at 0.5x to 8x and jump around freely. Snapshots taken along the way cut a jump back in a 25-minute match from as long as 25 seconds to under a third of a second.

Highlights turns a match into a 30 to 60 second reel. While you play, a scout scores how intense every second of each lane was and notes the big moments: Rescues, buildings going down, the castle falling. Afterwards it picks varied clips and plays them with title cards and a camera that follows the fight, with the castle falling in slow motion. Save video records the reel with the game's sound and saves it to your Videos folder.

The charts on the result screen are clickable too. Click a point or a marker (✦ Rescue, ▼ building, ♜ castle) and the replay opens at that exact moment. It's the fastest answer to "wait, when did we lose the north lane?"

Team matches build on all of this. More in Many Ways to Play and, with up to eight people online, in Eight People, One Battle.

— The Castle Arena team