How can I implement online multiplayer without a dedicated server using listening server model?

I’m writing up a game design doc for a project I want to make that includes multiplayer and I would like to support 1v1 fights between players across networks. I’ve done some reading about UE5’s networking and see that it is all server based with a dedicated server and a listening server. My issue is I don’t have the resources for a dedicated server so I want something that’s more a connection between just the two players without another server, so the listening server.

My question is could this be done and how? I haven’t made a multiplayer game in UE5 before but could something like this be done and how would it look?

Like I image I wouldn’t be able to have people search for other players to fight as that would probably require some server to list available players. Would players have to share their IPs to connect? Could an invite code system be implemented without a server in the middle? What can I do with this limitation?

I’ve heard steam has some sort of system that can be implemented but I want to not rely on that right now so the game can be played off of steam.

You don’t have to run dedicated server - on player can be the server (aka the Host) and the other would connect to him - I would suggest watching this to get better grasp on how unreal handles networking: https://www.youtube.com/watch?v=JOJP0CvpB8w&t=148s&pp=ygURdW5yZWFsIG5ldHdvcmtpbmc%3D

As for searching for other players - yes, you can connect via IP (alltough for a game i wouldn’t recommend it as a main option) - and as for how to handle that, it really depends on your game - if you wish to share more information, I would gladly help you ut but in short - player can find eachother via code, or steam for that matter, but to anwser that more specific design is needed

2 Likes

Nice video. So in my case one player would definitely be the server.

I’m unsure what details you need exactly but for the multiplayer side of the game it would just be a 1v1 third person sword fight. I don’t know how players would connect to each other but using some kind of code to search for someone would be ideal. I image I’d have some kind of multiplayer menu for this where a player can choose to host and is given a code while another player can choose to connect with an invite code from a host. The code would be shared through discord or something then the two players can connect and begin matches against each other.

Nothing is set in stone though as I’m in a research phase right now. My main area of interest is roughly how could I get two players connected to each other without them having to directly share IP addresses.

I guess I’m just trying to find out how a client actually connects to a server.

A connections list (Servers) is handled by the EOS or STEAM online subsystem. It’s all built in.

A joining player would be connecting directly to the host. So his/her IP would be exposed. Windows Resource Monitor (network tab) shows the IP outright. There’s no way to hide it. Host can use the same tool to see the other players IP.

2 Likes

I’m aware the IP could be found as that is a requirement of network connections for anything, I just wanted to avoid players directly sharing IPs, which is why I wanted the invite code method to obscure it.

So does this mean the players would have to have a steam or epic account? Does this also require that the game be played from steam or epic games launcher, limiting the places I can distribute the game?

Direct IP won’t allow them to join if you’re using Steam or EOS. The online subsystem has to make the connection.

And yes EOS or Steam is needed unless you want to build your own system from the ground up.

1 Like

Got it, so unless I make my own system I’ll have to rely on the steam or eos services. Thank you.

Both EOS and Steam can use relay servers to connect players using p2p, it is sometimes the only way players can establish a connection.
It also prevents DDOS attacks so I don’t recommend you attempt to make your own direct IP system, that is a thing of the past.