NETWORKING: P2P vs. SERVER based online multiplayer games.

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Aug 30, 2009 at 05:00

hi,

ultimately, i wish to argue how peer-to-peer model is faster, much faster, than currently popular server-client model… and in fact, it has so many advantages over S/C that it is mindbogglingly unexplainable why in the world no online multiplayer game use it. why, why, why? but, if there are any games to use it after all, then please let me know about them. ok, here it goes…

THE TRUTH ABOUT SERVER MODEL
- central server collects all the input from all the clients, calculates movement/collision then sends to each client the new machine state, ie. new positions of each entity, velocities, orientation and such, which then each client renders, perhaps utilizing some extrapolation to fill in the gaps from, say network refresh rate of 20Hz to their screen refresh rate of 60 FPS.

to put it simply, games on the internet today run only about 10-20FPS of real server-computed data and clients input samples, regardless of how many FPS your client renders, but those extra frames are only “smooth-candy”, and even worse, they may itself be the source of another set of visual artifacts since they can easily mismatch with server’s next update.

it can be better, and it’s rather simple actually,
but this is not news, p2p is nothing new as we all know, tho most will be surprised that no game actually use this as a main network model for the game, only for chat, patches and some side-stuff. so, one thing is clear, p2p works… but does it work better than server-client model? can it host the whole game? you be the judge!

1.) first let’s consider round-trip traversal with the best case scenario for S/C model, where server is in the middle. – shortest route should yield fastest path.

B        C

     s    30km
  20km
A        D

AB=BC=CD=DA = 30km
As=Bs=Cs=Ds = 20km

*** P2P, one frame loop, per ONE client
round-trip: \~33km (2x 30km, 1x 40km)
packets sent: 3
packets received: 3
total packets per client: 6

*** SERVER, one frame loop, per ONE client
round-trip: 40km
packets sent: 1
packets received: 4
total packets per client: 5

  1. second, let’s consider bandwidth…

packet overhead= 30 bytes
packet client input= 10 bytes
packet full entity state= 20 bytes


C/S, client upload per frame: 40 bytes
C/S, client download per frame: 50 bytes * N_clients

P2P, peer upload per frame: 50 bytes * N_peers
P2P, peer download per frame: 50 bytes * N_peers

*** 16 players, per one client, per second, 60Hz
C/S: upload= 40*60 = 2400 bytes/s
C/S: download= 50*16*60 = 48000 bytes/s

P2P: upload= 50*16*60 = 48000 bytes/s
P2P: download= 50*16*60 = 48000 bytes/s

*** 32 players, per one client, per second, 60Hz
C/S: upload= 40*60 = 2400 bytes/s
C/S: download= 50*32*60 = 96000 bytes/s

P2P: upload= 50*32*60 = 96000 bytes/s
P2P: download= 50*32*60 = 96000 bytes/s

3.) third, updates are asynchronous, there is no FAST/SLOW here, no waiting - you only have FURTHER and CLOSER, and further is not SLOWER it is only more behind in the past, but the rate of update is NON INTERRUPTED, has CONSTANT streaming flow. theoretically working on FULL 60Hz and more, where frequency only depends on upload bandwidth, size of packets and number of peers. there is no lag, no glitches, no slowdowns, no waiting on server… only time dilation, depending only on DISTANCE.

CONCLUSION:
- P2P can not only allow for far better update frequency, but asynchronous, continuous updates will smooth many visual glitches automatically and the streaming nature of incoming data would even further make the whole experience more fluid.

1.) does p2p have shorter traversal path than server-based model?

2.) would parallel computing even further speed up latency by getting rid of serial computation server does?

3.) can p2p run on much faster frequency (60HZ and more) due to the nature of uninterrupted, streamed, asynchronous updates?

58 Replies

Please log in or register to post a reply.

6837d514b487de395be51432d9cdd078
0
TheNut 179 Aug 30, 2009 at 13:01

Your own example actually demonstrates how a client-server architecture is much better.

1) Your reasoning here is slightly off. Yes, a round trip to and from the server would actually be about 42km. However, you’re looking at this as a 1:1 relationship. What about the other 3 players that also get updated? The distance covered here is now only 21km. And the server sends out updates frequently with or without client input in most cases, so that’s 21km for all players.

2) Bandwidth plays a very important role on client machines. Most ISPs loath when their subscribers use upstream bandwidth, especially on cable networks that are not designed for that behaviour (sad, but true). Residential networks have roughly a 1:20 to 1:10 upstream to downstream ratio. Dedicated game servers generally have a 1:1 ratio. So when a client only has to send a couple bytes out and receive larger packets from a single source, this is a good thing. You also have to consider congestion. Someone connected from a dense area like LA is likely to run into a lot of congestion issues compared to someone connected from Idaho.

There is also the matter of bandwidth caps now happily employed by most, if not all, ISPs today. Have you ever seen how much bandwidth a game like Battlefield takes up? Let me tell you because I analyzed it, among other games. In a 32 player game, a single Battlefield client consumes up to 32KB/s. That’s a damn lot for a single user. 32Kb x 32 players = 1MB/s from the server, which is exactly what I recorded when hosting a 32 player game. I doubt any residential line supports that sort of bandwidth and even if it did, you’d hit your caps quite quickly.

3) Not true. P2P has every more reason to cause delay issues. As I mentioned in 2), ISPs limit residential upstream. Have you ever tried to host a game server on a cable connection? You would get at most 6 players, each with a latency of 100 ms. I know, my friends and I use to host games all the time. A P2P model means everyone is a client and a server, so each connection has the 6-player limit too.

Also, when someone connects from far away, say China, then all other players have to send a signal out that distance. That’s an accumulated distance to China _and_ back causing all the more interruptions and delays whereas in a server model only the server has to deal with such a far away client. The dedicated server is also going to have state of the art networking, so it’s likely the connection won’t suffer as bad.

When it comes to large file transfers, I can see the benefit of P2P. That’s why Blizzard employed that tactic and likely saves millions a month on bandwidth costs for patch updates. Supreme Commander is the only game I know of to implement P2P networking, but since most games are 1vs1 there’s really no difference. There are pros and cons to both sides, but right now a client-server approach is the most sound.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 Aug 30, 2009 at 15:04

peer 2 peer is genius (save you a server bill) , but how do you stop the hackers?

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Aug 30, 2009 at 23:38

@TheNut

Your own example actually demonstrates how a client-server architecture is much better.

“better” for what? when clients have dial up connection? even then, it only limits the maximum number of peers per game. client/server model is simply byproduct of bandwidth constraints of the past.

1) Your reasoning here is slightly off. Yes, a round trip to and from the server would actually be about 42km. However, you’re looking at this as a 1:1 relationship. What about the other 3 players that also get updated? The distance covered here is now only 21km. And the server sends out updates frequently with or without client input in most cases, so that’s 21km for all players.

for the full frame to complete you have to send AND receive data, unless you are only spectating the game. ideally packets from all players should arrive in about the same time, but since this never happens in practice the server has terrible choice to make - to wait for sync or just continue. most of the games actually wait, so return trip does not only take more because of the plain larger distance, but you have to wait on “slowest connection”, and then it takes time for server to process all that, and then the info has to come back to clients, and only when this frame is finally rendered, only then we can stop the watch and see how long did it take.

2) Bandwidth plays a very important role on client machines. Most ISPs loath when their subscribers use upstream bandwidth, especially on cable networks that are not designed for that behaviour (sad, but true). Residential networks have roughly a 1:20 to 1:10 upstream to downstream ratio. Dedicated game servers generally have a 1:1 ratio. So when a client only has to send a couple bytes out and receive larger packets from a single source, this is a good thing. You also have to consider congestion. Someone connected from a dense area like LA is likely to run into a lot of congestion issues compared to someone connected from Idaho.

why do you care about ISP? you pay for you bandwidth and you should be able to use it as you wish, just like you do. download/upload porn all they long if you wish, no one should care, but if they say something, spit in their face and change ISP.

if i can upload my photos and movies, if i can watch and listen streaming multimedia, watch youtube all day long, using my full upload/download bandwidth, then why do you think it would be a problem if the same amount of bytes is streamed for the purpose of the game? if people can exchange billions of illegal gygabites through p2p networks using they full up/dwn bandwidth, then the same should work for the game. isn’t that so?

There is also the matter of bandwidth caps now happily employed by most, if not all, ISPs today. Have you ever seen how much bandwidth a game like Battlefield takes up? Let me tell you because I analyzed it, among other games. In a 32 player game, a single Battlefield client consumes up to 32KB/s. That’s a damn lot for a single user. 32Kb x 32 players = 1MB/s from the server, which is exactly what I recorded when hosting a 32 player game. I doubt any residential line supports that sort of bandwidth and even if it did, you’d hit your caps quite quickly.

