PDA

View Full Version : P2P and Client-Server



Saishy
11-13-2009, 06:52 AM
I never played Unreal before, but it seems UDK only support client-server connection?

I would like to do a P2P based game, but needing a player as the "server" is a little troublesome for it.

Does anyone know if there is P2P support? And if there isn't, if it could be done.
Also, how much of the networking It would have to be redone? (Like the lag compensate)

immortius
11-13-2009, 07:35 AM
As far as I know UDK only supports server<->client and I don't think it can be changed. You would probably need engine source code to do that.

Solid Snake
11-13-2009, 09:04 AM
Peer to peer would not really be ideal for Unreal Engine, and even then it isn't a scalable network design.

Blade[UG]
11-13-2009, 02:49 PM
Is this some kind of a troll? How does P2P even remotely relate to any kind of networked game design?

Saishy
11-13-2009, 03:05 PM
;26976254']Is this some kind of a troll? How does P2P even remotely relate to any kind of networked game design?
GunZ, Warcraft3, Age Of Empires, S4 League, Excel, Rakion, League of Legends, Resident Evil 5, Street Fighter IV...

And tons of others games that I can't remember now.

immortius
11-13-2009, 03:08 PM
;26976254']Is this some kind of a troll? How does P2P even remotely relate to any kind of networked game design?

You're confusing Pay 2 Play with Peer 2 Peer.

Curse this world of acronyms.

elmuerte
11-13-2009, 03:44 PM
there are two often used networking mechanisms:
- client-server
1 client has a special role, the role of the server, the server is the absolute truth. often the server doesn't play an active role, but in certain cases it does (i.e. a listen server in UE terms).

- peer to peer
every client has the same role, and is usually connected with multiple other clients (up to all clients), a client uses the information it receives from other clients to figure out what the truth is (because other clients might not have all info, or are lying).

With client-server you need a host with more bandwidth than the connecting clients need. With peer to peer all clients need to have the same amount of bandwidth in order to keep up. The client server model scales well up to a given point, it's mostly the server which gets the hit. Peer to peer doesn't scale well, because enough clients have to agree on how the world is changing for it actually to happen. Peer to peer has some advantages, but there are major down sides like it doesn't scale, and you can't have a forever running game. Peer to peer gaming also has port forwarding issues because all clients need to be reachable. With client server, only the server needs to be externally reachable. Peer to peer networks are not used that often in game, mostly real time strategy games use peer to peer, or games with a very small number of players (i.e. 2 or 3). The disadvantage of client-server is that either you need an dedicated server, which is impartial. Or one client has a major advantage over all other players.


Anyway... UE is build around the client-server model. Since the networking is very low level in the engine you can't change it in the UDK to a P2P system.

Blade[UG]
11-13-2009, 04:42 PM
Yeah, I was utterly confused there, because I thought that Peer-to-Peer networking as used in games had been effectively thrown out the window back around the time of QTest01. It just didn't make sense to me how or why anyone would want to go back to that, unless they are making an explicitly two-player configuration, in which case, you might as well just as well have one as a server.

Saishy
11-13-2009, 04:45 PM
Not everything is true there.

Since internet speed now is way better than last years, p2p now is great for fast-paced games, normally the acceptable limit is around 12 players in the same room without issues and there isn't problems with someone entering-leaving the game, also its much more low-cust to the developer since he don't need to keep a server for everyone that wants to play. (If he wants a controllable world, like having a saved char)

elmuerte
11-13-2009, 05:22 PM
It's not just the bandwith, it's the vast amount of data processing you need to do. Because you need to combine data from different views to the most true view of the world. In a client server model you know that what ever the server says is true. It's just copying data. In a client server model the server will only send a relevant part of the world to you. In peer to peer you really need to reconstruct the whole world. Because the sending clients don't know what is relevant for you.

WHICKED
11-13-2009, 05:23 PM
Hello Saishy,

What you say about p2p is a correct assumption. It is a lot faster than it used to be. And the scalability of it is enormous. However you also need to take in to account for the overhead.

In p2p you are skipping the Application and Transport layers in a computer. But you are also relying on someone elses system to provide information to other users. Depending on connection speed you could have a flurry of information being sent to one system that does not have a great or the necessary connection, meaning increased lag in the game. Now with many users on the p2p network this could be resolved, however, you also need to think about ISP's.

They block or at least limit p2p connections. So if you do somehow implement a system such as this they will probably either filter out the packets, block them completely, or even a lawsuit will be filed against you.

It is a great idea and I know that you are thinking about how game designers are distributing their content through p2p connections (Blizzard Entertainment, etc). and it is a great idea to think about a way to not have a dedicated server to host a game.

But, the feasibility is a little, lack luster in the eyes of a developer. Not only do you need to take in to account for worst case scenario, but you have to also ENSURE security. Without it, your game, your company, and your ideas, are all... pardon my expression... useless.

