400 likes | 628 Views
Virtual World Architecture II. Network Architecture. Styles of Networking Architecture. Peer to Peer Client - Server. client. client. client. client. server. client. client. client. client. client. client. Broadcast. Peer to Peer Client - Server. client. client.
E N D
Virtual World Architecture II Network Architecture
Styles of Networking Architecture Peer to Peer Client - Server client client client client server client client client client client client
Broadcast Peer to Peer Client - Server client client client client server client client client client client client
Broadcast Peer to Peer Client - Server client client client client server client client client client client client
Direct Message Peer to Peer Client - Server client client client client server client client client client client client
Direct Message Peer to Peer Client - Server client client client client server client client client client client client
Peer to Peer Pros/Cons • Good when • 2 x latency btw client and server too high for interactivity • No one trusted to be central relay • Bad when • Server has far more bandwidth than others • peer-peer links cannot be established everywhere • one slow peer-peer link slows down progression of simulation
Client/Server Pros/Cons • Good when • Server faster or better distributed than clients • Clients behind firewalls • Insulation • Bad when • Many peer to peer messages must be relayed • Untrusted server • Round trip time too high for application
Examples • Peer to Peer • Starcraft + other RTS’s • Croquet virtual world • Gnutella • Client/Server • Xwing vs Tie fighter • Doom and Quake • Unreal Tournament • Half Life / Garry’s Mod • World of Warcraft + MMORPGs
Another way to slice the cake • Full Disclosure • All input events relayed to all clients • Each client simulates the world using inputs from all players • Need-to-know • All input events sent to server • Server updates each client with only information relevant to that client
How Star Craft works • Full Disclosure • Each clients sends mouse clicks and timestamp to all other clients • If everyone acknowledges receipt in sufficient time, action performed • Otherwise game halted until all can perform action • AI players are deterministic and react to world state • Peer to Peer (8 players) • Once Star Craft game started, all clients are equal • If someone is cheating, they only cheat themselves
How Croquet works • Full disclosure • Clients only send input events to each other • Complex worlds with few actors are simulated in full by each client • Peer to peer (8-16 peers per room) • Save round trip time by sending data directly to each other
How X-wing vs Tie Fighter works • Full disclosure • Clients only send input events to each other • Most (95%) of the craft are AI • simulated on each client • Client/Server (8 players) • If one player acts as host • Can reduce burden of other players • Slightly increase burden of host • Broadband server can host 7 modem players
Full Disclosure Pros/Cons • Good when • # objects predictable w/ full game state > # unpredictable objects • No one is trusted with game state • Total transparency/information awareness • Bad when • num unpredictable objects large • one slow link slows down updates for everyone • Full world state can lead to cheating • Star Craft map hack
How Gnutella Works • Need To Know • Only file requests are relayed around • Full sharing data of network is not available • Peer to Peer (30,000+ peers) • No central server to demand file list from (like napster had) • If a host is inaccessible a pull command can be sent • Malicious (RIAA) hosts can disrupt network effectiveness by relaying false world state
How First Person Shooters Work • Need-to-Know • Portal/Room based maps • Only people in your or adjacent rooms relevant • Server only updates relevant clients • Event timestamps still important • Keep dead folks from shooting • Client/Server (32 players) • Host has high bandwidth, can make relevancy decisions easier • Central connecting point for late-joiners
How MMORPG’s work • Need-to-know • Impossible to update everyone about goings on in a large world • Designers wish to keep some information secret • Treasure locations • Monster health • Locations of players • Client/Server (300 players) • Trusted server(s) with high bandwidth • Everyone connects to a server, some anonymity provided
Need-to-know Pros/Cons • Good when • # unpredictable objects too large for all clients to keep up with changes • Server faster or better distributed than clients • clients behind firewalls • Bad when • Untrusted server/relay • Round trip time too high for application
Analogy to government types • Full Disclosure :: Democracy • Pure democracy -- town hall style • Everyone talks to everyone else • Education critical • Everyone should be informed of all actions • Otherwise can be duped by clients • Check + balance system possible, but not easy • Need-To-Know :: Dictatorship • “ministry of information” • Keeps “true world state” • Broadcasts only needed info • Clients trust the server for world state
Managing large commercial systems • Divide servers into “shards” client client client client US West US East client client client client client client
Managing large commercial systems • Divide shards into “instances” client client US West client client Instance server client
Managing large commercial systems • Many-to-many server:client relationships client client client client server server server client client server server client
Massive Virtual Worlds:Current Efforts • Shards • World of Warcraft • Instances as well • Everquest • Unified World • MUDs • EVE • Second life
Final Location 4 seconds Received Lag 00:28 00:04 Dead Reckoning Sent 00:24
Final Location 4 seconds 4 seconds Sent 00:25 Lag Received Lag Received 00:28 00:04 00:29 00:04 Where Dead Reckoning fails Path Sent 00:24
Final Location 4 seconds 4 seconds Sent 00:25 Lag Received Received Lag 00:28 00:04 00:29 00:04 How to patch dead reckoning path Rewind Simulation To 25 Sent 00:24
Conclusion • Many solution exist to put folks together in a virtual world • Usually tailored to the specification of the world • No one size fits all solution • Networking architectures are only going to get more complex in the future