would you rather play a game for 5 hours on 20Hz, or 4hours on 60Hz? the bandwidth difference is not that big. for some people “better” is cheaper regardless of quality, for others “better” is better and they feel it is natural for it to cost more, that doesn’t make it worse, only more expensive.

3) Not true. P2P has every more reason to cause delay issues. As I mentioned in 2), ISPs limit residential upstream. Have you ever tried to host a game server on a cable connection? You would get at most 6 players, each with a latency of 100 ms. I know, my friends and I use to host games all the time. A P2P model means everyone is a client and a server, so each connection has the 6-player limit too.

there are no delays in p2p caused by bandwidth, only if you setup the situation where clients would actually exceed their bandwidth. but even if all the clients had dial up, then they would merely be limited only with the number of peers that can be in one game at once, say 4… but if they have some average ADSL, then 16 or 32 players should be able to play without a problem, on 60Hz or even more. while server based approach can never achieve 60Hz with any of the clients, not even over LAN, maybe.

also, there is a neat thing you can do with p2p. just like servers can send updates to client only about other visible client or just of those that are nearby (in the game-world)… well, peers can do the similar thing much more elegantly, they can communicate on different frequencies depending on the distance. so if some peer is far away, in the game-world, you can send packets to that peer on much slower frequency, therefore drastically reduce bandwidth. you could send updates to peers that are out of visual range(in the game-world) on even 1 second intervals or slower, and increase the frequency dynamically as they close by to your field of view, therefore being able accommodate for all kind of connections on the fly, as a simple change in frequency could allow to switch from ‘more players’ to ‘more frames’ as desired.

Also, when someone connects from far away, say China, then all other players have to send a signal out that distance. That’s an accumulated distance to China _and_ back causing all the more interruptions and delays whereas in a server model only the server has to deal with such a far away client. The dedicated server is also going to have state of the art networking, so it’s likely the connection won’t suffer as bad.

distance is distance, and having a server only makes it worse.

there is no FAST/SLOW here, no waiting - you only have FURTHER and CLOSER, and further is not SLOWER it is only more behind in the past, but the rate of update is NON INTERRUPTED, has CONSTANT streaming flow. theoretically working on FULL 60Hz and more, where frequency only depends on upload bandwidth, size of packets and number of peers. there is no lag, no glitches, no slowdowns, no waiting on server… only time dilation, depending only on DISTANCE.

imagine 8 people have radar devices that can read signal from similar device and display their location. all of them broadcast their location to all other and all the devices update location as the the signal arrives. now, this signal never stops and the latency here is directly proportional ONLY to distance.

again, latency does not mean SLOWER, only further back in the past. but even the stream of data from China to Italy, or wherever else, would have update rate as much as the bandwidth allows, easily 60Hz and more.

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Aug 31, 2009 at 15:56

@gbLinux

i wish to argue how peer-to-peer model is faster, much faster, than currently popular server-client model… and in fact, it has so many advantages over S/C that it is mindbogglingly unexplainable why in the world no online multiplayer game use it. why, why, why?

First, your modeling is overly simplistic. In a real P2P network, there may be two or more nodes between you and the other node where there is a game state change that has to make it’s way to your node. With a handful of nodes, P2P basically acts as a client/server network anyways. You have to model a game where you have 20, 200 or 2000 nodes, of varying bandwidth, of varying latency, across the world.

Latency is often the primary low-level issue. Yeah, eventually, that torrented DVD magically finds it’s way to your grubby hands, but if the other player creates a pit in front of you that you walk over in your game because his state change message hasn’t reached you yet, that makes the game suck.

Beyond that, there are many, many possible higher-level reasons that range widely. It’s interesting that you think “faster” is all that matters to an MMO designer. What about security, integrity of data, internal consistency, synchronization, peer management, etc? What about tooling, libraries, staff training and existing capabilities? Do you think those are easy problems?

Technologically, distributed data is not an unsolvable problem, but is always much more complicated than client/server. (And, I hope I don’t have to explain how much more expensive complex code costs versus the cost of buying a little bit more bandwidth…)

Basically, in a P2P system, each peer must have some (potentially large) proportion of the game world data local to the system, but it must be very quickly updated across all nodes. This creates all sorts of higher-level issues that have nothing to do with the lower level basics of latency and bandwidth usage you’ve explored.

Also, there’s a more practical issue of “historical timing”. You are complaining now when P2P and distributed computing is getting to be a prevalent way to tackle current technology issues (and still, as practitioners, our tools and “common understanding” is still young). However, mature MMOs played today were built a while back, designed even further back, when clients didn’t have the bandwidth the have now, technologies were less mature, etc., and the decision you’d make now isn’t the one you made 2,3 or 5 years ago.

“mindbogglingly unexplainable”? I would just say that it actually pretty simply explainable: it’s naivete on your part.

Now, is it doable? Yes. Many emergent projects are trying out distributed concepts in MMO. (Ex: DHT databases for maintaining data across multiple nodes.)

A638aa42130293f319eda7fa4ba121f4
0
fireside 141 Aug 31, 2009 at 16:20

Not being a social gamer I find this discussion interesting. I thought the reason for client/server was a matter of synchronization. The server collects all the data and keeps it in one place so everything is updated properly. This can be done with P2P then?

Hmm. I guess Alphadog answered it somewhat as being possible. I still don’t quite understand it though. It sounds like everyone has to update everyone else’s copy. That would complicate things almost exponentially with the number of players. Is someone actually doing that in the real world? I’m a scanner, I’ll admit, but I didn’t see any games mentioned.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 Aug 31, 2009 at 16:59

you spot out every 20th player is a mini server.

8fd4a055522ce713cde7dd1cb4083cb2
0
martinsm 101 Aug 31, 2009 at 17:50
8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Aug 31, 2009 at 18:10

There are many ways to tackle the issue. Each comes with advantages and disadvantages. rouncer’s idea is one way; basically instead of having fixed, centralized servers, you “float” authoritative servers over the pool of nodes, with fancier systems self-optimizing. A kind of pseudo-P2P. Or, you go fully peered, but usually latency is a bigger issue in those kinds of systems.

The biggest issue (ie. the most talked about) is security, trust and reputation. How do you dump basically all your game code and data on any peer joining in the peering? Well, it’s pretty easy to hand-waive this with words like “encryption”, or “reputation”, and such. But, every word you use is another expense in building the system relative to a classic client/server system.

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Aug 31, 2009 at 18:49

@gbLinux

why do you care about ISP?

A good game architect pays attention to the capabilities and limitations that will be available at time of the release of the project.
@gbLinux

you pay for you bandwidth and you should be able to use it as you wish, just like you do.

This line, more than anything, makes me realize that the OP has no clue about the pressures of actually designing an MMO for the Real World.

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Aug 31, 2009 at 23:35

@alphadog

First, your modeling is overly simplistic. In a real P2P network, there may be two or more nodes between you and the other node where there is a game state change that has to make it’s way to your node. With a handful of nodes, P2P basically acts as a client/server network anyways. You have to model a game where you have 20, 200 or 2000 nodes, of varying bandwidth, of varying latency, across the world.

latency issues can in worst case be handled just like server does it. there is really not much difference between p2p and c/s, as you said, it’s just that computation is distributed, but all the problems and solutions still apply much the same. after that, p2p still gets to be faster for having shorter return path and whatever is the time penalty for packets to stop at server address and be dealt with until finally let go back to clients.

Latency is often the primary low-level issue. Yeah, eventually, that torrented DVD magically finds it’s way to your grubby hands, but if the other player creates a pit in front of you that you walk over in your game because his state change message hasn’t reached you yet, that makes the game suck.

all the peers are independent here, if the signal from one peer disconnects, then everything else should continue as usual, with just that client being frozen somewhere in the game-world. this is not very comparable with file sharing p2p networks, because those are about redundancy and data storage, this is just about signaling, so nodes are independent.

Beyond that, there are many, many possible higher-level reasons that range widely. It’s interesting that you think “faster” is all that matters to an MMO designer. What about security, integrity of data, internal consistency, synchronization, peer management, etc? What about tooling, libraries, staff training and existing capabilities? Do you think those are easy problems? Technologically, distributed data is not an unsolvable problem, but is always much more complicated than client/server. (And, I hope I don’t have to explain how much more expensive complex code costs versus the cost of buying a little bit more bandwidth…)

i see now what you’re talking about. this is not about persistent online worlds, not about massive multiplayer, just LAN/WAN networking option for some single player game for 8, 16, 32 or so players, like quake, starfleet command, x-wing and similar.

i’m not very concerned with security, i aim this solution to replace situations where there is no dedicated server, but some of the clients has to host the game, which makes it equally dodgy, or for the consoles where security is built-in, or is at least supposed to be… or for LAN games where security is no issue.

*** 32 clients, 20Hz, Client-Server Cost:
Client Upload: 800 bytes/sec = 0.006 mbps
Client Download: 13,420 bytes/sec = 0.10 mbps
Server Upload: 429,440 bytes/sec = 3.27 mbps
Server Download: 16,000 bytes/sec = 0.12 mbps