So would I like to see a game implemented like this, sure. But to make it would require A LOT of networking experience, and some of the top security advisors on a team.

Solid Snake
11-13-2009, 05:29 PM
Remember the old days when games that used peer 2 peer would get dramatically out of sync? Those were great days.

Even if you skip those layers, who cares? I'm pretty sure your networking bandwidth is your slowest thing. You'll also be dependent on someone else's connection too, because the fastest your game could go is as fast as the slowest person's connection.

elmuerte
11-13-2009, 05:55 PM
You cannot bypass a layer. Specially not the application layer, because that is exactly what you would implement. If you would bypass the transportation layout you would be operating on IP level (i.e. not using TCP, or UDP, or IGMP), most operating systems wouldn't allow you to do that without installing a driver. For example, BitTorrent operates on the application layer, and uses UDP from the transportation layer.

immortius
11-13-2009, 06:31 PM
WHICKED, you seem to be confusing peer 2 peer multiplayer with peer 2 peer file sharing, which is different. There are several major games that use peer 2 peer multiplayer (Dawn of War 2 springs to mind as a recent one). ISPs aren't going to file lawsuits against you for making a peer 2 peer game. :rolleyes:

Blade[UG]
11-13-2009, 08:24 PM
Also lacking an authoritative server is a problem open to cheating.

Now, I could see some sort of a hybrid system that works, where players that are nearby each other are transmitting what they are doing to each other, and to the server, allowing the server to be a little more lax than traditionally done, however, i can't really see any advantage to that.

neai
11-13-2009, 09:51 PM
You can implement your own makeshift P2P networking, but you'll be completely on your own. Depending on what you want to do, this may be very expensive to develop and end up being very inefficient too. You need low level access to implement this properly. So the short answer is don't / no.

Saishy
11-13-2009, 09:54 PM
;26977129']Also lacking an authoritative server is a problem open to cheating.

Now, I could see some sort of a hybrid system that works, where players that are nearby each other are transmitting what they are doing to each other, and to the server, allowing the server to be a little more lax than traditionally done, however, i can't really see any advantage to that.
The advantage its allow more flexibility on games, like air-fighting, wall running and fast-paced action, and theoretically limitless players can play it with almost no increased cost on servers for the developer.

Your connection is not limited by anyone, since a lagged player will just receive and send delayed packets and become something that can't kill or be killed (not too much different from client-server right now)

Well, P2P games are a reality, TONS of games use it now and most things are not a issue anymore. So just lets just ignore those ideas of problems.

I'm not too picky about it, I just would like to make a easy "lets call your friends and play game" instead of someone having to decide the host, who can be it and whatever.

But does someone know if the source code is changeable once you buy the UDK license?

neai
11-13-2009, 10:01 PM
But does someone know if the source code is changeable once you buy the UDK license?

Nope, you'd need the full UE3 license for that.

Blade[UG]
11-13-2009, 10:23 PM
What are you talking about Saishy?

immortius
11-13-2009, 11:47 PM
The advantage its allow more flexibility on games, like air-fighting, wall running and fast-paced action

None of that stuff requires P2P.

Saishy
11-14-2009, 10:23 AM
None of that stuff requires P2P.
Really? *sarcasm*

What I'm trying to say is: its is better for what I'm trying to do, for me it would be perfect to be able to do that.
I need to be able to do that, if I can't I will just give up and go to another engine, it is a requirement of my team, so anything someone know will be a great help. Thanks.

@Blade[UG]
Just the first phrase is related to your post, I forgot to split the post. D:

johanz
11-14-2009, 10:30 AM
Just my two cents, P2P is BAD if you need precise gaming. P2P in fps for example is the worst thing ever.

Saishy
11-14-2009, 10:58 AM
Just my two cents, P2P is BAD if you need precise gaming. P2P in fps for example is the worst thing ever.
I know I know, but its not a fps, neither is precise.

Its just a fun net game we are doing, but as a indie we can't maintain servers for the game, but we can't let the players host them since we need to control the data.

We want something like:

Client connect to server -> Create a room
Client connect to server -> Enter a room created by another one
The game rules and most things will be controlled by the server.
Clients sends actions to another clients and they interact like that.

The server will only control the level, things like item spawn or whatever.
Of course, its much more hackable and have security issues, but we aren't worried about that now, we just want something to start of.

Thanks ^^

neai
11-14-2009, 11:26 AM
@Saishy If it's simple enough then it may work. Implement a quick mockup with P2P networking and see where this is going. This is the only way to find out.

johanz
11-14-2009, 11:45 AM
We want something like:

Client connect to server -> Create a room
Client connect to server -> Enter a room created by another one
The game rules and most things will be controlled by the server.
Clients sends actions to another clients and they interact like that.

A BIG flaw here. If you can't hold a server, then what do people connect to?

neai
11-14-2009, 12:29 PM
A BIG flaw here. If you can't hold a server, then what do people connect to?

Sounds like a master server of sorts.