[GD-General] Adventures in P2P
Brought to you by:
vexxed72
From: <ash...@ya...> - 2003-01-25 00:25:38
|
Hi, First thanks a lot to Mick for the info about Tony Hawk, it makes a lot of sense that due to the game (and lack of interactive objects!) that you can offload the authorative collision detection and gameplay to a server. Not something that would work for a lot of gametypes but if it works, it works! I'm interested in the concept of P2P with one client acting as the server, as Mick and Phil mentioned, with the others running their own logic and physics but bowing to the results obtained from the server-client. I actually coded a very simple P2P application today out of interest, two bouncing balls controllable by keys (there's advantages to homenetworks!). At the moment everything is running lockstepped where all inputs are sent and each client performs the same calculations in the same order at roughly the same time. Works well but not, I'd imagine, something you'd want to run with high latency. So, my next approach (and shout if you see anything wrong!) will be; One client is designated the server Each client sends all non-movement updates (e.g chat, which i don't have but you get the point!) to all other clients All control inputs are sent to the server client which performs physics for the entire world and sends updates out Individual clients run physics based on their input and extrapolated (or interploated if you run a frame or two behind. I can't decide which is best) Individual clients should see next to no difference in their vehicle/player/whatever providing they are not interacted with by other players. All other physical entities are updated based on the results of the server I suppose all clients could send their inputs to all other clients so they could act upon these inputs before bowing to the server, but I'm not sure that'd be much more effective and would increase the bandwidth needed by all clients. The bonus to having one client perform the duties of a server would be that slow or narrow band connections will perform much better than a true P2P structure I'd imagine. There seems to be a lot of information on true Client/Server architectures on the net, but no tmuch devoted to P2P, which is a shame really as I'd imagine with most PS2Online/Xbox Live games they take the P2P approach. Thanks, Andrew phi...@pl... wrote: AFAIK SOCOM is a classic client/server model, with centralised servers, while TMB online is P2P, although only in that one of the clients also acts as a server. Another client can become the server, if the host-client drops out (AKA host migration), I believe that this means that each client is running full physics and logic, but discarding results upon receipt of data from the server. I think the more direct client interaction a game recquires, the worse the network experience generally is. Both of those games suffer on that front, but it could be worse. I once worked on an online 1-on-1 fighting game. Lag's kinda fatal in that environment... Cheers, Phil "Mick West" Sent by: To: gam...@li...urc cc: eforge.net Fax to: Subject: RE: [GD-General] Online Gaming 01/23/2003 03:25 PM Please respond to gamedevlists-general c) it's not really P2P. Clients are deterministic, and ignore what's happening on other clients. One "client" is also a "server", which arbitrates scoring and collision between clients. The server tells the clients when they have been hit, and they fall over. The clients tell the server where they are and what they look like, and the server relay this to the other clients, who just display the other skaters at a few frames before their last known good position, extrapolating only if data fails to arrive in good time. It only works because there is very little interaction between clients (they don't shoot each other, and most of our online games don't rely on skater-skater interactions). Also there are no moving objects in mutli-player games, so we dont have to worry about crates or vehicles. It's pretty specific to our type of game, and is probably not what they use in SOCOM. MIck -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of Andrew Sharpe Sent: Thursday, January 23, 2003 1:43 PM To: gam...@li... Subject: [GD-General] Online Gaming After getting my PS2 network adaptor I've been playing SOCOM online for the past few days. Today though I put on a copy of Tony Hawk4 and was pretty surprised with how it played online. Even on what I'd consider to be laggy servers (200-250 ping) the game seemed remarkably fluent and consistent, i.e no warping players. Although I've played lots of FPS games which usually use a client/server architecture I'd never really played a fast-paced peer-to-peer game and always assumed that on anything other than LAN or fast broadband the game would suffer. Although I'm familiar with how C/S architectures work and how the effects of latency can be compensated for, I've never really given P2P much thought before in terms of how games can achieve a smooth playing experience, or even how their network update is structured. Possibilities I can think of for fast action games using P2P: a) Clients are fully deterministic and perform a lock-stepped update based on inputs from all clients. For instance all clients perform their physics update based on inputs from clients during frame 180 and obtain identical results. Problems: this means that there's a delay between input & response, even on the local client, of around half the ping time to the slowest machine. Not too good I'd imagine on a slow connection. b) All clients send their essential information (position, orientation, etc) and run their physics based on the last, or extrapolated details of other players. Problems: clients may come up with slightly different results due to extrapolated data for other players (e.g the client coliding with another vehicle). There's also the problem of non-player entities in the world, for instance a crate, which may end up with different positions on different machines if some form of correction is not performed to remove errors due to the above problem. There's probably other problems or solutions I've not thought of though! I'd be very interested in comments from people who've implemented P2P solutions in games aimed at the online market though, especially to do with how they handled gameworld physics and physical non-player entities. Very fascinating subject. Thanks, Andrew With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ Gamedevlists-general mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-general Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU7 --------------------------------- With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs |