Multiplayer Mobile Game Development Using Augmented Reality
Total Page:16
File Type:pdf, Size:1020Kb
Bachelor Project Czech Technical University in Prague Faculty of Electrical Engineering F3 Department of Control Engineering Multiplayer mobile game development using augmented reality Ondřej Trojan Supervisor: Ing. David Sedláček, Ph.D. Field of study: Cybernetics and Robotics Subfield: System control May 2018 ii Acknowledgements Declaration I would like to thank my family and my I declare that the presented work was de- girlfriend Eva for their intensive support veloped independently and that I have during my studies. Furthermore, I appre- listed all sources of information used ciate my supervisor Ing. David Sedlacek within it in accordance with the methodi- PhD. for willingness, help and given con- cal instructions for observing the ethical sultations. Lastly, I thank the University principles in the preparation of university of Cagliari especially prof. Giuliano Ar- theses. mano and prof. Giorgio Giacinto for their In Prague, 28. May 2018 offer of advice and kind services. iii Abstract Abstrakt This work describes the development of Tato práce popisuje vývoj multiplayerové a multiplayer mobile game build on top mobilní hry postavené na výstupu prove- of the performed analysis and research dené analýzy a výzkumu nové koncepce of the new augmented reality usability použitelnosti rozšířené reality, která vyu- concept with the use of selected state-of- žívá knihovnu vybranou ze srovnání nej- art augmented reality library which is to vyspělejších vývojových nástrojů rozší- be output from their comparative analy- řené reality. Nejlépe hodnocená z pohledu sis. The best evaluated from functional, funkčního, technologického a kvality sle- technological and quality of tracking as- dování je Vuforia, která svým obrazovým pect is Vuforia which with its real-time sledováním v reálném čase otevírá nové target tracking offers new utilisation ap- možnosti použitelnosti. To znamená, že proach. That said, our demonstration náš demonstrační herní projekt sdružuje game design associates Augmented reality, rozšířenou realitu, Unity editor, platformu Unity editor, Android platform and Multi- Android a principy hry pro více hráčů za- player guidelines whereas the implementa- tímco při implementaci používáme vyso- tion leverages high-level network approach koúrovňový síťový přístup od společnosti from Unity together with Vuforia planary Unity společně se sledováním rovinných image tracking. On the top of the realised targetů od Vuforie. Na konec bylo na rea- application, the five people’s testing was lizované aplikaci provedeno testování pěti executed from which factual conclusions osob, z nichž byly získány faktické závěry and observations were obtained. a pozorování. The game is targeted to Android system Hra byla zaměřena na systémové tele- phones with SDK larger than 24. The fony Android s SDK větší než 24. Vývoj development was undertaken in C# using byl proveden v C# pomocí Unity Editoru Unity Editor 2017.4 and Vuforia 7.1 2017.4 a Vuforie 7.1 Keywords: Augmented reality, Vuforia, Klíčová slova: Rozšířená realita, Unity, C#, Mobile application, Vuforia, Unity,C#, Mobilní aplikace, Hra Multiplayer game, Game development, více hráčů, Herní vývoj, Android Android Překlad názvu: Víceuživatelská hra v Supervisor: Ing. David Sedláček, Ph.D. rozšířené realitě na mobilní platformě Department of Computer Graphic and Interaction, Karlovo náměstí 13, Praha 2 iv Contents 1 Introduction 1 4.4 User interface . 26 1.1 Motivation . 1 4.4.1 Trackable movement . 27 1.2 Aim . 1 4.4.2 Menu . 27 1.3 Thesis structure . 1 4.4.3 HUD . 27 2 Augmented reality 3 4.5 Target tracking . 27 2.1 Definition . 3 4.5.1 Marker image selection . 27 2.1.1 Mediated reality . 4 4.5.2 Target detection . 28 2.1.2 Virtual reality . 4 4.5.3 Target synchronization . 29 2.1.3 Mixed reality . 4 5 Implementation 31 2.1.4 Augmented reality . 5 5.1 Development environments . 31 2.2 Function principle . 6 5.1.1 Unity . 31 2.2.1 Marker tracking . 6 5.1.2 Visual studio 2017 . 32 2.2.2 Markerless tracking . 7 5.2 Development tools . 32 2.2.3 Further division. 7 5.2.1 Vuforia target manager . 32 2.3 Problems . 7 5.2.2 .NET tools . 32 2.4 Usability . 7 5.2.3 Unity tools . 34 2.5 Applications . 8 5.2.4 Code version control system . 35 3 Analysis 11 5.3 Architecture . 35 3.1 SDKs . 11 5.3.1 Logic distribution . 35 3.1.1 ARToolKit . 11 5.3.2 Network management . 36 3.1.2 Vuforia . 12 5.3.3 World generation . 37 3.1.3 ARKit . 13 5.3.4 Real-time navigation mesh . 37 3.1.4 ARCore . 14 5.4 Game . 37 3.1.5 Wikitude . 14 5.4.1 Game loop . 38 3.1.6 EasyAR . 15 5.4.2 Gameplay . 40 3.1.7 Maxst . 16 5.5 Third party libraries . 41 3.2 Platforms or hybrid libraries . 17 5.6 Problems . 41 3.3 Comparison of libraries . 17 6 Evaluation 43 3.3.1 Functions . 17 6.1 Requirement verification . 43 3.3.2 Usability . 18 6.1.1 Requirements tests . 45 3.3.3 License . 19 6.2 Usability test. 47 3.4 Quality of tracking . 20 6.2.1 Test plan . 48 3.5 Conclusion . 20 6.2.2 Test results . 49 4 Design 21 6.2.3 Observations . 51 4.1 Objectives . 21 6.3 Future work . 52 4.1.1 Existing game concepts . 21 6.4 Known bugs . 53 4.1.2 Proposed game concept . 21 6.5 Known issues. 53 4.2 Requirements . 23 7 Conclusion 55 4.2.1 Functional requirements . 23 References 57 4.2.2 Performance requirements . 23 4.2.3 Design requirements . 23 A List of Shortcuts 61 4.2.4 Operational requirements . 24 B Content of attached CD 63 4.2.5 Constrains . 24 C Target images 65 4.3 Background . 25 4.3.1 Game predecessor . 25 D Game screenshots 69 v E Project Specification 73 vi Figures Tables 2.1 Realities and their relationships . 3 3.1 Function comparison . 18 2.2 Position of mixed reality in our 3.2 Target platform comparsion . 18 perception [6] . 5 3.3 Development platform comparison 19 2.3 Position of AR and AV at virtual 3.4 License comparsion . 19 continuum . 5 2.4 Pokemon Go . 9 4.1 Functional requirements . 23 2.5 World Lens demonstation . 9 4.2 Performance requirements . 23 2.6 IKEA Place . 10 4.3 Design requirements . 24 4.4 Operational requirements . 24 3.1 AR toolkit logo . 11 4.5 Constrains . 24 3.2 Vuforia logo . 12 4.6 Suggested image attributes . 27 3.3 ARkit logo . 13 3.4 ARCore logo . 14 6.1 Verification matrix . 45 3.5 Wikitude logo . 14 6.2 Test 1 . 46 3.6 EasyAR logo . 15 6.3 Test 2 . 47 3.7 Maxst logo . 16 6.4 Test 3 . 47 6.5 Participants initial survey . 48 4.1 Game control . 22 6.6 Participants devices . 48 4.2 Game layout . 22 6.7 After testing survey . 51 4.3 AR Tank v1.1 . 26 4.4 User interfaces . 26 4.5 Target location raycasting . 29 4.6 Target found/lost flowchart . 30 5.1 Unity Editor . 31 5.2 Vuforia target manager . 32 5.3 Remote actions graph [31] . 36 5.4 NavMesh Surface component . 38 5.5 Lobby . 39 5.6 Gameplay . 40 5.7 Vuforia error . 42 D.1 Menu I . 69 D.2 Menu II . 70 D.3 Deathmatch I . 70 D.4 Deathmatch II . 71 D.5 Cooperative I . 71 D.6 Cooperative II . 72 vii Chapter 1 Introduction 1.1 Motivation In recent years, the augmented reality (AR) technology has a made significant progress toward maturity with many commercial products available and its applications are a contemporary very fashionable topic. While in manufac- turing and marketing business its appliance comes relatively slow the vast majority of today’s utilisation which ordinary user come in touch with are in the entertainment industry. According to an article [1] , revenue generated by the augmented/virtual reality market is expected to reach $108 billion by 2021, with the share of AR likely to reach $83 billion (versus $25 billion for VR). Augmented reality is therefore a huge and rapidly growing market. [2] and is certainly capable of much more than catching Pokémon. That said, the new concepts of utilisation shall be introduced. 1.2 Aim The primary focus of the thesis is to develop a multiplayer mobile game using augmented reality library which is to be determined as a major secondary intention. The third aim of this thesis is to introduce a new game concept build on augmented reality principles. 1.3 Thesis structure The elementary division of the thesis is to analysis and development. Besides that first introduction to problematics of AR is presented then analysis of suitable SDKs is performed followed by the design of the application, its implementation and finally evaluation with completed tests and finally the observations. 1 2 Chapter 2 Augmented reality This chapter explains terminology, problematic of usage and usability of the augmented reality. Lastly it shows some use-cases and presents successful applications. 2.1 Definition For the correct understanding of this principle, the reader ought to recognise the differences between "other" types of realities. In recent years the shortcuts such as AR, VR, MR were often misunderstood and interchanged furthermore due to their similarities and general interconnections, the accessible public explanations are regularly vague, loose and without further context. Despite the ongoing broad debate about terms defining the [Fig. 2.1] gives a decent example of their relationships. I do my best to describe the problematics as clearly as possible. Figure 2.1: Realities and their relationships 3 2.