*** 32 peers, 20Hz, Peer-to-Peer Cost:
Client Upload: 31,000 bytes/sec = 0.24 mbps
Client Download: 31,000 bytes/sec = 0.24 mbps

while there is no way for average ADSL to support 32 clients game without dedicated server, p2p can easily manage even more players and/or higher update frequency. which makes me wonder - how all the games without dedicated server can manage to host any more than 8 players per game?

Basically, in a P2P system, each peer must have some (potentially large) proportion of the game world data local to the system, but it must be very quickly updated across all nodes. This creates all sorts of higher-level issues that have nothing to do with the lower level basics of latency and bandwidth usage you’ve explored.

yes, that’s the idea, complete game would run on each client. imagine you are playing a single player quake on a special client device where each peer has radio antenna and it broadcast it’s position in the game world via radio-waves. whenever some of those devices get turned on you would get a signal and your client would render that new player somewhere in the game-world. this is very similar how some mobile games use p2p over bluetooth, and the same thing should work over WWW just the same.

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Sep 01, 2009 at 00:24

@gbLinux

there is really not much difference between p2p and c/s, as you said

There’s not much difference with a small number of nodes. There are BIG differences that grow exponentially more difficult with P2P.
@gbLinux

this is not about persistent online worlds, not about massive multiplayer, just LAN/WAN networking option for some single player game for 8, 16, 32 or so players, like quake, starfleet command, x-wing and similar.

What? Why are you wasting time with P2P for LAN games? You are adding complexity for a system that will get you nothing over the easier client/server model.
@gbLinux

i’m not very concerned with security.

This means your game would be a guaranteed fail. What you are saying is that I can jack in and, with no security, basically control the peer network any way I want. You may not care, but your players will when they find out their fun can easily be ruined…

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 01, 2009 at 05:30

@alphadog

There’s not much difference with a small number of nodes. There are BIG differences that grow exponentially more difficult with P2P.

what is the big difference? what grows exponentially?

What? Why are you wasting time with P2P for LAN games? You are adding complexity for a system that will get you nothing over the easier client/server model.

it can get many more players in one game than server approach, wan/lan all the same advantages it has, where over LAN it could even use broadcasting and therefore even further speed up communication.

This means your game would be a guaranteed fail. What you are saying is that I can jack in and, with no security, basically control the peer network any way I want. You may not care, but your players will when they find out their fun can easily be ruined…

Xbox 360, ok? security can be managed just like with server model, you can have one of the peers be the judge, you can have voting system, you can have multiple judges, random… and if company was really concerned about it, they could run dedicated server in p2p as well, which could full-time do the policing and inspection of nodes.

A638aa42130293f319eda7fa4ba121f4
0
fireside 141 Sep 01, 2009 at 12:12

what is the big difference? what grows exponentially?

I think it would be the number of messages received. In a client/server you would be sending one message and receiving one message per cycle. The server would be receiving all the messages from all the players and sending back one per player. Maybe in one sense it wouldn’t matter, but there has to be some kind of verification or no one would be sure what was going on. It would also be taking care of persistence, etc. making sure if a player quits, he is remembered etc. Each client would have to take care of those tasks in a p2p wouldn’t it? It seems like that would effectively make each client the equivalent of what a server is doing. So instead of the complex task given to a main server, that task is given to each and every client. I think they went to a client/server model for that reason. There might be a huge server system taking care of everything, but it’s only one system and it can be given the best pipeline, large database, etc. P2P isn’t being used for things that require constant update and I think there is an obvious reason for it. The potential for error would grow exponentially because every client is updating every other client. The fact that you see client/server on a lan party gives some idea of how fast it gets out of control, although maybe they’re just doing it there for expandability. Doesn’t mean you shouldn’t experiment with it, though. I wouldn’t. I can’t believe people do the things they do with opening up their computers to other people like that.

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Sep 01, 2009 at 13:36

@gbLinux

what is the big difference? what grows exponentially?

Basically, network and game state management “messages”. The client still always says the same thing, eg. “move player 3 to x,y,z”.

But, there’s the addition of processing things like “Hi new node #3625!”, “Hey, #1926, are you still there? Hello?”, “Oops all the authoritative servers are gone, should I become master now?”, “No. I am master.”, “No. I am.”, “Wait. Let’s negotiate this based on reputation or voting.”, “F’you. I’m master and here’s the override code.”
@gbLinux

it can get many more players in one game than server approach

Your central server isn’t limited to one physical box. It could be a virtual server actually backed by a server farm. Scaling this isn’t intuitively obvious, but neither is a solid P2P architecture.

Here’s where I am confused by your mixed-up argumentation. If we are talking about a LAN game, we’re talking about tens of nodes at most. If we are talking of those number of nodes, then you would hardly be pressed to hit a limit in either C/S or P2P with a cheap laptop…
@gbLinux

Xbox 360, ok?

Careful, just because you wrote the game for the XBox360 doesn’t mean I, as a hypothetical hacker, can’t use a totally different system type, jack into your network with a sniffer, reverse your protocols, and jam up your game solidly. Nothing creates a security hole like an unexperienced, ego-maniac developer! :)
@gbLinux

security can be managed just like with server model, you can have one of the peers be the judge, you can have voting system, you can have multiple judges, random… and if company was really concerned about it, they could run dedicated server in p2p as well, which could full-time do the policing and inspection of nodes.

But, that’s my point. Every technological feature you just said creates a larger codebase to write and maintain versus C/S, not to mention it adds to your support desk for “voting moderators”, or even if those are volunteers, arbitrators that have to watch over community judges that “go rogue”. Thanks for making the point for me.

At this point, I think you are theoretically convinced of the awesome superiority of P2P over client/server for LAN games and no amount of arguing will change your mind. I don’t think there’s any distinct superiority either way. You tradeoff a gain for a loss.

Therefore, I suggest you create a simple LAN or MMO game in both versions and see for yourself. Put your money where your mouth is, so to speak…

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 01, 2009 at 22:32

@fireside

I think it would be the number of messages received. In a client/server you would be sending one message and receiving one message per cycle. The server would be receiving all the messages from all the players and sending back one per player. Maybe in one sense it wouldn’t matter, but there has to be some kind of verification or no one would be sure what was going on. It would also be taking care of persistence, etc. making sure if a player quits, he is remembered etc. Each client would have to take care of those tasks in a p2p wouldn’t it? It seems like that would effectively make each client the equivalent of what a server is doing.

number grows but not exponentially. the amount of communicated data is not much larger at all, it’s only that p2p uses increased UPLOAD bandwidth, but with average ADSL this is not the problem.

yes, each client would be doing about the same task what server is doing for it, minus physics for all the peers - just for itself. but, don’t make it look as a big deal, if your computer can run single player game where it needs to calculate AI and physics for all the computer controlled entities, p2p clients would require just about the same processing power. the difference is only where the position data for the entity is coming from, remotely or from AI algorithm locally, but the rest of the game should go on just as in single player game.

So instead of the complex task given to a main server, that task is given to each and every client. I think they went to a client/server model for that reason. There might be a huge server system taking care of everything, but it’s only one system and it can be given the best pipeline, large database, etc. P2P isn’t being used for things that require constant update and I think there is an obvious reason for it. The potential for error would grow exponentially because every client is updating every other client. The fact that you see client/server on a lan party gives some idea of how fast it gets out of control, although maybe they’re just doing it there for expandability. Doesn’t mean you shouldn’t experiment with it, though. I wouldn’t. I can’t believe people do the things they do with opening up their computers to other people like that.

task is not complex at all, it’s what game is supposed to be doing in single player mode without the problem, it’s only complex if one computer has to do it for all the players.

peers can be synchronized just the same as in server/client approach.

opening ports means nothing, what you gonna do to security if the server on that port only understands “left”, “right”, “shoot”, “jump”.. ?

lots of ports on your computer are open as it is. do you have “remote assistance” enabled in your windows? have you ever seen what kind of crazy services run in the Windows background by default?

A638aa42130293f319eda7fa4ba121f4
0
fireside 141 Sep 01, 2009 at 23:25

do you have “remote assistance” enabled in your windows? have you ever seen what kind of crazy services run in the Windows background by default?

I just de-activated it. It’s probably paranoia on my part but I don’t care for that kind of thing. I don’t play online games. I don’t mess with server systems so it’s just academic on my part.

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Sep 02, 2009 at 00:29

@gbLinux

opening ports means nothing, what you gonna do to security if the server on that port only understands “left”, “right”, “shoot”, “jump”.. ?

Ah! If I had a dollar for every naive developer that said this, then got their backsides handed to them on a platter…

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 02, 2009 at 01:57

@alphadog

Ah! If I had a dollar for every naive developer that said this, then got their backsides handed to them on a platter…

should we believe you, since you said it with such authority, or would you care to actually say what are you thinking about?

