Enter the Boss Room in 2022: Netcode for GameObjects, Relay, and Lobby
Boss Room is a multiplayer game, and as such, having a way to discover and join games is essential.
Today, we have two options for players to find each-other and to connect to the game.
The direct IP connection allows the users to connect to each other through their publicly exposed IP address. However, connecting to someone else’s computer is often not as straightforward as one would think due to computers being hidden behind NATs (network address translation devices) and routers.
Port forwarding can make it possible to create a connection, but it would still require the host to do extra work in order for other players to be able to connect. This solution also does nothing to facilitate game session discovery – players have to share the join information through out-of-game means. The upside is that this connection mode does not require internet connection and works in LAN environments.
However, Boss Room is a multiplayer experience that is meant to be also playable over the internet, with sessions that are easily discoverable and that don’t force the host players to perform port forwarding.
This is where Unity Gaming Services come into play – a combination of Authentication, Lobby, and Relay is what allows us to make it easy for players to host and join games that are playable over the internet, without the need for port forwarding or out-of-game coordination.
After integrating Authentication, Lobby, and Relay services into Boss Room, it became simpler to host and join games, cutting down on the need to do port forwarding and sharing the information needed to join a game externally.
Overall, it’s now a much smoother and quicker experience, which is nice in a sample and essential in a production game.
Now let’s take a look at some of the learnings that we had!