
Development of online game prototype with Unity engine Multiplayer solutions Timo Jetsonen Bachelor’s thesis May 2016 Technology, Communication and Transport Degree Programme in Software Engineering Description Author(s) Type of publication Date Jetsonen, Timo Bachelor’s thesis May 2016 Language of publication: English Number of pages Permission for web publi- 100 cation: x Title of publication Development of online game prototype with Unity engine Multiplayer solutions Degree programme Software Engineering Supervisor(s) Nelimarkka, Paavo and Hämäläinen Raija Assigned by - Abstract The objective was to create networking functionalities for a game prototype called Quan- tum Knight, by using two distinct implementation methods with the Unity Engine and com- paring them against each other. The implementation methods under investigation were Unity Engine’s own Unity Network- ing and one of Unity’s most popular third party networking plugins: Photon Unity Network- ing. The goal was to achieve at least nearly similar operational functionality with both im- plementation variants and to demonstrate hands-on how the functionalities were actual- ized. The project itself, the thesis subjects not included, was carried out with Timo Holo- painen and it was not assigned by an outside employer. As a result, two separate properly functioning lobby systems and gameplay mechanic im- plementations were accomplished. Firstly, they were evaluated by means of ten distinct criteria and given points based on the author’s experience, after which the acquired statis- tical network data was analyzed. Due to tool constraints, the only comparable and trust- worthy attribute obtainable from both Unity Profiler and Photon Stats Gui was the round trip time. The point distribution resulted in a tie, indicating that both implementation methods excel in different key areas, while Unity Networking had overall higher round trip times. This presumably originated from the fact how the Unity servers are globally situated, or that the UNet packages being sent are considerably larger in size. Ultimately, the Photon imple- mentation was chosen by the team to be in the final build of the prototype. The choice re- sulted directly from the reality of Photon’s servers being currently more reliable along with its final outcome being more refined. Keywords/tags (subjects) Unity, Multiplayer, C#, Plugin, UNet, Photon, Prototype Miscellaneous Number of pages in Appendices: 48 Kuvailulehti Tekijä(t) Julkaisun laji Päivämäärä Jetsonen, Timo Opinnäytetyö, AMK Toukokuu 2016 Sivumäärä Julkaisun kieli 100 Englanti Verkkojulkaisulupa myönnetty: x Työn nimi Development of an online game prototype with Unity engine Multiplayer solutions Tutkinto-ohjelma Ohjelmistotekniikan koulutusohjelma Työn ohjaaja(t) Nelimarkka, Paavo ja Hämäläinen, Raija Toimeksiantaja(t) - Tiivistelmä Työn tavoitteena oli toteuttaa verkkopeliominaisuudet Quantum Knight-peliprototyyppiä varten Unity-pelimoottorilla kahta erilaista toteutustapaa käyttäen sekä verrata niitä toi- siinsa. Tarkasteltavana olevat toteutustavat olivat Unity-pelimoottorin oma Unity Networ- king sekä yksi Unityn suosituimmista kolmannen osapuolen verkko-ominaisuuksiin keskit- tyvistä liitännäisistä: Photon Unity Networking. Päämääränä oli saavuttaa lähestulkoon sa- mankaltainen toiminnollisuus molemmilla toteutustavoilla sekä havainnollistaa, kuinka ky- seiset toiminnollisuudet todellisuudessa saatiin aikaan. Projekti toteutettiin ilman ulkopuo- lista toimeksiantajaa. Työn konkreettisena tuloksena saatiin aikaan kaksi erillistä, asianmukaisesti toimivaa mo- ninpeliaulajärjestelmää sekä pelimekaanillista toteutusta. Näitä verrattiin toisiinsa kymme- neen erilaiseen arvosteluperusteeseen pohjautuen ja niiden pohjalta pisteyttäen, minkä jälkeen hankitut tilastolliset tiedot analysoitiin. Mittaustyökalujen, eli Unity Profilerin sekä Photon Stats Guin, rajoittuneisuudesta johtuen ainut verrattavissa oleva sekä luotettava vertailukohde oli edestakainen viive (englanniksi round trip time). Vertailussa annetut pisteet jakautuivat lopputuloksena tasan molempien toteutustapojen välille, mikä puolestaan viittaa siihen, että molemmat toteutustavat kunnostautuvat eri osa-alueilla. UNet-toteutuksessa puolestaan mitattiin kaiken kaikkiaan korkeammat edes- takaiset viiveet. Tämän todettiin johtuvat todennäköisesti siitä, miten Unityn serverit on globaalisti sijoitettu tai vaihtoehtoisesti siitä, että sen lähettämät paketit ovat kooltaan suurempia. Photon toteutus valittiin loppujen lopuksi prototyypin viimeiseen versioon sen viimeistellymmän lopputuloksen sekä vakaampien serverien vuoksi. Avainsanat (asiasanat) Unity, Moninpeli, C#, Liitännäinen, UNet, Photon, Prototyyppi Muut tiedot Liitteiden sivumäärä: 48 1 Contents 1 Introduction ............................................................................................................ 7 2 Unity ....................................................................................................................... 9 2.1 What is Unity? ............................................................................................. 9 2.2 Unity Editor ................................................................................................ 10 2.2.1 Toolbar .................................................................................................. 11 2.2.2 Scene view ............................................................................................ 12 2.2.3 Game view ............................................................................................ 13 2.2.4 Hierarchy............................................................................................... 14 2.2.5 Project browser .................................................................................... 15 2.2.6 Inspector ............................................................................................... 16 2.2.7 Build Settings ........................................................................................ 17 2.3 Main operating principles of Unity............................................................ 18 2.3.1 Component ........................................................................................... 18 2.3.2 GameObject .......................................................................................... 19 2.3.3 Asset ..................................................................................................... 19 2.3.4 Prefab .................................................................................................... 20 2.3.5 Layer ..................................................................................................... 21 2.3.6 Tag ........................................................................................................ 21 2.3.7 Scene ..................................................................................................... 22 2.4 Scripting ..................................................................................................... 22 2.5 Asset Store ................................................................................................. 25 3 Multiplayer solutions for Unity game development ............................................ 26 3.1 Unity Networking ...................................................................................... 26 3.1.1 The High Level API ................................................................................ 26 3.1.2 NetworkBehaviour ................................................................................ 27 2 3.1.3 NetworkManager.................................................................................. 28 3.1.4 NetworkLobbyManager ........................................................................ 30 3.1.5 Essential Networking Components ...................................................... 33 3.1.6 Objects and authority in UNet .............................................................. 35 3.1.7 State Synchronization ........................................................................... 36 3.1.8 Remote Actions .................................................................................... 38 3.1.9 Internet services ................................................................................... 39 3.2 Photon Unity Networking .......................................................................... 40 3.2.1 Feature overview .................................................................................. 40 3.2.2 Initial setup ........................................................................................... 41 3.2.3 Essential components ........................................................................... 43 3.2.4 Matchmaking ........................................................................................ 45 3.2.5 Instantiation .......................................................................................... 45 3.2.6 Player Authority .................................................................................... 47 3.2.7 State synchronization ........................................................................... 47 3.2.8 RPCs and RaiseEvent ............................................................................. 48 3.3 Other plugins ............................................................................................. 50 4 Project Quantum Knight ....................................................................................... 50 4.1 Game story ...............................................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages151 Page
-
File Size-