But, that’s my point. Every technological feature you just said creates a larger codebase to write and maintain versus C/S, not to mention it adds to your support desk for “voting moderators”, or even if those are volunteers, arbitrators that have to watch over community judges that “go rogue”. Thanks for making the point for me.

At this point, I think you are theoretically convinced of the awesome superiority of P2P over client/server for LAN games and no amount of arguing will change your mind. I don’t think there’s any distinct superiority either way. You tradeoff a gain for a loss.

Therefore, I suggest you create a simple LAN or MMO game in both versions and see for yourself. Put your money where your mouth is, so to speak…

i’m not sure what are you talking about. Flight Simulator has p2p networking which works just fine, as i managed to figure out by googling… Mario Kart DS, KartRider and bunch of mobile games via bluetooth or wi-fi. it’s really hard to google any real performance information to figure out some numbers, but it seems players are quite happy.

we already have games that use it, we just need to find the people who can play them to tell us how it’s going. unfortunately KartRider is offline, otherwise we could try it out right now. i suppose there could be all bunch of these little games on the internet in flash or java that actually use p2p for multiplayer, but it’s hard to find them since no one really puts any ‘game specs’ on those online-game websites.

let’s find a p2p online game and let’s test it.

basically p2p is no different to “direct link”, like two Game Boy can be connected or two PS2, or whatever… any additional nodes do not change the general situation since you can look at any pair of two peers independently as having “direct link” network connection. all the other peers can
disconnect and the game would still run. – http://en.wikipedia.org/wiki/Peer-to-peer “The distributed nature of P2P networks also increases robustness, and—in pure P2P systems—by enabling peers to find the data without relying on a centralized index server. In the latter case, there is no single point of failure in the system.”

p.s.
if you and some friend of yours have iPhone, you can test it right away with some free games, so if you do - let us know.

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Sep 02, 2009 at 02:11

@gbLinux

should we believe you, since you said it with such authority, or would you care to actually say what are you thinking about?

It’s not really that difficult. For example, I get about 20 emails per day about new vulnerabilities discovered in applications from places like Secunia and other security outfits. Go do some research on sites like that and you’ll get an endless list of failures in apps probably believed to be quite solid. I have had some of my apps hacked too…
@gbLinux

i’m not sure what are you talking about. Flight Simulator has p2p networking which works just fine, as i managed to figure out by googling… Mario Kart DS, KartRider and bunch of mobile games via bluetooth or wi-fi.

Never said it was impossible. If you go back and actually read what I said, instead of look for an argument anywhere you can, you’ll note that I never said don’t do it. It’s just not the “best thing since sliced bread” that you have been saying for a long time now in various dev forums.

BTW, if you want some real research, go read some papers from IEEE or ACM. You’ll find groups like NICTA that are really looking at this kind of architecture in large settings.

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 02, 2009 at 02:41

Never said it was impossible. If you go back and actually read what I said, instead of look for an argument anywhere you can, you’ll note that I never said don’t do it. It’s just not the “best thing since sliced bread” that you have been saying for a long time now in various dev forums.

i don’t wanna argue at all(anymore), i think we agree quite nicely and that this absolutely needs to be tested, then judged. i was actually replying to your suggestion that i should make it myself, so what i’m saying is that we can test it right away, or simply ask people who experienced it.

research is fine and i think i have seen all the papers… there is not much experimental data in any of those and there is actually very little info on the whole subject in general, after three pages of google search it all basically starts to repeat… but, all we have to do is to find the game we can both play, and see with our own eyes.

basically, from now on people could post links with newly discovered p2p games so we can make a final judgment. it’s not in my interest for me alone to research the subject, i already did.. now, i want to share this with public and so it can be refuted or acknowledged. if it is confirmed then i think this would deserve front-page article on this web-site and elsewhere. no doubt many will be surprised if p2p actually outperforms server, so this would kind of be a “big news”, and would be welcomed by all, players and developers alike, right?

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 02, 2009 at 19:02

@gbLinux

i don’t wanna argue at all(anymore), i think we agree quite nicely and that this absolutely needs to be tested, then judged. i was actually replying to your suggestion that i should make it myself, so what i’m saying is that we can test it right away, or simply ask people who experienced it.

actually, as far as i can tell nobody in this thread is agreeing with you. why do you act like people are agreeing with you, when in fact they clearly do not?
@gbLinux

basically, from now on people could post links with newly discovered p2p games so we can make a final judgment. it’s not in my interest for me alone to research the subject, i already did.. now, i want to share this with public and so it can be refuted or acknowledged.

i really doubt you have performed any meaningful research. if you have - sadly it seems pretty clear to everybody here that you failed to understand any of it.

a simple analysis of packets sent shows that a fully connected P2P mesh has bandwidth requirements O(n), where n is the number of peers - while client/server has bandwidth O(n) on the server and O(1) on the client. this is a well known and obvious fact, and also happens to be the reason why a majority of games today use the client/server model.

so consider your hypothesis refuted. it was just refuted, right there. by me. ok?
@gbLinux

if it is confirmed then i think this would deserve front-page article on this web-site and elsewhere. no doubt many will be surprised if p2p actually outperforms server, so this would kind of be a “big news”, and would be welcomed by all, players and developers alike, right?

if exactly “what” is confirmed? your ideas about networking are vague and meaningless: you assert that P2P is better than client/server for nebulous reasons such as it being “FASTER”. you clearly have no actual experience developing multiplayer games, yet you think that your “idea” (whatever it is, nobody here knows) is deserving of front page news?

at this point i really cannot help but to come to the conclusion that you a) really have no idea what you are talking about and b) are quite possibly suffering from delusions of grandeur.

please give it a rest abaraba and go and learn something about this subject first before attempting to share your incredible ideas with the rest of the world.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 Sep 02, 2009 at 19:03

It would be pretty close.

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 02, 2009 at 22:53

@gaffer

actually, as far as i can tell nobody in this thread is agreeing with you. why do you act like people are agreeing with you, when in fact they clearly do not? i really doubt you have performed any meaningful research. if you have - sadly it seems pretty clear to everybody here that you failed to understand any of it.

are you aware, my friend, how “Age of Empires” actually managed to do P2P for 8 players on 16MB Pentium 90 with a 28.8 modem, with consistent frame rate of 15fps? moving 1500 archers per turn… have a look: http://www.gamasutra.com/features/20010322/terrano_01.htm

a simple analysis of packets sent shows that a fully connected P2P mesh has bandwidth requirements O(n), where n is the number of peers - while client/server has bandwidth O(n) on the server and O(1) on the client. this is a well known and obvious fact, and also happens to be the reason why a majority of games today use the client/server model. so consider your hypothesis refuted. it was just refuted, right there. by me. ok?

hahaha… O(n), eh?

and what is the server bandwidth?
what happens without DEDICATED SERVER?
how many games do not have dedicated server?
do many console games like Xbox 360 have dedicated server?
or… what happens when company decide to close dedicated servers?

*** 32 clients, 20Hz, Client-Server Cost:
Client Upload: 800 bytes/sec = 0.006 mbps
Client Download: 13,420 bytes/sec = 0.10 mbps

Server Upload: 429,440 bytes/sec = 3.27 mbps
Server Download: 16,000 bytes/sec = 0.12 mbps

*** 32 peers, 20Hz, Peer-to-Peer Cost:
Client Upload: 31,000 bytes/sec = 0.24 mbps
Client Download: 31,000 bytes/sec = 0.24 mbps

– let me tell you, without DEDICATED SERVER, it simply can’t work. do you understand? (YES/NO)

hence all the complaints, petition and requests for many console games to have dedicated servers, simply because average user can hardly be a server, but it CAN BE a peer. you are complaining about 0.24mbps and you don’t see a 3.27mbps stuck right in your eye, wake up!

if exactly “what” is confirmed? your ideas about networking are vague and meaningless: you assert that P2P is better than client/server for nebulous reasons such as it being “FASTER”.

whaaa?! …are you making fun of yourself? latency and updated frequency are not nebulous reasons, but just about the most important factors in multiplayer games.

you clearly have no actual experience developing multiplayer games, yet you think that your “idea” (whatever it is, nobody here knows) is deserving of front page news?

at this point i really cannot help but to come to the conclusion that you a) really have no idea what you are talking about and b) are quite possibly suffering from delusions of grandeur.

please give it a rest abaraba and go and learn something about this subject first before attempting to share your incredible ideas with the rest of the world.

aha… you mean like Mario Kart DS, Flight Simulator, Age of Empires and who knows how many more games… GTA IV and Halo 3 seem to use p2p, what say you?

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 02, 2009 at 23:08

@gbLinux

hence all the complaints, petition and requests for many console games to have dedicated servers, simply because average user can hardly be a server, but it CAN BE a peer. you are complaining about 0.24mbps and you don’t see a 3.27mbps stuck right in your eye, wake up!

