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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DHT’s key space. A comparison <strong>of</strong> the two DHTs shows that the range-queriable DHT has a slightlyhigher latency but a lower bandwidth consumption than the traditional DHT. Additionally, the formerhas a better load balancing.The discovery latency is reduced using the spatial and temporal properties <strong>of</strong> the game. Players (usually)move more or less constantly <strong>with</strong>in the game world. Using this property, Colyseus au<strong>to</strong>maticallyexpands the area <strong>of</strong> interest <strong>to</strong>wards the direction <strong>of</strong> movement, performing speculative pre-fetching <strong>of</strong>objects. The amount <strong>of</strong> expansion depends on the player’s velocity, always pre-fetching for a certainamount <strong>of</strong> time. This amount <strong>of</strong> time is a parameter which needs <strong>to</strong> be adjusted <strong>to</strong> be high enough <strong>to</strong>have an acceptable view consistency but not <strong>to</strong>o high <strong>to</strong> avoid a lot <strong>of</strong> unnecessary pre-fetching (e.g.,caused by the player changing direction). For further optimization, Colyseus implements a local subscriptioncache <strong>to</strong> avoid <strong>to</strong>o frequent subscription updates and an optional aggregation filter mergingoverlapping subscriptions. Furthermore, not only the subscriptions but also the publications are s<strong>to</strong>redin the DHT for a certain time. This allows for immediate responses <strong>to</strong> new subscriptions <strong>with</strong>out a delaytill the next publication, also making longer publication intervals possible.<strong>Implementation</strong> and EvaluationFor evaluation <strong>with</strong> a real game, Quake II was modified <strong>to</strong> use Colyseus. Alternatively, unmodified QuakeII clients may connect <strong>to</strong> the distributed servers so that the system may either be used as a full peer-<strong>to</strong>peergame or using a distributed server community. The Quake II objects are sent using field-wise diffs,resulting in an average diff size <strong>of</strong> 145 bytes. The original Quake II server-client messages have anaverage size <strong>of</strong> only 22 bytes.In small scales, the generated traffic <strong>with</strong> colyseus is higher than the traffic for simple broadcasting.But <strong>with</strong> an increasing number <strong>of</strong> nodes, Colyseus quickly outperforms broadcasting, and the traffic load<strong>of</strong> each node is an order <strong>of</strong> magnitude lower than the server’s load in client-server mode. The analysis<strong>of</strong> view consistency shows that half the replicas take less than 100ms <strong>to</strong> update and only 1% takes morethan 400ms. Of the 23 remote replicas a node requires in average for a 40-player game, it has thecomplete set in about 40% <strong>of</strong> the time. After waiting up <strong>to</strong> 100ms for a replica, 60% <strong>of</strong> the replicas areavailable in avarage, and waiting up <strong>to</strong> 400ms increases the proportion <strong>of</strong> available replicas <strong>to</strong> 80%.DiscussionColyseus focuses on object management for fast first person shooter games, introducing techniques compensatingthe problem <strong>of</strong> relatively slow DHT operations. Performing optimistic updates, it also aimsfor low delays, providing only weak consistency. As the system relies on spatial and temporal locality,e.g., for its prefetching mechanisms, it is only suitable for games where players have a limited range <strong>of</strong>perception and interaction. Real-time strategy games (RTS), for instance, usually require the player <strong>to</strong>see large parts <strong>of</strong> the game map, in which case Colyseus’ mechanisms will not work.For first person shoothers though, Colyseus shows a good performance. Being able <strong>to</strong> run in full peer<strong>to</strong>-peermode or as a cluster <strong>of</strong> distributed servers, the system is flexible for different purposes. Theevaluation using a modification <strong>of</strong> an existing game can be taken seriously, but lacks a user study.2.3.4 DonnybrookDonnybrook [3] was published by Bharambe et al. in 2008, and thus may be seen as Colyseus’ successor.But in fact, it has a different focus. While Colyseus deals <strong>with</strong> object management, Donnybrook concentrateson player update management. It continues the optimization <strong>of</strong> the players’ interests, trying22 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!