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:
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.
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.
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.
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.
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.