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.

6 ConclusionThe core task <strong>of</strong> this work was the development <strong>of</strong> a simple client-server and, more importantly, a peer<strong>to</strong>-peernetwork engine for the game Planet π4. Surrounding that <strong>to</strong>pic, a set <strong>of</strong> other tasks was tackled,all <strong>of</strong> them providing support for the core networking <strong>to</strong>pic.The completely reworked network architecture <strong>of</strong> Planet π4 now allows for a simple replacement <strong>of</strong>the network engine. Two rather opposite networking approaches, a group-based client-server systemand an unstructured peer-<strong>to</strong>-peer system, were both successfully applied <strong>to</strong> that architecture, proving itsflexibility. The network system is fully pluggable, thus it is even possible <strong>to</strong> select/switch the networkengine at runtime.Other parts <strong>of</strong> the game were also made exchangeable. Most importantly, the main loop can bereplaced, particularly allowing <strong>to</strong> run the complete game in an discrete-event simula<strong>to</strong>r. This unites thetwo basically contradicting approaches <strong>of</strong> the busy loop that games usually run and the event basedsimula<strong>to</strong>r’s main loop that is not under control <strong>of</strong> the application which is running in the simula<strong>to</strong>r. Fordecoupling the various game components, the internal eventing infrastructure was extended and is nowused as the central communication point between components.Since all current and future networking models have <strong>to</strong> be evaluated, there is the need for workloadgeneration. The most obvious way <strong>of</strong> workload generation is just letting human players play the game.But that is <strong>to</strong>o time-consuming in many cases, especially for large numbers <strong>of</strong> players. Thus, an AIcomponent was developed, providing a bot player that plays the game according <strong>to</strong> simple rules. Thesimple bots do not generate a completely realistic workload, but the nons<strong>to</strong>p best-effort activity generatesmore workload in average than a human player would do, so it can be seen as a worst-case scenario.Being the first cus<strong>to</strong>mer <strong>of</strong> CUSP, important feedback was provided, especially in CUSP’s late developmentand testing phase. Particularly the peer-<strong>to</strong>-peer networking implementation represents a typicaluse case that CUSP aims at. Also, the development and evaluation <strong>of</strong> the C++ bindings for CUSP are animportant contribution, since only a small fraction <strong>of</strong> applications which may potentially use CUSP arewritten in Standard ML. The C++ API is thus assumingly <strong>to</strong> become more relevant for external applicationsthan the original Standard ML API. The evaluation has shown that CUSP is a powerful and reliablepro<strong>to</strong>col but introduces some challenges particularly for the C++ programmer.Three variants <strong>of</strong> networking code were implemented and evaluated. While the two client-serverversions are similar in their functionality and primarily comparing the applicability <strong>of</strong> TCP and CUSP, thepeer-<strong>to</strong>-peer version introduces a new concept. The CUSP client-server and peer-<strong>to</strong>-peer implementationswere evaluated concerning scalability <strong>with</strong> a focus on the traffic requirements. Although the absolutevalues are likely <strong>to</strong> change <strong>with</strong> further pro<strong>to</strong>col optimization, the trends are definitely meaningful.Those show that the client-server version is strongly limited by the server capabilities. The generatedtraffic grows quadratic <strong>with</strong> the number <strong>of</strong> players. This behavior can also be observed in the peer-<strong>to</strong>peerversion, but on a lower level. And, more importantly, the peer traffic (almost) only depends on thenumber <strong>of</strong> players in the vision range; all players outside the vision range do not affect the peer at allexcept for the maximum <strong>of</strong> eight sensor nodes. Thus, the pSense implementation has shown <strong>to</strong> be inprinciple qualified for massively multiplayer games <strong>of</strong> any size as long as the player density is rather low.The peer-<strong>to</strong>-peer version <strong>of</strong> the game is able <strong>to</strong> run in the CUSP simula<strong>to</strong>r, allowing for a simplifiedand more deterministic analysis on certain aspects. The number <strong>of</strong> players is bounded by the availablememory and CPU power (or time constraints). Up <strong>to</strong> 128 players were successfully simulated; 4GB <strong>of</strong>RAM, the typical memory configuration <strong>of</strong> <strong>to</strong>day’s desk<strong>to</strong>p PCs, is enough for that. Nevertheless, it isdesirable <strong>to</strong> optimize further for simulation performance in order <strong>to</strong> achieve greater player numbers andstill acceptable simulation times.6 Conclusion 83

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

Saved successfully!

Ooh no, something went wrong!