10 · Development note · Network layer
From a LAN code to a room code: the road before the relay
A code that worked on the same Wi-Fi did not work between two cities, so the network layer was rethought.
The FrostZero network layer was not written from scratch. When the project started this stretch of work there was already a server authoritative setup with its own transport layer. The host machine ran the rules and the clients only drew what they were shown. The job was to harden that, not to tear it down.
The first real obstacle showed up in the room code. The code carried the local network address of the host. Inside one home, on one router, everything worked; tried between two cities, the connection timed out. The screen even said so plainly: this is a local network code, connecting from another city needs another route.
The first idea was port forwarding, and it was dropped quickly. The shared address setup that carriers in Türkiye commonly use makes opening a port unreliable, and a fixed address is a paid extra. Asking a player to change router settings was not acceptable either.
The second route was to build a network on top of the network: once the host and guests joined the same virtual network, the room code carried that network's address by itself. That worked, but it required everyone to install a program. The third route was a tunnel service; a new type was added to the room code so it could carry tunnel information instead of a local address.
Meanwhile the network layer itself was tightened. A request sequence number arrived so the same decision cannot be processed twice, the server now sets the deal seed and the table size, clients on a different version are refused a seat, and the seat of a dropped player is held for a while. One whole wave chased a frozen rematch and the root cause again turned out to be in the network: the server was dropping a ready packet that arrived while character selection was still running.
The road described here is the one that leads up to today's Cardlab relay. One thing is missing on purpose: reconnecting after a drop and host migration are not in this stage. A bot takes over the seat of a player who drops, and if the host leaves the table closes. That is an accepted limit for the closed Alpha and it sits on the roadmap.