How to implant peer to peer in game without dedicated servers?

I don’t care if p2p is prone to cheating.
I just want two devices should able to play on same ground over internet without dedicated servers…
Is there any tutorial i can watch?

Please suggest…

1 Like

Unreal Engine either uses a dedicated server or a listen server (one client is also the server), there is no peer to peer by default. With a listen server the host has all the advantages (including the ability to cheat) but like you said it doesn’t matter in some games.

Players still need a dedicated server so they can find someone to play with. If you use the Steam Online Subsystem then the host needs to call CreateSession while the joining player needs to first FindSession and then JoinSession.

You should be able to find both Youtube tutorials and documention of how to enable the Steam Subsystem.

1 Like

I think you won’t be able to do this without an extra component that does the match making, eg. some “master server” for matchmaking.

You can’t scan the whole internet for people who are online in your game. Without a centralized server clients can’t find each other and can’t host/join. Basically clients tell the master server they are looking to play, the master server (knowing who else is looking to play) finds matches and tells one client to host and the other clients who they should join.

I don’t have enough experience with the steam subsystem, so I don’t know if it’s capable of doing that. You’d best be advised to use a host / join system anyways imho, as most peer to peer systems I know in games have very bad matchmacking results (bad hosts result in lags, connection problems, etc.)