Optimizing Server-Driven Themes for Mobile Games: A Complex Solution
When faced with the challenge of integrating server-driven themes into a mobile game, a sophisticated yet intricate solution was required. This case study explores the implementation of dynamic themes in a platformer game, detailing the technical hurdles, design changes, and ultimate solution adopted.
Introduction
Blending user customizability with efficient server-side management is a common challenge in mobile game development. In 2012, during the development of PocketAdventure, a tile-mapped platformer for iOS and Android, we embraced the concept of reskinning the game to different themes based on user preferences. Initially, the solution seemed straightforward but quickly evolved into a complex project requiring meticulous planning and execution.
Initial Concept and Initial Challenges
The initial concept was to offer multiple themes such as a superhero city or a caveman moon, allowing users to select their preferred theme. The backend team had recently developed an Application Configuration (AppConfg) system for rapidly application development, which opened the door for dynamic theme changes via server updates. However, relying solely on server-driven themes quickly exposed significant issues, especially during the critical requirement for offline play.
Server-Driven Themes and Offline Play
The server became the cornerstone for theme updates, but this strategy led to a detrimental effect during server issues. Since the game relied directly on the server for theme updates, any downtime would render the game unplayable. To mitigate this, we decided to ship the game with a default theme pack and use it as a fallback in case the server theme pack was unavailable.
The first iteration of the solution worked well, but user feedback revealed that this approach could not persist user-selected themes between game sessions. This meant that users' preferences were reset each time they started the game, which was counterintuitive and frustrating. It became clear that we needed to cater to a more complex, user-centric solution.
User-Specific Theme Packs
After several iterations, we decided to store each version of the theme packs locally. This involved maintaining a user-specific theme pack, merging it with the AppConfg pack, and ensuring that it reverted to the default theme pack if necessary. This approach not only addressed user persistence issues but also allowed us to handle deletions of purchased theme packs gracefully, ensuring that users could continue to access their previously purchased themes.
Addressing CEO's Specific Requirements
Our CEO's involvement in this project aimed to leverage our Ad service, which already supported audience targeting based on age, location, and gender. One specific request was for Coca-Cola to conduct a small trial in the Atlanta region tied to the release of a new Fanta flavor. This required us to generate theme packs dynamically on the server and consume them on the client side, which presented a new set of challenges.
Merging and Persisting Themes
The entire process of finalizing theme packs was intricate and involved several steps:
Load the default pack. Attempt to download the current pack, replacing the stored AppConfg pack. Load the stored AppConfg pack if not already available from download. Attempt to download the Ad themes. Generate the user-selection theme pack, maintaining their current selection as the default theme, filling in any themes from the Ad pack, then from AppConfg, and finally from the default pack. Add in all purchased themes if not already in the user-selection theme pack.While this approach was robust, it highlighted the limitations of our server infrastructure for such dynamic and specialized client-side data sets. The server struggled to generate a generic list of themes, leading to a decision to manage theme packs client-side, a change that required significant effort and resources.
Conclusion
The process of dynamically managing themes in PocketAdventure was a testament to the complexities involved in integrating server-driven content into mobile gaming. Despite the initial challenges, the solution we developed ensured a seamless user experience, even during server downtime and while offline. This solution also paved the way for future projects by demonstrating the importance of considering both server-side and client-side operations in the design of dynamic content systems.