A Distributed Game Engine for Mobile Games on the Android Platform
Total Page:16
File Type:pdf, Size:1020Kb
A Distributed Game Engine for Mobile Games on the Android Platform Davide Gadia1, Dario Maggiorini1, Davide Puopolo2, Laura Anna Ripamonti1 and Luca Ziliani2 Department of Computer Science, University of Milan, via Comelico 39, I-20135 Milano, Italy Keywords: Game Engines, Game Development, Mobile Platforms, Distributed Systems. Abstract: In the last few years we have witnessed a tremendous change in the way game developers are required to deal with software production. We moved from small groups building the application ground-up to large coordinated teams with hierarchical organisation. To support this transformation, game developers are now using integrated development and execution environments called game engines. Among all possible gaming platforms, mobile ones are proving to be a challenging ground due to their intrinsic requirement for game engines to deploy the final application on a distributed system. In this paper we discuss about requirements for next-generation game engines for mobile devices. In particular, we propose a variation of the standard approach for game engines architecture pushing from a monolithic architecture toward a distributed one. In our solution, the mobile game engine becomes modular and lower the distinction between client and server side. 1 INTRODUCTION alities. A variable portion of the runtime is usually linked inside the game and distributed along with the In these last years, the way developers implement binary executable. As a matter of fact, deployment video games is undergoing a tremendous change. If for different platforms requires to embed specific run- we look to historical blockbusters for home entertain- times wrapping the same game content. The game ment such as Pitfall!, Tetris, and Prince of Persia we content is made up of rules and assets created by de- can see the name of a single developer. As a matter velopers and artists, which get managed via the tool of fact, in the ’80s, all aspects of video game develop- suite component. When developing a game for a mo- ment were usually managed by a single person or, at bile device, the aforementioned architecture may re- best, a very small group. Today, with the evolution of ally become an hindrance since we have a distributed the entertainment market and the rise of projects with platform as target environment. seven (or eight) figures budget, this situation calls for Mobile applications in general, and games in par- a drastically different approach. Video game develop- ticular, have an intrinsic requirement to be deployed ment is now a distributed collaborative effort involv- on a distributed system due to the always-online na- ing tens to hundreds of programmers. This increasing ture of mobile devices and a strong prerequisite to complexity of teams organisation and the tremendous play (or, at least, interact) online with other players. growth of projects size force development teams to or- Developing any kind of application for a distributed ganise themselves in a hierarchical way and to adopt environment involves managing data transmission be- software engineering practices enforcing string code tween heterogeneous platforms and monitoring real- reusability. As a result, modern video games are im- time operations to prevent failures due to undelivered plemented by means of software environments called or delayed packets. In particular, as also discussed game engines. in (Festa et al., 2017), distributed debugging is a com- A game engine, as largely discussed in literature, plex problem due to the synchronisation required be- is a complex framework made of two main building tween network nodes to correctly reconstruct the se- blocks: a tool suite and a runtime component. In par- quence of events leading to a malfunctioning feature. ticular, the runtime component assembles together all With the increasing presence of distributed appli- the internal libraries required for hardware abstrac- cations and frameworks in online services (i.e., cloud tion and provides services for game-specific function- computing), the constraints introduced by mobile de- Gadia D., Maggiorini D., Puopolo D., Ripamonti L. and Ziliani L. A Distributed Game Engine for Mobile Games on the Android Platform. DOI: 10.5220/0006508601420149 In Proceedings of the International Conference on Computer-Human Interaction Research and Applications (CHIRA 2017), pages 142-149 ISBN: 978-989-758-267-7 Copyright c 2017 by SCITEPRESS – Science and Technology Publications, Lda. All rights reserved vices are now spreading to all other platforms. Un- 2 RELATED WORK der these lenses, current research faces an important task: to understand if classical client-server architec- In the past, a fair number of scientific contributions tures for games are up to the challenge or something has been devoted to improve the architecture of game more modular and flexible is required. We strongly engines. Nevertheless, at the time of this writing and believe that the classical approach will not be enough to the best of our knowledge, only a very limited num- for the next generation of game developers, for two ber of papers are specifically addressing issues related reasons. The first reason is poor scalability. As a mat- to scalability and cross-platform portability. ter of fact, modern games are pushing to involve thou- A significant share of existing literature seems to sands to millions of players in Massively Multiplayer be focused on optimising specific aspects or services, Online Games (MMOGs). The resources used by an such as 3D graphics (e.g., (Cheah and Ng, 2005)) or MMOG must be shared among users and scale in a physics (e.g., (Mulley, 2013; Coumans, 2006; Mag- seamless way with the offered workload. If a stan- giorini et al., 2014)). dard client-server approach is adopted, the server is in charge for data exchange between all clients. Such Issues related to portability on different platforms server will also become a single – global – point of have been addressed, among the others, by (Darken failure and a serious bottleneck. Load shedding be- et al., 2005), (Guana et al., 2015), (Munro et al., tween servers may not be an option when dynamic in- 2009), and (Carter et al., 2010). Authors of (Darken formation must be shared to a worldwide player pop- et al., 2005) propose to improve portability by pro- ulation. The second reason is the client-server strict viding a unifying layer on top of other existing en- dependency from a well known, and always available, gines. In fact, they extend each architecture with an service provider. Next generation games should be additional platform-independent layer and assume a able to exploit the network whenever available, while share set of functionalities to be available on all plat- allowing single player mode when offline, with mini- form. This approach is feasible for multi-platform de- mal experience degradation for the user. ployment but may reduces performances and set all As a result, we envision that there will be a strong platforms to use a shared set of basic features. Au- demand for game engines with a flexible and modular thors of (Guana et al., 2015) focus on development architecture (such as the ones envisioned in (Maggior- complexity and propose a solution based on mod- ini et al., 2015) and (Maggiorini et al., 2016)) which ern model-driven engineering while in (Munro et al., will deploy seamlessly on multiple platforms and al- 2009) an analysis of the open source version of the low component distributions over a network without Quake engine is performed with the purpose to help asking for additional effort from the developer. A pos- independent developers contribute to the project. In sible first step to understand how distributed game en- the first case, developers may not be able to imple- gine can be shaped in the future is to apply their model ment any possible game mechanics while, in the sec- to the current mobile ecosystem (Gerla et al., 2013). ond case, results are limited to a specific game and For this reason, we propose here a modular architec- they stay on the same platform. A different approach ture for game engines targeting the Android operating has been followed by (Carter et al., 2010) where au- system. thors envision convergence to a web-based platform. To deploy our architecture on a distributed system, In this case, we have to outline mobile devices are still we lower the distinction between client and server ar- lacking web-based 3D support and, also, many mobile chitecture and make it evolve in a similar direction features (e.g., bluetooth peer-to-peer connection) may as a peer-to-peer network. Where required, a func- not be accessible as part of the gaming experience. tionality can be provided both locally and remotely If we focus strictly on the adoption of distributed with the same API. Scalability will benefit from this systems as viable platforms for games, research is approach thanks to transparent service-points reloca- currently pushing toward two directions: improving tion. A service may be provided from an arbitrary network performances and providing distributed ser- point of the peers mesh based on resources availabil- vices. ity and response time. Service point relocation can Improvement of network performances is mostly be achieved using local policies leveraging on neigh- related to reduce transmission latency by optimisa- bours node discovery. As a result, from a game devel- tion (Chen et al., 2016b) or offloading (Chen et al., oper’s point of view, no network management will be 2016a; Zucchi et al.,