Eight People, One Battle

In yesterday's receipt, the list of unfinished work had one line saying "online with more people". Online team matches were you and a friend, each with AI allies. Now every seat can hold a person: from 2v2 to 4v4, up to eight players in a room, plus four spectators. Empty seats still go to the AI, so you can play a 3v3 with four friends and two AIs.
The room
In the room, each team is a column of seats. Whoever joins sits in a free seat on the side with fewer people and can move with Sit here until they mark Ready. Empty seats say "AI slot". Within a team nobody repeats a faction (unless the game mode allows it), and Ready now warns you right away when your faction clashes with a teammate's, instead of letting the host find out when trying to start. The public room list shows the format and how many players are already in.
In draft modes, picks follow a 1-2-2-1 order across all players: the first player of one side, two of the other, two of the first, and so on. AI seats pick on their own when their turn comes.
A star, not a web
With two people, the two computers trade orders directly. With eight, connecting everyone to everyone would take 28 connections, each able to fail in its own way. So online team play is a star: every guest talks only to the host, and the host relays each player's orders to the others. What travels is still just orders, a few bytes per turn, and every computer runs the whole battle, just like in 1v1. The battle "fingerprint" checks go through the host too.
When someone drops
In 1v1, if the other player drops, the match pauses and waits. In a 4v4 that would be unfair to the other six, so here it works differently: the AI takes over the dropped player's seat right away, from the same turn on every computer. The switch is recorded as an ordinary order, so the replay and the spectators show exactly the same thing.
The dropped player opens the game and picks Rejoin match. The host sends a full snapshot of the battle, and the AI keeps playing for them while their computer builds the scene and catches up. Once they're in sync, they ask for their seat back and take over on an agreed turn, far enough ahead that everyone knows before reaching it. Nobody stops to wait.
And if the host is the one who drops? Then there's nobody to relay, so everyone else pauses with the reconnection countdown. When the host comes back, they ask every guest what they saw since the drop and take the snapshot from the furthest along, merging in the orders only the others had received. If the host doesn't return in time, their team loses by forfeit.
Surrender is now a vote: the team gives up once more than half of its people vote. If you're the only person on your team, you surrender right away, as before.
What eight open windows taught us
Tests without graphics simulate 2v2 to 4v4 with guests and the host dropping and returning, and check that everyone ends up in the same battle. But we also ran the real game: four windows for a 2v2 and eight for a 4v4, all on the same machine, with the AI playing for each person. Mid-match we closed one window and reopened it. Every window finished with the identical battle. Along the way, four problems showed up that the tests without graphics didn't catch:
- The room that never started. Everyone joined with the default faction, and a team can't repeat factions. That's where the warning on Ready came from.
- The guest who gave up joining. With eight windows loading at once, the host was slow to answer, and the join request went out only once. Now it keeps trying for up to 20 seconds.
- Everyone waiting on one. In the first version, the seat went back to the returning player the moment the snapshot was sent, and the other seven waited about 30 seconds for their scene to load. That's how the AI ended up holding the seat until the player catches up.
- The slowest PC at the start. Anyone who took more than 8 seconds to set up the match lost their seat to the AI before the first turn. Now a player still loading gets 45 seconds.
There was also a subtle one, found by reading the code: a guest can run a few turns ahead of the host, and if their seat came back on a turn they had already passed as AI, the match broke. That case now has a test of its own.
What's still missing
If the host drops and never returns, nobody takes over the room: their team loses. And orders always go through the host, even between two allies. Both are on the list.
— The Castle Arena team