incorrect. if the average user cannot be a server, then by definition it cannot be a peer either - why is it that you think it can?

do you even understand what O(n) means?

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 02, 2009 at 23:12

@gbLinux

whaaa?! …are you making fun of yourself? latency and updated frequency are not nebulous reasons, but just about the most important factors in multiplayer games.

actually, no they are not.

the improved latency from P2P is another well known fact, known by all professional multiplayer game developers - however, it is typically not the primary concern. the O(n) growth of bandwidth per-peer is usually more important.

and “updated frequency” i’m afraid is a delusion of yours, you seem to believe that P2P for some reason offers some potential for higher send rates, in fact, it is the opposite - client/server allows clients to operate asynchronously with other players - it is the deterministic lockstep P2P model which has to wait for the most lagged player before advancing the simulation.
@gbLinux

aha… you mean like Mario Kart DS, Flight Simulator, Age of Empires and who knows how many more games… GTA IV and Halo 3 seem to use p2p, what say you?

aha… you mean like you just went and googled for 10 minutes and rattled off some names of games (you think) that use P2P.

what exactly is that supposed to prove?

certainly it does not prove this statement of yours:
@gbLinux

ultimately, i wish to argue how peer-to-peer model is faster, much faster, than currently popular server-client model… and in fact, it has so many advantages over S/C that it is mindbogglingly unexplainable why in the world no online multiplayer game use it. why, why, why?

or this one:
@gbLinux

CONCLUSION:
- P2P can not only allow for far better update frequency, but asynchronous, continuous updates will smooth many visual glitches automatically and the streaming nature of incoming data would even further make the whole experience more fluid.

finally, for your original questions:

1.) does p2p have shorter traversal path than server-based model?

2.) would parallel computing even further speed up latency by getting rid of serial computation server does?

3.) can p2p run on much faster frequency (60HZ and more) due to the nature of uninterrupted, streamed, asynchronous update

the answers are 1) yes 2) no 3) definitely not.

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 03, 2009 at 00:57

@gaffer

incorrect. if the average user cannot be a server, then by definition it cannot be a peer either - why is it that you think it can? do you even understand what O(n) means?

you keep repeating symbols without ever putting any real numbers in your equation. what definition? where is the server in your definition? SERVER, SERVER, SEVER.. tooo-toooo! whatever your definition is, it’s wrong, wake up!

*** 32 clients, 20Hz, Client-Server Cost:
Server Upload: 429,440 bytes/sec = 3.27 mbps
Server Download: 16,000 bytes/sec = 0.12 mbps

*** 32 peers, 20Hz, Peer-to-Peer Cost:
Client Upload: 31,000 bytes/sec = 0.24 mbps
Client Download: 31,000 bytes/sec = 0.24 mbps

1.) Avergage ADSL can support 32 players in p2p game? YES/NO
2.) Average ADSL can NOT support 32, nor 16 players in c/s game? YES/NO

and “updated frequency” i’m afraid is a delusion of yours, you seem to believe that P2P for some reasons offers some potential for higher send rates, in fact, it is the opposite - client/server allows clients to operate asynchronously with other players - it is the deterministic lockstep P2P model which has to wait for the most lagged player before advancing the simulation.

lol. as many times explained to you already, latency between peers is proportional only to distance and can flow continuously at normal frame rate, like 60Hz. latency in server/client model not only depends on distance, which is always longer, but now frequency depends on server update rate as well, which is usually low and proportional to number of players, plus time penalty for extra routing. that’s about 50-100ms extra latency, if not much, much more, just for choosing a server/based model over p2p. but this additional latency is not just latency, it’s a frequency slow-down factor, it brings even more noise to the flow. – if a packet arrives at the moment when server just started with a physics loop, it means it would practically be stuck there for about 100ms before the information can be sent to actual destination. …even over LAN you can’t really scale the number of players, nor you can get rid of this extra latency caused by the server calculating physics loop.

no, p2p does not need to wait, only if it wants to sync, but it basically only runs in the past to accommodate highest latency player, just like server does, no waiting… tho p2p can modify this dynamically, on the fly, hence produce gradient change and keep smooth animation, while conserving determinism. Age of Empires needed to sync because simulation on each of the peers had to be deterministic, identical, but they did manage to achieve smooth animation and perfect sync nevertheless. so, not only they managed the bandwidth constraints of 28.8 modem, but they achieved fluid animation, dynamically adjusting to suit all kinds of latency and packet loss over the internet, and in the same time having deterministic and identical simulation on each peer.

that is an explanation, my dear friend - numbers and examples… tho i can always use some of your kind of “arguments” and “explanations”, call you stupid and delusional, but i will not.

aha… you mean like you just went and googled for 10 minutes and rattled off some names of games (you think) that use P2P. what exactly is that supposed to prove?

hahahaa… i’m proving you wrong, i’m proving to you how p2p has been successfully implemented even on 28.8 modem with 8 players! again, client/server model could never manage it and this makes all your bandwidth comments even more ridiculous. the question really is, what are you trying to prove?

are you saying you do not believe some games actually use p2p? do you think you can make some argument or you just gonna fight me with you disbelief? what, do you mean to say Halo 3 does not use p2p? What then, does it have dedicated server? GTA IV you say can not possibly be using p2p, eh? Rockstar, they can’t be that much delusional and stupid to use it, is that what you’re saying?

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 03, 2009 at 01:05

1.) does p2p have shorter traversal path than server-based model?

2.) would parallel computing even further speed up latency by getting rid of serial computation server does?

3.) can p2p run on much faster frequency (60HZ and more) due to the nature of uninterrupted, streamed, asynchronous update

the answers are 1) yes 2) no 3) definitely not.

lol… try to argument your silly opinion and you will see numbers start to laugh in your face. in fact, do you have any argument for any of what you said here? …you are just saying stuff, being angry, but you failed to support any of your statements, the only argument you really have here is O(n), and you forgot to consider the server, hahaa! so, do you think you can actually articulate your opinion so we can see where did your calculation go astray, or not?

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 01:21

@gbLinux

lol… try to argument your silly opinion and you will see numbers start to laugh in your face. in fact, do you have any argument for any of what you said here? …you are just saying stuff, being angry, but you failed to support any of your statements, the only argument you really have here is O(n), and you forgot to consider the server, hahaa! so, do you think you can actually articulate your opinion so we can see where did your calculation go astray, or not?

your own numbers in your first post in fact demonstrate how P2P uses more bandwidth per-peer than client/server, and that the bandwidth required to run an integrated server is identical to that of a peer.

you cannot seem to understand this fact, probably because you are either a) mentally retarded b) 12 years old, or c) don’t understand english and run forum posts through google translate - or d) all of the above.

which particular reason it is, i don’t really care.

enjoy your ignorance abaraba, you seem to have it in abundance

but remember - if/when you eventually getting around to coding a multiplayer game, and suddenly your bandwidth is growing at O(n) and your simplistic input/command based P2P technique breaks down because you do not understand why your game is non-deterministic across peers, when you *finally* discover that you have to wait for the input from the most lagged peer before simulating the frame – don’t come crying to us, because we knew it all along, tried to explain it to you, and you were too stupid to listen.

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 01:28

@gbLinux

1.) Avergage ADSL can support 32 players in p2p game? YES/NO
2.) Average ADSL can NOT support 32, nor 16 players in c/s game? YES/NO

1) NO
2) NO

633607470680331650-trolls.jpg

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 03, 2009 at 02:16

@gaffer

*** 32 clients, 20Hz, Client-Server Cost:
Server Upload: 429,440 bytes/sec = 3.27 mbps
Server Download: 16,000 bytes/sec = 0.12 mbps

*** 32 peers, 20Hz, Peer-to-Peer Cost:
Client Upload: 31,000 bytes/sec = 0.24 mbps
Client Download: 31,000 bytes/sec = 0.24 mbps

1.) Avergage ADSL can support 32 players in p2p game? YES/NO
2.) Average ADSL can NOT support 32, nor 16 players in c/s game? YES/NO

1) NO
2) NO

List of device bandwidths
From Wikipedia, the free encyclopedia

http://en.wikipedia.org/wiki/List_of_device_bandwidths

man, you will loose your job if your employers find about this. it’s abnormal how you’re failing to compare two numbers. – your whole point of coming here with insults was to say how p2p has increased bandwidth PER PEER, without ever realizing that without DEDICATED SERVER it actually makes for much better solution bandwidth wise, and in fact the only solution if you wish to support any more than 8 players.

but remember - if/when you eventually getting around to coding a multiplayer game, and you suddenly your bandwidth is growing at O(n) and your simplistic input/command based P2P technique breaks down because you do not understand why your game is non-deterministic across peers, when you *finally* discover that you have to wait for the input from the most lagged peer before simulating the frame – don’t come crying to us, because we knew it all along, tried to explain it to you, and you were too stupid to listen.

