Turn-Based Strategy Video Game Engine for Mobile Devices
Total Page:16
File Type:pdf, Size:1020Kb
Strategy2D: Turn-based Strategy Video Game Engine for Mobile Devices Author: Javier Calvo Villazón Supervisor: Lluís Solano Albajés November 2014 2 TABLE OF CONTENTS 1. INTRODUCTION ................................................................................................................ 9 2. OBJECTIVES ..................................................................................................................... 10 3. CONTEXT .......................................................................................................................... 11 3.1 Users .......................................................................................................................................... 11 3.2 Players ...................................................................................................................................... 11 3.3 Game Engines ......................................................................................................................... 12 3.3.1 The Game Engine Scene ............................................................................................................ 12 3.3.2 Game Engines Today ................................................................................................................. 16 3.4 Turn-based Strategy Video Games ................................................................................. 18 3.4.1 Turn-based Tactics ..................................................................................................................... 19 3.4.2 Tactical Role Playing Games ................................................................................................... 20 3.4.3 World Strategy ............................................................................................................................. 22 4. THE DEVELOPMENT FRAMEWORK ......................................................................... 24 4.1 Framework Choice ............................................................................................................... 24 4.2 Cocos2d-x ................................................................................................................................ 25 4.2.1 Audio ................................................................................................................................................ 26 4.2.2 User Input ....................................................................................................................................... 27 4.2.3 Graphics .......................................................................................................................................... 29 4.2.4 Setting up the environment .................................................................................................... 37 5. THE ENGINE ..................................................................................................................... 40 5.1 Engine Structure Overview ............................................................................................... 40 5.2 The Strategy2D Module ...................................................................................................... 41 5.2.1 Usage ................................................................................................................................................ 42 5.2.2 Implementation ........................................................................................................................... 42 5.3 View Layer ............................................................................................................................... 46 5.3.1 LayerMap ........................................................................................................................................ 47 5.3.2 ButtonAbility ................................................................................................................................. 58 5.3.3 ButtonRecruit ............................................................................................................................... 59 5.3.4 Platform mobility ........................................................................................................................ 61 5.4 Domain Layer ......................................................................................................................... 65 5.4.1 ActionManager and the Game Flow ..................................................................................... 66 5.4.2 Configurable Elements .............................................................................................................. 78 3 5.4.3 ControllerGame ............................................................................................................................ 96 5.4.4 Path Finding .................................................................................................................................. 98 5.4.5 Callbacks ...................................................................................................................................... 113 5.4.6 Artificial Intelligence .............................................................................................................. 122 5.4.7 Internet Connection and Multiplayer .............................................................................. 122 6. USAGE EXAMPLE ......................................................................................................... 123 6.1 Starting .................................................................................................................................. 123 6.2 Terrain Configuration ...................................................................................................... 124 6.3 Team Configuration .......................................................................................................... 129 6.4 BaseUnit Configuration ................................................................................................... 130 6.4.1 Abilities Configuration ........................................................................................................... 133 6.4.2 Adding BaseUnits to the System ........................................................................................ 140 6.5 BaseBuilding Configuration ........................................................................................... 140 6.6 Path Finding Configuration ............................................................................................ 143 6.7 Turn Handling..................................................................................................................... 144 6.8 Running the Game ............................................................................................................. 146 7. PLANNING AND COSTS .............................................................................................. 148 7.1 Planning ................................................................................................................................ 148 7.2 Costs ....................................................................................................................................... 152 7.2.1 Human Resources .................................................................................................................... 152 7.2.2 Tools .............................................................................................................................................. 153 7.3 Development with the Engine ....................................................................................... 154 8. CONCLUSION ................................................................................................................ 155 8.1 Work for the future ........................................................................................................... 156 9. Bibliography ................................................................................................................ 158 4 TABLE OF FIGURES Figure 1: Quake Logo ......................................................................................................................13 Figure 2: Unreal Engine Logo ......................................................................................................13 Figure 3: Maniac Mansion, the first video game to use SCUMM ....................................14 Figure 4: Planescape Torment, one of the Role Playing Games developed using the Infinity Engine ...................................................................................................................................15 Figure 5: RPG Maker .......................................................................................................................15 Figure 6: Unity Logo ........................................................................................................................16 Figure 7: The Unreal Engine 4 editor .......................................................................................17 Figure 8: Crysis 3, using the CryEngine 3 ...............................................................................17 Figure 9: Corona SDK Logo ..........................................................................................................18 Figure 10: Chess Board ..................................................................................................................18 Figure