Multiplayer Coop Connecting To Other Players

Hello,

To provide some background context, I am working on a tactical shooter project where the player completes a few objectives and eliminates all of the enemies in the level. I want to add coop functionality to this so that the player could play with a few friends.

After doing some research, I found quite a few resources on how multiplayer replication works and how to replicate stuff in game. However, I have not had as much luck finding resources on how to connect players to the same game so that they can actually play together. The few tutorials that I found all required some work on the player’s end where they had to find their IP address, and then input it on the other machine so that machine could join the game.

I would much prefer a system that does not require any kind of work on the player’s end and instead just allows them to join their friend’s game through some kind of server browser. I am okay with one of the players being the host as it is coop, not player versus player, and it avoids the extra costs of running a dedicated server.

I was wondering if anyone knew of any online references I could look at or advice on how I could setup this kind of system. Thank you so much in advance, I have found this really stressful and intimidating.

Out of the box, Unreal is capable of connecting players together via a peer-to-peer or with an Engine source build, dedicated server. But as you said, this can still be cumbersome, because in many cases, the host would need to know their IP, open their firewall, and then get their friends to enter it correctly.

Services like Steam allow you to use their matchmaking services to find other players playing the same game, using their subsystem for connecting the relevant parts in your project to their systems.

So essentially, when connect to Steam, any player who’s hosting by sitting a map that was loaded with the ?listen option which basically says it’s open for business and will allow connections, it could show up when querying for available hosts. (Whether using Steam or not, the ?listen option allows connections to your IP - so long as the firewall port is open - but on Steams network others with the same app id can find the session) Though initially, you will likely be using the generic development app id to identify your project, like anyone else using the development app id, which may make finding other actual sessions for your specific game difficult.

There are other services/online subsystems you could look into (like EOS/Epic Online Services), but I figure this would be a good start. There are plugins available to make connecting to Steam easier, such as Advanced Sessions.

More information and a link to the Advanced Sessions Github can be found here:

Adding a plugin to your project and working with Github and all that is yet another adventure, but not complicated. I’d recommend finding a tutorial on setting up Advanced Sessions or Advanced Steam Sessions specifically and it should guide you the rest of the way, as far as setting up the Steam subsystem in your project (mostly just configuration information), placing the plugin in your project, and setting up the blueprints for making the connection/finding a list of hosts. Making the UI for the list of hosts and setting up the connection may require an additional tutorial.

Edit: I see they’ve got a menu example project in that post now, so that may get most things sorted.

Take it step by step! It’s definitely a handful at the beginning trying to get the hang of so many different unfamiliar parts. You’ll get there. :grin:

1 Like

Thank you this has been very helpful! The advanced sessions plugin has made the multiplayer a lot simpler for me to understand. I look forward to trying it in my own project.