Peer to Peer networking support in UE4 ( online games with no server )

Hi. Currently, UE4 built-in networking is client-server. It would be cool for UE4 to support peer to peer networking in blueprints. The advantage of Peer to Peer networking is that that a server is not required.

  For a better performance, things could be instanced. For example, let's think of an online Hack n' Slash. You are in a map, and other player is in another map. That player streams to you minimal information, that he is in that map. When you get in the same map with him, you get more information, such as its coordonates. When you get more closer, you get even more information, like his equipment, level etc. In this way, the data streaming is minimal.

P2P system is currently used in various console games.

I have found a webpage in which people discuss various aspects on P2P networking:

http://gamedev.stackexchange.com/questions/3887/how-can-i-make-a-peer-to-peer-multiplayer-game

   Could P2P be implemented in Unreal Engine 4 ?

Well, of course it can be done. But think about the security problems, the cheating.

There are some solutions for these http://cswww.essex.ac.uk/cig/2005/papers/p1037.pdf

Got another idea. To prevent cheating, a hybrid P2P/client-server system could be implemented. So actually, the clients send info to other peers, (and have security measures mentioned in above link) ,and the server acts like a checking system. Soā€¦from time to time, the server checks the clients if they are modified or not. The checking server could also be used for log-ins. In this way, the costs of hosting an online game could be highly reduced. In this way, you retain controll over your game. Soā€¦your network game runs on its own. When you turn on your PC/server, you gain full controll over its state. When you turn it off, the game continues to work, with cheating clients remooved.

Sorry, but looking at it realistically:

  1. Changing from server mode to p2p mode, will cause huge lag.
  2. The real cheater will get around this in more or less one day. Max one week.

His question was can it be done in UE4 - not everyoneā€™s opinion about it. Truth is there will always be hackers and ways to cheat even in a client server model. Also maybe the OP doesnā€™t even care people cheat and wants a peer to peer for friends to play together.

Finally Iā€™m no expert on peer to peer but if I was concerned about cheating I would have the clients verify each other by running tests. If both get the same result allow a match otherwise match them with someone else. A cheater could cheat by some memory hacking but most of the time if your trying to prevent cheating making it difficult for the average person is good enough.

2 Likes

P2P is good for a closed environment. ( like playing with your friends ) . It also works for an open environment, but, like Awdogsgo said, having each client to check the others to prevent cheating.

 For an indie project, P2P seems ok for networking without a server. It has its issues, but they can be prevented.

  Found a tutorial about creating a p2p game: http://gamedevelopment.tutsplus.com/tutorials/building-a-peer-to-peer-multiplayer-networked-game--gamedev-10074

  I think p2p networking could be implemented in UE4 by introducing some custom blueprints nodes. 
  
  It would be cool to have that, even as an experimental plug-in.

Actually, if one player checks the other,we.come to a bad situation where one player knows the variables of the other. Now think of an RTSā€¦

Then a hybrid solution seems the best. I have found a detalied study on how to implement a hybrid p2p/server network solution. The main advantage is that it would reduce the costs a lot for indie developpers.
http://www.google.ro/url?sa=t&source=web&cd=1&ved=0CBkQFjAA&url=http%3A%2F%2Fwww.diva-portal.org%2Fsmash%2Fget%2Fdiva2%3A347749%2FFULLTEXT01.pdf&ei=tf3RU9TKOMjNygP7qoCgBQ&usg=AFQjCNEvVTE41JbnqiB11OWV0Eu4xzySIw&sig2=1OXiJQm_bW48RPMST6D0EQ

The security is maintained.

How do we implement the most basic of client to client communication. Can I get some code? I want to simply be able to send a message from one client to another without the sever. Think that would be a good start.

Hey Quizalot! In regards to your PM, I believe the only way to set this up would be with the TCP Socket stuff that Unreal Provides. Iā€™ve personally never used it but Rama has a nice tutorial on transferring data with it here: A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums,Receive_Binary_Data_From_an_IP/Port_Into_UE4,%28Full_Code_Sample%29

Unreal isnā€™t really designed to work this way though, in a typical UE4 game the Clients have absolutely no connection to each other whatsoever, they are all connected through the server who oversees and transmits everything. There is no way to directly communicate between two clients, and Iā€™m not sure if the Unreal Online Subsystem supports that either. One way or the other, expect to have to dive into Engine code at one point or anotherā€¦

Cheating / Opinions and all that aside, the Engine was never designed to work this way from the offset, so itā€™ll probably be an uphill struggle for the most part.

Perhaps a compromise would be to host a lobby system with a web server and the clients host their own lobbies/servers for others to join. The web server would distribute whatā€™s available to others looking to join. Peer to Peer is really horrible to work with or play using.

We need better support donā€™t we? Letā€™s vote for this- Trello
Authoritative client

I also think P2P is an interesting model

I know P2P has its problems but it opens up opportunities that the Server-Client model is very limited at.
the most obvious example is that of games with multiple players being removed out from the game as they lose. most of the time the losing player will want to leave and join a new match, but if that player is the server he has to wait for others (annoying for him) or the game needs to be migrated to a new host (annoying for everyone).
but thereā€™s more to that I think, like ā€˜always onā€™ multiplayer

While it might not seem intuitive, I do feel that P2P networking is a very good thing to look in to. For anti-cheat, integrity checks between clients would work, however I feel that P2P is more useful for alternative use cases outside of traditional gaming instead, such as VR.

Everyone who wants an ā€œauthoritative client optionā€ is voting right? I found this and thought it might be interesting to those developing their own solutions in the meantime. NAT Punch-through

A P2P is generally a bad idea. The commonly selected option is to allow users to host their own servers in the client itself, and the host acts as an authoritative server for all other players.

I do like the idea of having all peers validating actions, sort of similar to the Bitcoin protocol, but itā€™s overkill. Just assume that the host isnā€™t going to cheat and use the aforementioned model.

P2P is good idea, if you donā€™t like it, just donā€™t use itā€¦ But for some projects it might help a lot.

Still waiting till i can implement my own multiplayer like this

Thereā€™s nothing stopping you from implementing multiplayer.

ā€¦but also, did you bump a three year old thread just to post that video?