monkeylashes
← Homeworld: Unbound

Homeworld: Unbound 0.6: three bugs that only show up over the internet (superseded by 0.7)

I said in this post that internet play worked. That was wrong. The third bug below was still in this build, and I only fixed it in 0.7, forty minutes later. I’ve left the diagnosis as I wrote it, because it’s correct and the reasoning is what this post is for.

0.5 shipped internet multiplayer forty minutes before this build, and it didn’t work. This was supposed to be the build where it did.

Why I couldn’t have caught it on a LAN

All three bugs mixed up the address a machine calls itself with the address someone else can reach it at. On a local network those are the same string, so testing in the same room was never going to show it. In the order a game hits them:

The game advertised the private address. Behind a router, each end named the other by an address that means nothing outside the other person’s house. The connection came up and reported itself healthy, and then every message on it got dropped.

Replies always went to port 10600, wherever the packet came from. On mobile data that’s never the right port. Thousands of subscribers share one address, so the carrier can’t keep your port number, and the reply went somewhere that didn’t exist. The joining player’s list just stayed empty.

The host filed a joining player under the wrong address, the one its own connection reported instead of the one that player calls itself. Everything looked fine up to Start Game. Then the joining player looked for itself in the player list, wasn’t there, and the game died on the spot. This is the one that mattered, and it’s the one I understood but didn’t actually fix here, which is why there’s a 0.7.

There’s a keyboard now

The keyboard came in 0.5. Multiplayer had technically worked since 0.4, in that the code ran, but hosting or joining means typing your name, a game name and an address, and there was nowhere to type in the headset. Now a keyboard shows up anywhere the game asks for text (player names, game names, chat, passwords, save names), and you type by pointing at a key and pulling the trigger.

This build makes it shorter, lets the screen show through between the keys, and puts it right above the field you’re typing into, where before it jumped to the top of the panel. Typing into Join by address works now too. The text was going into the lobby’s chat box, which grabs the keyboard for as long as that screen is up, so the address field lost focus the moment it got it.

What it needs

The host forwards TCP 10500 and UDP 10600. Whoever’s joining forwards nothing. They type the host’s public address, and the host learns theirs from the first packet that arrives. It’s two players over the internet, because more than that needs the players to tell each other who they are, and the protocol doesn’t do that yet. You also can’t both be on the same home network range. Most routers hand out 192.168.1.x by default, and if you’re both on it, each machine looks for the other on its own network. Neither limit applies on a LAN.

I haven’t played a match all the way to the end yet, so a desync late in a long game is possible. Sync checking is on, so a desync would be reported instead of going unnoticed.