MULTIPLAYER NETWORKING with an OPEN SOURCE LIBRARY – Implementation Plan for Hactengine BACHELOR's THESIS | ABSTRACT

MULTIPLAYER NETWORKING with an OPEN SOURCE LIBRARY – Implementation Plan for Hactengine BACHELOR's THESIS | ABSTRACT

Bachelor's thesis Information Technology Digital Media 2016 Johannes Ylönen MULTIPLAYER NETWORKING WITH AN OPEN SOURCE LIBRARY – Implementation plan for HactEngine BACHELOR'S THESIS | ABSTRACT TURKU UNIVERSITY OF APPLIED SCIENCES Information Technology | Digital Media 2016 | 40 Instructors: Reetta Raitoharju;Principal Lecturer, Ph. D. Mika Luimula Johannes Ylönen MULTIPLAYER NETWORKING WITH AN OPEN SOURCE LIBRARY The main purpose of this thesis was to compare open source networking libraries and plan how to integrate the selected library into HactEngine. HactEngine is a cross-platform game engine developed by a start-up company called Indium Games. This thesis was written as research for an actual implementation, which is a part of the Tekes-funded “HactEngine 1.0” project. The thesis describes some of the most fundamental technologies, which are important to understand when developing multiplayer networking. Internet protocols, such as TCP and UDP, are introduced first and then two network topologies, client-server and peer-to-peer, from the perspective of multiplayer game development. The thesis next introduces HactEngine and the technologies used in it; this section covers programming languages and a package system to integrate third party libraries. The most important part of the integration is the interface which is generated from C++ code with the SWIG software development tool. The library to integrate was selected by comparing four different open source libraries. The first two of them, ENet and RakNet, are intended for game development. Boost.Asio and POCO were selected to find a different angle to development, because they were designed for the development of any kind of networked application. RakNet was selected, because it had the most features for multiplayer development and there would have been too much work to use any of the others. The last section of the thesis describes how to integrate RakNet. It demonstrates what the interface could look like and what features are required for minimal functionality of server and client demos. This thesis provides a good list of references for anyone who is interested in multiplayer development. The thesis provides different perspectives to the integration and information, how to add ready-made features to ease the game development. Multiplayer networking is an important part of HactEngine to attract new developers. KEYWORDS: multiplayer, game, engine, SWIG, HactEngine, RakNet OPINNÄYTETYÖ (AMK) | TIIVISTELMÄ TURUN AMMATTIKORKEAKOULU Tietotekniikka | Mediatekniikka 2016 | 40 Ohjaajat: Reetta RaitoHarju; Yliopettaja, FT Mika Luimula Johannes Ylönen MONINPELIN VERKKO-OHJELMOINTI AVOIMEN LÄHDEKOODIN KIRJASTOLLA Opinnäytetyön päätavoite oli vertailla avoimen lähdekoodin verkko-ohjelmointikirjastoja ja suunnitella kirjaston integraatio HactEngineen. HactEngine on Indium Games -yrityksen kehittämä, monella eri alustalla toimiva pelimoottori. Työ kirjoitettiin tutkimuksena varsinaista toetutusta varten, joka on osa Tekesin rahoittamaa HactEngine 1.0 -projektia. Työssä esitellään tärkeimpiä teknologioita, jotka ovat tärkeä perusta verkko-ohjelmoinnille. Niitä tutkittiin erityisesti moninpelikehityksen näkökulmasta. Tärkeimpiä ovat asiakas-palvelin- ja vertaisverkkotopologiat, ne määrittelevät, miten viestejä lähetetään pelaajien välillä. HactEnginen näkökulmasta integrointiin liittyy ohjelmointikieli C++, jolla pelimoottori on kirjoitettu, sekä skirptikieli Lua, jota käytetään pelien ohjelmointiin. Pakettijärjestelmän avulla voidaan lisätä tuki eri kirjastoille. Yksittäinen paketti tarvitsee SWIG-ohjelmistokehitystyökalulla C++-kielellä kirjoitetusta koodista generoidun rajapinnan, jota käytetään skriptikielen avulla. Integroitava kirjasto valittiin vertailemalla neljää erilaista avoimen lähdekoodin kirjastoa, joista kaksi ensimmäistä, ENet ja RakNet, on suunniteltu moninpelien tarpeisiin. Toiset kaksi, Boost.Asio ja POCO, on tarkoitettu yleisesti kaikkeen verkko-ohjelmointiin. Ne valittiin, jotta saataisiin erilainen näkökulma kehitystyöhön. Kirjastoksi valittiin RakNet, koska sillä on eniten ominaisuuksia moninpelien kehitykseen ja muilla kirjastoilla kehittäminen olisi ollut liian työlästä. Tärkeimpänä tuloksena saatiin suunnitelma integraatiosta. Asiakas- ja palvelin- esimerkkikoodeissa esitellään, miltä asiakasrajapinta voisi näyttää ja mitä ominaisuuksia palvelin tarvitsee. Opinnäytetyöhön löydettiin hyviä kirjalähteitä moninpelien kehitykseen, sekä se antaa erilaisia näkökulmia, miten kirjaston integraatio kannattaa tehdä ja minkälaisilla valmiilla ominaisuuksilla voi helpottaa pelinkehittäjien työtä. ASIASANAT: moninpelit, pelimoottori, SWIG, HactEngine, RakNet CONTENT 1 INTRODUCTION...............................................................................................6 2 MULTIPLAYER NETWORKING TECHNOLOGIES..........................................8 2.1 Internet Protocols............................................................................................8 2.1.1 Internet Protocol (IP)............................................................................9 2.1.2 Transmission Control Protocol (TCP)................................................10 2.1.3 User Datagram Protocol (UDP)..........................................................11 2.1.4 Network Address Translation (NAT)...................................................11 2.2 Multiplayer Networking.................................................................................12 2.2.1 Peer-to-Peer Topology.......................................................................12 2.2.2 Client-Server Topology.......................................................................14 3 HACTENGINE.................................................................................................17 3.1 C++...............................................................................................................17 3.2 Lua................................................................................................................18 3.3 SWIG.............................................................................................................18 3.4 Packages......................................................................................................21 4 COMPARISON OF THE OPEN SOURCE LIBRARIES..................................22 4.1 Criteria...........................................................................................................23 4.2 Choosing Libraries........................................................................................23 4.3 RakNet..........................................................................................................24 4.3.1 History................................................................................................24 4.3.2 Development and Community............................................................25 4.3.3 Features.............................................................................................25 4.4 ENet..............................................................................................................26 4.4.1 Development and Community............................................................26 4.4.2 Features.............................................................................................26 4.5 Boost.Asio.....................................................................................................27 4.6 POCO............................................................................................................28 4.7 The Comparison...........................................................................................28 5 INTEGRATING RAKNET................................................................................30 5.1 Server............................................................................................................30 5.1.1 Infrastructure......................................................................................31 5.1.2 Features.............................................................................................31 5.2 Client.............................................................................................................33 5.2.1 Features.............................................................................................33 5.2.2 Interface.............................................................................................35 6 CONCLUSION.................................................................................................37 APPENDICES Appendix 1. RakNet server demo code (raknetserver.cpp) Appendix 2. RakNet client demo code (client.h) Appendix 3. RakNet client demo code (client.cpp) Appendix 4. RakNet client demo code (raknetclient.cpp) Appendix 5. RakNet client demo code (commondefines.h) Appendix 6. RakNet client demo code (upnphelper.h) PICTURES Picture 1. OSI Reference Model and Internet Protocol Suite 11 Picture 2. A peer-to-peer network 15 Picture 3. Client-server network 17 Picture 4. Lua C API example 21 Picture 5. A part of the swig_hact.i file in HactEngine 22 6 1 INTRODUCTION A nerd playing games alone has become an ancient stereotype, when playing games online with friends or strangers is more popular than ever and is one of the fastest growing areas of the gaming industry. MMO (Massively Multiplayer Online Game), one category of multiplayer gaming, takes alone 21% of all revenue in global games market (Newzoo 2013). Growth of social mobile games and popularity of electronic

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    72 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us