angry man… lol. what is it you want again? btw, that is wrong and delusional what you just said. – i’m not making a game, i just wanted to inform people of this so they know why they can only have 8 player laggy multiplayer on their Xbox 360, while they could actually have fluid 32 players with the same connection. stop talking about bandwidth, without DEDICATED SERVER it is an argument for P2P, and against client-is-server approach…. so, stop hitting yourself!

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 02:21

@gbLinux

it’s abnormal how you’re failing to compare two numbers. – your whole point of coming here with insults was to say how p2p has increased bandwidth PER PEER, without ever realizing that without DEDICATED SERVER it actually makes for much better solution bandwidth wise, and in fact the only solution if you wish to support any more than 8 players.

so you are in fact saying that a peer-to-peer solution, uses less bandwidth that an integrated server and clients?

is this what you believe?

really?

i’m sorry, but you are completely wrong.

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 02:24

@gbLinux

i just wanted to inform people of this so they know why they can only have 8 player laggy multiplayer on their Xbox 360, while they could actually have fluid 32 players with the same connection. stop talking about bandwidth, without DEDICATED SERVER it is an argument for P2P, and against client-is-server approach…. so, stop hitting yourself!

this statement also is completely wrong, so you can stop trying to “inform people of this” - because it is in fact, not true.

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 03, 2009 at 03:09

@gaffer

so you are in fact saying that a peer-to-peer solution, uses less bandwidth that an integrated server and clients?

is this what you believe?

really?

i’m sorry, but you are completely wrong.

this statement also is completely wrong, so you can stop trying to “inform people of this” - because it is in fact, not true.

you are looking at the numbers, and all you can say is “NO”?!! are you in some kind of weird state of disbelief? try to think it, just open your eyes and look at the numbers, wake up!

*** 32 clients, 20Hz, Client-Server Cost:
Server Upload: 429,440 bytes/sec = 3.27 mbps

3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27 3.27….

*** 32 peers, 20Hz, Peer-to-Peer Cost:
Client Upload: 31,000 bytes/sec = 0.24 mbps
Client Download: 31,000 bytes/sec = 0.24 mbps

0.24mbps, ok?

you can’t be that blind, what is wrong with you? …how long before someone will arrive here to confirm it to you how 3.27mbps is actually bigger than 0.768mbps, while 0.24mbps is smaller number than 0.768mbps??

a.) is average ADSL upload bandwidth 0.768mbsp-1.0mbps?
b.) is 3.27mbs more than 0.768mbps?
c.) is 0.24mbps less than 0.768mbps?

more? less?
it’s not even funny anymore!

no, i’m not talking about “integrated bandwidth”, i’m talking about POSSIBLE and NOT POSSIBLE.

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 03:21

here are some numbers that match with the reality:

in P2P, you must send a packet to every other player in the game

so if your packet size is X, and your player count is n, then your bandwidth is X*(n-1), since you do not have to send a packet to yourself.

in client/server, if you have a dedicated server, each client has to only upload a small amount, lets call this C - since it only needs to send this packet to the server, and not to all other players, the total upload per-client is C

since the server has to to receive packets from all players, it’s download bandwidth is going to be C*n. it also has to send a packet to each player, lets assume these packets are also size X, so it has upload of X*n

if instead of having a dedicated server, you assign one of the players as a server, then you have the following arrangement instead:

each non-server player has upload C, and download X
the server player has download C*n-1 and upload X*(n-1)

so you can see that in fact, the worst case bandwidth for a single player in an integrated client/server is X*(n-1), exactly the same bandwidth that every player has in P2P.

also notice that total bandwidth for the P2P situation grows at O(n\^2), while the total bandwidth in client/server grows only at O(n), this is the main reason why people prefer client/server for high player count games

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 03:42

don’t just believe me, have a read of this post - which explains exactly the same concepts, written by somebody i don’t even know - and they come to the exact same conclusion: client/server is generally a better choice than P2P for high player count games.

http://www.gamedev.net/community/forums/topic.asp?topic_id=546274&whichpage=1&#3520309

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 03, 2009 at 03:50

@gaffer

don’t just believe me, have a read of this post - which explains exactly the same concepts, written by somebody i don’t even know - and they come to the exact same conclusion: http://www.gamedev.net/community/forums/topic.asp?topic_id=546274&whichpage=1&#3520309

yes, that post there actually has few valid objections, but “MORE BANDWIDTH” is not one of them, as WITHOUT DEDICATED SERVER bandwidth works in favor for P2P, and even with dedicated server, fluidity and lower latency, together with server cost and game overall longevity might prove p2p universally superior solution, for players and developers alike, if they started to think.

—Gaffer says:

here are some numbers that match with the reality:

[in short]
P2P (peer upload bandwidth) = X*(n-1)
C/S (server upload bandwidth) = X*(n-1)

so you can see that in fact, the worst case bandwidth for a single player in an integrated client/server is X*(n-1), exactly the same bandwidth that every player has in P2P….

even if your math was sane you now have come to the point to equate p2p and c/s in bandwidth usage and actual practicability… if that was true, p2p would still have more fluid frequency and much better latency. but you’re wrong! if amount of information about one client is X, then, my friend, C/S upload bandwidth for the server is: X*n*(n-1). what is your latency, are you blushing yet?

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 03:56

@gbLinux

bandwidth usage and actual practicability… but, even if that was true, p2p would still have more fluid frequency and much better latency.

define “more fluid frequency” :)

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 03:59

@gbLinux

but you’re wrong! if amount of information about one client is X, then, my friend, C/S upload bandwidth for the server is: X*n*(n-1). what is your latency, are you blushing yet?

but what if you have non-player owned objects, how exactly do you network that in P2P? in this case - the peer cost is X*(n-1) not X*n*(n-1), since you will have more objects to send than you can fit in any packet.

and if instead of a state passing system you attempt to solve this using a deterministic networking model (age of empires), then your bandwidth is no concern at all since you are sending just inputs/commands - but you cannot in this case get P2P to work unless you wait for input from the most lagged player

so much for your “more fluid frequency” and lower latency in P2P! :)

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 03, 2009 at 04:45

@gaffer

but what if you have non-player owned objects, how exactly do you network that in P2P? in this case - the peer cost is X*(n-1) not X*n*(n-1), since you will have more objects to send than you can fit in any packet.

and if you attempt to solve this using a deterministic networking model, then your bandwidth is no concern at all - but you cannot in this case get P2P to work unless you wait for input from the most lagged player

so much for your “more fluid frequency” and lower latency in P2P! :)

yes, determinism and/or syncing, so yes passing even more data if necessary, booo-hooo, just like if you wanted to offload your server physics to clients… data is data, it’s just the difference where is it coming from, but the rest is the same. there is no waiting here, only issuing commands some time for the future, ie. “working in the past”, but that only increases interaction latency, it is not a “slow-down” factor. it’s the same thing the server does.. all the things in p2p can be solved just like in s/c model. you can look at each two peers as having a “direct link”, like Game Boy, it’s simple and it works.

why do you imagine anyone would need to wait for the “laggest” player?

you live in the past, your assumptions are based on 10 year old conclusions, using 10 year old hardware, let me explain… your objection only applies to situation when peer can not manage to render and do the math as fast as other computers. ….but, that was when you had 386 and i had 486 with coprocessor. that kind of “slow-down” and lag is not an issue anymore, any client absolutely must be able to run the game at full speed in single player mode which is all it takes to play it in any number of peers. this kind of lag will cause all the same problems with s/c approach if you wanted to have that kind of synchronization.

assuming every peer have sufficient bandwidth, which is really what is necessary for c/s to work as well, there are no other lags here, just pure ‘speed-of-light-over-distance’ latency, always better in p2p model.

in worst case you can have it not-synchronized and get something like quake 2, only better, on higher frequency, with more players at once and without dedicated server, having some average ADSL/DSL connection and some average computer capable of playing the game in single player mode.

there is several posts around these forums that assert most racing multiplayer games actually do use p2p, since latency and player-player interaction is very critical, so would you be surprised if many racing games used p2p? those kind of games, and many other, do not tend to have dedicated servers at all.

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 04:52

@gbLinux

it’s the same thing the server does.. all the things in p2p can be solved just like in s/c model. you can look at each two peers as having a “direct link”, like Game Boy, it’s simple and it works.

and total bandwidth grows at O(n\^2) which makes it unsuitable for high player counts, do you disagree with this fact?

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 03, 2009 at 05:27

@gaffer

and total bandwidth grows at O(n\^2) which makes it unsuitable for high player counts, if you wish to develop a 4 player game using P2P then go right ahead.

no, total bandwidth does not make it unsuitable. you use much more when you watch YouTube and upload your porn. server upload bandwidth grows O(n\^2) as well, remember?

so, if you wanna be the sucker that has to host a game pushing 3.27mbps, then go ahead, but try to realize not everyone has a rich and stupid friends, living in area with such broadband options.

