12.07.2015 Views

Implementation of a Peer-to-Peer Multiplayer Game with ... - DVS

Implementation of a Peer-to-Peer Multiplayer Game with ... - DVS

Implementation of a Peer-to-Peer Multiplayer Game with ... - DVS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

administrative data. For short gaming sessions where persistent s<strong>to</strong>rage is not necessary, servers may becompletely omitted.<strong>Game</strong> StateThe paper’s target games are role-playing games (RPG) like EverQuest and Ultima Online. <strong>Game</strong> state inthose games consists <strong>of</strong> three types <strong>of</strong> data. First, there is the terrain, i.e., the immutable part <strong>of</strong> the gameworld. It does not need <strong>to</strong> be updated and is usuallay installed <strong>with</strong> the game client. Second, there aremutable objects like items that players may interact <strong>with</strong> or NPCs (non player characters). These objectshave some state and are associated <strong>with</strong> game rules. And finally, there are the player’s avatars. Actions<strong>of</strong> players are categorized as position change, player-object interaction and player-player interaction.The world is split in<strong>to</strong> regions whose size is based on the sensing range <strong>of</strong> the players. Doing so,interest management is applied by distributing information only <strong>with</strong>in a region. Thus, each regionforms an interest group. Player’s positions are multicast at a fixed interval <strong>to</strong> all other players <strong>with</strong>inthe region. Dead reckoning [1] may be applied on application layer when messages are lost or delayed.Each object (e.g., item) is assigned <strong>to</strong> a coordina<strong>to</strong>r, a node that is responsible for resolving conflictswhen the object is manipulated. Updates <strong>to</strong> objects are multicast <strong>to</strong> all players in the containing region.Distribution on a <strong>Peer</strong>-<strong>to</strong>-<strong>Peer</strong> OverlayThe system is based on the Pastry DHT. Each region is assigned an ID and mapped in<strong>to</strong> the DHT. Thenode responsible for a region’s ID is responsible for that region. To archive a better load balancing whencertain regions are under heavy load, the authors propose <strong>to</strong> create a different region IDs for each objecttype. Cheating is prevented by the (pseudo-)random mapping <strong>of</strong> regions <strong>to</strong> coordina<strong>to</strong>rs, as this makesit unlikely that the person, who is interested in illegally manipulating an object, also has control <strong>of</strong> it.Fault <strong>to</strong>lerance is achieved by replicating the game state objects over several nodes, assuming thatnode failures are independent and rather infrequent and that the pastry routing algorithm itself will<strong>to</strong>lerate failures, always routing messages <strong>to</strong> the proper destination. The basic goal is <strong>to</strong> keep alwaysone replica up besides the primary copy. The primary copy <strong>of</strong> an object (whose owning node is thecoordina<strong>to</strong>r for that object) is on the node closest <strong>to</strong> the object’s ID. The replica is s<strong>to</strong>red at the node<strong>with</strong> second closest ID, so that in case <strong>of</strong> a failure <strong>of</strong> the primary copy, the replica can immediately takeover. When a new node joins which has an ID that is closer <strong>to</strong> an object than the node that has theprimary copy, the object is replicated <strong>to</strong> the new node. While replicating, the previously primary nodeforwards all messages related <strong>to</strong> the object <strong>to</strong> the new node, which afterwards applies all updates andtakes over.Failures are detected using regular game events instead <strong>of</strong> explicitly checking for peers for being alive.The authors state that there is a window <strong>of</strong> vulnerability between the time <strong>of</strong> a failure and its detectionand recovery. But they claim the problem <strong>of</strong> network partitions is worse. Network partition means thatthere are two (or more) coordina<strong>to</strong>rs for the same object, immediately leading <strong>to</strong> inconsistencies. Theauthors citate Brewer’s ‘CAP conjecture’ [14], stating that a distributed system can only have two <strong>of</strong>the tree properties consistency, availability and <strong>to</strong>lerance <strong>of</strong> network partitions. The authors’ proposedsolution is <strong>to</strong> ‘bless’ all coordina<strong>to</strong>rs by a central server who knows <strong>of</strong> all coordina<strong>to</strong>rs, thus sacrificingavailability.<strong>Implementation</strong>The implementation for evaluation <strong>of</strong> the presented system is SimMud, a Java application using FreePastry,simulating a simple world <strong>with</strong> food objects and players who can move, eat and fight against each18 2.3 <strong>Peer</strong>-<strong>to</strong>-<strong>Peer</strong> Gaming

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!