Gravity Evolved
Total Page:16
File Type:pdf, Size:1020Kb
Senior Project Spring 2013 By Clark DuVall Table of Contents Acknowledgements....................................................................................................................................3 Introduction................................................................................................................................................4 The Game ± Gravity Evolved....................................................................................................................5 What It Is...............................................................................................................................................5 How It Was Made..................................................................................................................................5 Related Work.............................................................................................................................................7 Orbits/Orbits HD ± rSchulet Software [5].............................................................................................7 Gravity 2.0 ± Clark DuVall [6].............................................................................................................7 Comparison...........................................................................................................................................8 Design......................................................................................................................................................10 Fireables ± Dependency Injection.......................................................................................................10 The Problem...................................................................................................................................10 The Solution...................................................................................................................................10 JSON Configuration Files ± Separate Data and Logic........................................................................11 The Problem...................................................................................................................................11 The Solution...................................................................................................................................11 Platform Dependent Code ± Delegates...............................................................................................11 The Problem...................................................................................................................................11 The Solution...................................................................................................................................12 Asynchronous Function Calls ± Callbacks..........................................................................................12 The Problem...................................................................................................................................12 The Solution...................................................................................................................................13 Game Events ± Notifications and Observers.......................................................................................13 The Problem...................................................................................................................................13 The Solution...................................................................................................................................14 Game Mode Constraints ± Referees....................................................................................................14 The Problem...................................................................................................................................14 The Solution...................................................................................................................................14 Results......................................................................................................................................................16 Features...............................................................................................................................................16 Screenshots..........................................................................................................................................17 Sandbox Mode................................................................................................................................17 Battle Mode....................................................................................................................................18 Future Work.............................................................................................................................................21 Cloud Storage of Solar Systems..........................................................................................................21 Ranking System...................................................................................................................................21 Multiple Battle Solar Systems.............................................................................................................21 Optimizations......................................................................................................................................22 References................................................................................................................................................23 Acknowledgements Senior Project Advisor Professor Zoë Wood Programmer Clark DuVall Graphic Designer Josh Schiesl Introduction The mobile gaming industry has exploded in popularity in the last few years. In the year 2000 there were 20 million mobile gamers in the United States. In 2013, there are over two hundred million mobile gamers in the United States, an incredible 955% growth [1]. Almost any developer has access to tools that can be used to create a game for popular mobile platforms such as iOS and Android, meaning that even independent developers can access this huge market. Creating a mobile game presents many challenges that do not apply or are greatly reduced when creating a standard video game. Mobile devices have much less RAM and CPU power than desktop or laptop computers, which constrains the assets used and computation on a mobile device. Current mobile devices usually receive user input through a touch screen, which presents a different form of interaction than is handled in standard video games. Mobile devices also come in all shapes and sizes, which means mobile games have to deal with varying screen sizes. This combination of factors makes creating a mobile game an interesting and challenging experience for the developer. The Game – Gravity Evolved What It Is Because of the challenges and opportunities of the mobile game industry, I decided to create the game Gravity Evolved with the help of graphic designer Josh Schiesl. Gravity Evolved is a galactic physics game. In the game, users are able to create their own solar system, placing planets and weapons. Planets and weapons can be customized, changing the size of the planets and the firing power of the weapons. Players are able to play in two different modes, Sandbox and Battle. In Sandbox mode, the user can create a solar system and fire the weapons in the solar system. The gravitational physics and collisions of the planets and projectiles are then simulated. The main part of the game is Battle mode. In Battle mode, players start with a set amount of money. They use this money to build up their solar system, adding and upgrading planets and weapons. Money is earned by fighting other solar systems, which increase in difficulty. The battles are real-time, with the two solar systems continuously firing. The player is able to readjust the weapons during the battle, choosing how to best destroy the opponent. Players are able to choose from 45 different weapon types and three different planet types, allowing them to use various strategies to make the most powerful solar system. How It Was Made Gravity Evolved is written entirely in C++ using Marmalade SDK [2]. Marmalade SDK is a tool allowing cross-platform mobile applications to be written using C++. From a single codebase, these applications can then be compiled to run natively on any of the current major mobile platforms, including iOS, Android, BlackBerry, and Windows Phone. Although Marmalade has obvious benefits such as cross-platform support and the ability to use C++, there are also some drawbacks. For one, it is much more difficult to create user interface elements with Marmalade than with the native iOS or Android development environments. Some native features are also not available by default in Marmalade. The biggest reason why I chose Marmalade was because it allowed me to develop high performance iOS apps without using an Apple computer. Gravity Evolved uses the Box2D physics library for all physics calculations [3]. It also uses much of the Boost C++ libraries, with heavy use of the Boost smart pointers [4]. Related Work Orbits/Orbits HD ± rSchulet Software [5] Orbits is a realistic solar system simulation game for iOS. In this game, users are able to change the properties of planets including the mass, velocity, and others. Time can be sped up or slowed down to