4 player game is what you can get with the server approach with p2p is 32 and more, as it was said already, and then you failed to equate the bandwidth by ridiculously suggesting how server upload is X*(n-1)!!!

*** 32 clients, 20Hz, Client-Server Cost:
Server Upload: 429,440 bytes/sec = 3.27 mbps

*** 32 peers, 20Hz, Peer-to-Peer Cost:
Client Upload: 31,000 bytes/sec = 0.24 mbps
Client Download: 31,000 bytes/sec = 0.24 mbps

alternatively, if you wish to develop a 32 player P2P game, with a non-deterministic lockstep sync model - then you are obviously a total idiot. do you think you can do a 32 player, not-deterministic lockstep sync game with P2P, YES/NO? :)

what are you talking about? i already told you i’m not developing a game. i never mentioned any plans, nor type of game, nor methods i wish to use, and i very much never said anything about “non-deterministic lockstep sync model”, being my preference or whatever.

you went completely off… why would you have synchronization and “lockstep” in non-deterministic game? why do you put such rubbish in my mouth?

and… what do you mean by “lockstep”?

do you mean FIXED TIME STEP ?! aaaaahahaaaaa HAHAAHAHAHAAHAAAAAAAA! hahaaaaa… oh, mercy!!

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 03, 2009 at 07:00

if you think you were right insulting me for thinking my math was wrong visa vi X(n-1), then what kind of insults do you deserve now when it turned out it was your math which was not just wrong, but stupidly wrong, especially since you barked and waved hands a lot before you actually managed to make a statement, pathetic.

@GAFFER

http://gafferongames.com/game-physics/integration-basics/

If we use the Euler integrator above instead of solving exactly we get:

t=0: position = 0 velocity = 0
t=1: position = 0 velocity = 10
t=2: position = 10 velocity = 20
t=3: position = 30 velocity = 30
t=4: position = 60 velocity = 40

at t=1 object had velocity 10, yet it did not move, eh? listen to what people are telling you on your own web-page, listen and wake up!

WITH CONSTANT ACCELERATION EULER METHOD IS EXACT, and not only it is exact but all your stupid interpolation only slows down algorithm and introduce bugs, which your later “smooth” with more unnecessary code, hence even more slowing down the algorithm and introducing visual artifacts.

MOST (ALL) GAMES WORK WITH CONSTANT ACCELERATION, ie. games rarely need to simulate exact planetary or electron orbitals, and for everything else EULER CAN DO EXACTLY!!! people, check your sanity, physics text-books, use your calculator and your head, this guy’s ruined many frame-rates with his stupid articles and idiotic algorithms. no interpolation/extrapolation bullshit do you need in your game, unless, again, you are simulating planetary orbitals or subatomic interactions - which i can actually simulate with my “Crazy Algorithm”.

http://www.youtube.com/watch?v=DUNP4z-Vaac

http://www.youtube.com/watch?v=JpI-klsq9nQ

http://www.youtube.com/watch?v=2bIaGw3V6OQ

http://www.youtube.com/watch?v=aYBMrGM6IpM

man, when someone wakes you up…
you will be blushing like a girl, good luck! ..and eat my shorts mr. X(n-1)!

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 17:09

Incorrect:

a) euler integration as applied to position and velocity from acceleration is not exact even under constant acceleration. you can easily verify this by trying it out with a few values and comparing with s = ut+1/2at\^2

b) X*(n-1) is actually correct in the situation where a given packet size X is sent per-player as described in my post

game servers do not typically include state for all players in each packet sent. this is because they culls for player-player visibility and construct a custom packet to send out to each player. in practice, this means that bandwidth usage is much closer to X*(n-1) than X*n*(n-1)

and consider this statement of yours:
@gbLinux

at t=1 object had velocity 10, yet it did not move, eh? listen to what people are telling you on your own web-page, listen and wake up!

i’m guessing you don’t know what explicit vs. semi-implicit euler is then?

http://en.wikipedia.org/wiki/Semi-implicit_Euler_method

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Sep 03, 2009 at 17:33

@gaffer: I recommend you just walk away from the keyboard, think some pretty thoughts, and just leave this thread alone. The guy googles not for general knowledge, but only to find smidgeons that further his useless agenda. It’s like starting an argument over the wonderfulness of potatoes versus turnips. It can be interesting to some, but when someone gets insulting because you prefer potatoes over turnips, it’s just downright stupid at that point to continue…

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 17:39

@alphadog

@gaffer: I recommend you just walk away from the keyboard, think some pretty thoughts, and just leave this thread alone. The guy googles not for general knowledge, but only to find smidgeons that further his useless agenda. It’s like starting an argument over the wonderfulness of potatoes versus turnips. It can be interesting to some, but when someone gets insulting because you prefer potatoes over turnips, it’s just downright stupid at that point to continue…

i agree, it’s probably best to just lock this thread

6f0a333c785da81d479a0f58c2ccb203
0
monjardin 102 Sep 03, 2009 at 19:03

Glenn,

It’s nice to see you on DevMaster; I’m just embarrassed that it is for troll battling. I’ve really enjoyed your networking and networked physics articles.

-Judge

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 03, 2009 at 19:33

@monjardin

Glenn, It’s nice to see you on DevMaster; I’m just embarrassed that it is for troll battling. I’ve really enjoyed your networking and networked physics articles.

thanks, yes - troll battling, not great, sorry about that

just came on here to make sure nobody got led astray by this wildly incorrect statement:
@gbLinux

ultimately, i wish to argue how peer-to-peer model is faster, much faster, than currently popular server-client model… and in fact, it has so many advantages over S/C that it is mindbogglingly unexplainable why in the world no online multiplayer game use it. why, why, why?

but it seems this guy is beyond the reach of rational argument so i’m just going to stop posting :)

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 03, 2009 at 22:52

@gaffer

Incorrect: a) euler integration as applied to position and velocity is not exact even under constant acceleration. you can easily verify this by trying it out with a few values and comparing with s = ut+1/2at\^2

go back to high-school. you are not doing proper integration if you get error with constant or uniform acceleration. free fall, projectile motion, billiard ball collisions… all the earthly physics (except springs, oscillations, harmonics and orbitals) is calculated EXACTLY with pure simple KINEMATIC EQUATIONS everyone knows from high-school, and that’s all you need for any game, ANY GAME.

s = ut+1/2at\^2
is EXACT formula, no errors, check your physics TEXT-BOOK!

if you get errors it’s because you are DOING IT WRONG. but, don’t blame Newton and Euler, it’s your algorithm that sucks, my friend. no need for any kind of integration, you just need INSTANTANEOUS ACCELERATION, then calculate position at the end of the step as usual, like in high-school.

a= (a1+a2)/2
STEP 2: v=a*dt
STEP 3: s=v*dt
—>REPEAT

that’s it… i mean this is basic physics, what is going on… is everyone hypnotized or what?

i’m guessing you don’t know what explicit vs. semi-implicit euler is then? http://en.wikipedia.org/wiki/Semi-implicit_Euler_method

what is wrong with you!!?!?! PHYSICS WITH UNIFORM ACCELERATION IS EXACT, no error!! PEOPLE CHECK YOUR HIGH-SCHOOL BOOKS, this is insanely, unbelievably stupid. implicit/explicit? why? what are you trying to do? what error are you trying to fix???! you do not need it! you only need to integrate basic kinematic equation in you time-step like this:

  1. a= (a1+a2)/2
  2. v= a*dt
  3. s= v*dt
    —>REPEAT

http://courses.ncssm.edu/apb78/iwp/iwp_v1/help/euler.htm
“For non-accelerated and uniformly-accelerated motion, Euler’s method provides an exact solution. “

  • with uniform acceleration there is no need for any kind of interpolation/extrapolation, do you agree, YES/NO?
780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 03, 2009 at 23:02

@alphadog

@gaffer: I recommend you just walk away from the keyboard, think some pretty thoughts, and just leave this thread alone. The guy googles not for general knowledge, but only to find smidgeons that further his useless agenda. It’s like starting an argument over the wonderfulness of potatoes versus turnips. It can be interesting to some, but when someone gets insulting because you prefer potatoes over turnips, it’s just downright stupid at that point to continue…

  • with uniform acceleration there is no need for any kind of interpolation/extrapolation, do you agree, YES/NO?

  • p2p is faster and can support more players than client-is-server approach, having the same connection, just as explained in OP and many times later on in this thread, YES/NO?

1.) does p2p have shorter traversal path than server-based model?

2.) would parallel computing even further speed up latency by getting rid of serial computation server does?

3.) can p2p run on much faster frequency (60HZ and more) due to the nature of uninterrupted, streamed, asynchronous update?

  • was Gaffer actually wrong about bandwidth constraints of p2p vs client-is-server model, and is the answer to these questions above actually “YES”?

i’ve come here to help you,
and all you need is to open your text-book and turn on your calculator.

