Fiber is meant to be played with up to four friends, so multiplayer can’t be an afterthought. On Monday night, for the first time, two copies of the game shared a map: one hosted a session, the other found it in a list and joined.
Three layers
The design we wrote up in March splits multiplayer into three layers:
- A Nakama backend for everything that has to persist: player profiles, guilds, inventories, and later trading and dungeon keys.
- A real-time transport for gameplay inside a session. The plan is Steam’s networking for NAT traversal and relays.
- The Godot client, where the host runs the authoritative game: physics, combat and enemy AI. Other players send their inputs to the host and get state back.
Host-authoritative keeps the rules in one place. Only one machine decides whether a hit landed or what an enemy does next, and everyone else draws what the host says happened.
The first pass
Stephen Cassidy built most of the first layer of networking: a network manager that signs in to Nakama, a session manager for the peer lifecycle, a player manager that spawns one player per connection, input sent over RPCs, a bridge that replicates combat events, and mob sync with the host running the AI. He also got Nakama running locally in Docker with seed data, so neither of us needs a server to work on it.
Testing without Steam
The plan routes sign-in and lobbies through Steam, which made it hard to test two copies on one machine or between two dev machines. So I refactored it to work without Steam:
- If Steam isn’t running, sign in with a Nakama device account instead.
- Find sessions through Nakama instead of Steam lobbies. The first version listed matches directly; it ended up discovering sessions through a Nakama channel instead.
- A small multiplayer dashboard to host or join without the league flow the full game will have.
- Connect players directly over ENet, and use Tailscale to reach each other’s machines during development.
What broke first
Getting two players on screen was mostly a list of small, specific bugs:
- Duplicate players. The main scene spawned a player and so did the player manager. Now the player manager owns spawning, and your offline player is handed over when you host or join, with the right peer ID.
- Falling through floors. Players spawned over the network had the wrong collision mask and dropped straight through one-way platforms.
- Mobs in two places. Enemies spawned separately on each machine. Now the host spawns them and syncs their positions, and clients smooth toward the host’s position instead of snapping.
- Flickering animations on the client, fixed by syncing animation state properly and resetting it when a pooled enemy is reused.
Most of these fixes came with tests, and the multiplayer code now logs heavily, which made each new bug much faster to track down. Next is making every single-player feature behave when there’s more than one of you.