6f0a333c785da81d479a0f58c2ccb203
0
monjardin 102 Sep 04, 2009 at 02:29

@”Stupid Troll”

s = ut+1/2at\^2
is EXACT formula, no errors, check your physics TEXT-BOOK!

Yes, but that is not what he said. How do you propose integrating that over time without error? To argue that Euler integration is exact on top of this other crap gets my vote for banning you from the forums.

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 04, 2009 at 04:30

@monjardin

Yes, but that is not what he said. How do you propose integrating that over time without error? To argue that Euler integration is exact on top of this other crap gets my vote for banning you from the forums.

http://en.wikipedia.org/wiki/Kinematics

http://en.wikipedia.org/wiki/Uniform_acceleration

//******************************************************
//** KINEMATIC EQUATIONS, 10sec free fall
//**
//**    s = ut + 1/2at^2
//**    v = u + at
//**    s = ((u + v)t)/2
//** 
//******************************************************
#include <stdio.h>
int a= 10;  //gravity or acceleration
int s= 0;   //distance or 'delta distance'
int u= 0;   //initial velocity 
int v= 0;   //final velocity
int dt= 1;  //delta time or FIXED-TIMESTEP
int main(void){
  for(int time=0; time<=10; time+=dt){
      printf("t= %d   position= %d   velocity= %d\n", time, s, v); 

      u= v;
      v= u + a*dt;
      s+= ((u+v)*dt)/2;
  }
}
--- OUTPUT:
t= 0    position= 0     velocity= 0
t= 1    position= 5     velocity= 10
t= 2    position= 20    velocity= 20
t= 3    position= 45    velocity= 30
t= 4    position= 80    velocity= 40
t= 5    position= 125   velocity= 50
t= 6    position= 180   velocity= 60
t= 7    position= 245   velocity= 70
t= 8    position= 320   velocity= 80
t= 9    position= 405   velocity= 90
t= 10   position= 500   velocity= 100

**** Gaffer says:

t=0:          position = 0           velocity = 0
t=1:          position = 0           velocity = 10
t=2:          position = 10          velocity = 20
t=3:          position = 30          velocity = 30
t=4:          position = 60          velocity = 40
t=5:          position = 100         velocity = 50
t=6:          position = 150         velocity = 60
t=7:          position = 210         velocity = 70
t=8:          position = 280         velocity = 80
t=9:          position = 360         velocity = 90
t=10:         position = 450         velocity = 100

…so, he tells you to do something like this:

void integrate(State &state, float t, float dt)
{
   Derivative a = evaluate(state, t, 0.0f, Derivative());
   Derivative b = evaluate(state, t, dt*0.5f, a);
   Derivative c = evaluate(state, t, dt*0.5f, b);
   Derivative d = evaluate(state, t, dt, c);

   const float dxdt = 1.0f/6.0f * (a.dx + 2.0f*(b.dx + c.dx) + d.dx);
   const float dvdt = 1.0f/6.0f * (a.dv + 2.0f*(b.dv + c.dv) + d.dv)

   state.x = state.x + dxdt * dt;
   state.v = state.v + dvdt * dt;
}

whichever you prefer, my dear.

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 04, 2009 at 05:16

yes, except what you just showed us is not an euler integrator - it is a parabolic integrator.

a parabolic integrator is exact for constant acceleration, but is basically useless in real world cases where acceleration changes over the timestep. in these cases it has significantly greater error than RK4.

more info here:

http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=4&t=2912

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 04, 2009 at 06:02

@gaffer

yes, except what you just showed us is not an euler integrator - it is a parabolic integrator.

you may call it “Abaraba’s method” if you like.

now, will you finally take your articles off the internet?

a parabolic integrator is exact for constant acceleration, but is basically useless in real world cases where acceleration changes over the timestep.

first, not just constant, but any UNIFORM acceleration as well. then, i said: “free fall, projectile motion, billiard ball collisions… all the earthly physics, except springs, oscillations, harmonics and orbitals, is calculated EXACTLY with simple KINEMATIC EQUATIONS.” which makes it useful for most, if not, all real-world situations… hahaha, you are reading Wikipedia, eh? DON’T! it has awful articles on this subject.

you couldn’t be more wrong, and to prove it, i dare you to tell me just one game, just one situation where you have changes in acceleration over time-step. surely, if all real-world situations, you say, have changing acceleration over time-step, then it will not be a problem for you to name one or even a couple of them where this acceleration is actually unknown, eh?

gameBoX-Linux

http://www.geocities.com/ze_aks/myos.html

C438b4326fb3baafa606c262e5ae4042
0
gaffer 101 Sep 04, 2009 at 06:28

@gbLinux

you couldn’t be more wrong, and to prove it, i dare you to tell me just one game, just one situation where you have changes in acceleration over time-step. surely, if all real-world situations, you say, have changing acceleration over time-step, then it will not be a problem for you to name one or even a couple of them where this acceleration is actually unknown, eh?

acceleration changes during the timestep in the following situations:

viscous drag
air resistance
friction
buoyancy
springs
stay-upright constraints
car acceleration with torque curve for gears
rocket ship thrust due to non-constant acceleration (eg. mass of ship reducing as fuel is burnt)
acceleration due to gravity in the general case (http://en.wikipedia.org/wiki/Gravitational_acceleration)

checkmate, retard.

780bfad59f53ed55c6db9ac2caae7349
0
gbLinux 101 Sep 04, 2009 at 07:33

@gaffer

acceleration changes during the timestep in the following situations:

viscous drag
air resistance
friction
buoyancy
springs
stay-upright constraints
car acceleration with torque curve for gears
rocket ship thrust due to non-constant acceleration (eg. mass of ship reducing as fuel is burnt)
acceleration due to gravity in the general case (http://en.wikipedia.org/wiki/Gravitational_acceleration)

checkm..

aaaahahahahaaa!

  1. viscous drag
    • No, wrong formula. what formula are you using?
    • what game and situation require this?
  2. air resistance
    • No, wrong formula. what formula are you using?
    • what game and situation require this?
  3. friction
    • No, wrong formula. what formula are you using?
  4. buoyancy
    • No, wrong formula. what formula are you using?
    • what game and situation require this?
  5. springs
    • perhaps, but you will be very unwise not to use Euler integration here.
    • what game and situation require this?
  6. stay-upright constraints
    • No, wrong formula. what formula are you using?
  7. car acceleration with torque curve for gears
    • No, wrong formula. what formula are you using?
    • acceleration is know at all times therefore a=(a1+a2)/2
  8. rocket ship thrust due to non-constant acceleration
    • No, wrong formula. what formula are you using?
  9. acceleration due to gravity in the general case
    • planetary orbitals?
    • what game and situation require this?

pick just one, or all even better… take your best shot!

AND NOW, SURPRISE:
- did you ever actually measure and compare resources used for simple Euler integration VS any of Runge-Kong, Verlet, King-Kutta or similar… would you believe me if i told you how Euler method actually gives more precision per number of calculations. would you believe that, my dear friend?

Aff7a43e35ef2eb397facdf69fd41d0c
0
fs3d 101 Oct 29, 2013 at 15:44

1: Don’t know, don’t care. I’m sure a game out there uses it.

2: Kerbal Space Program, MS Flight Simulator, X-Plane, MS Flight.

(Yes, I skipped 3, but I’ll come back to the common denominator in just a moment…)

4: Any game involving physics on and in water.

5: I’d hazard a gurss that rFactor2 and LFS require this. Any driving simulation, in fact would be wise to implement this in order to increase realism.

7: So torque never changes in an engine, is that what you’re saying? Again, games like LFS, rFactor2 and even some more arcade-y games might model torque changes as you go through a rev range, and simulating it increases realism in such games, especially sought after in those games striving for ultimate realism.

9: Kerbal Space Program, Orbiter, Pioneer, Frontier: Elite 2, Frontier: first Encounters, to name but a few, and while not all of these games have full physics simulation (lagrange points for example), what they do have is a partial simulation where acceleration rates change and need to be accounted for.

KSP in particular has an aerodynamics drag model that requires a lot of physics calculations that will greatly slow down even an i7 Extreme edition CPU as part count increases.

Even if you just transmit a small number of acceleration information over a network to facilitate multiplayer (experimental right now, thanks to the modding community), you’re still looking at a lot of data to transmit, per part, per client. Server/Client will clearly win out here, as trying to sync physics data between multiple peers for such a heavy physics system will be a lot worse than a central server keeping all that data centrally and only receiving updates from clients that only have to send it out once, as opposed to e.g. 30 additional times for 32 players in a peer network.

Common denominator: “No, wrong formula. What formula are you using” is not a valid response. You need to elaborate.

So far, all I’ve seen from you is trolling (ahahahahahaha is not a valid response to a question, neither is typing in all caps as if that will make you any more correct than you are at the moment, to say nothing about referring to people as “dear friend”).

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Oct 29, 2013 at 17:56

fs3d, this thread is 4 years old.