Time Thief

Overview

In my fourth semester I attended the Social Gaming lecture, which included a practica about creating a social game, so a mobile game with social features. After an initial brainstorming session, our team decided to create a location based game similar to Ingress. The title of the game is Time Thief and the idea was to implement a game around the concept of the movie In Time (2011): Every player has a limited amount of time, which ticks down mercilessly after login in. If you run out of time, your account is disabled and the game ends.

The practical part was organized in groups of five, my team consisted of the following members:

Nassim BoukadidaClient Programming Lead & UI
Taieb HaddejClient Programming
James LiClient Programming
Alexander EppleServer Programming Lead
Mengdi WangServer Programming

Gameplay

The focus of the gameplay was mobile as well as short- and longterm social contexts. The mobil contexts include all the ways the player can interact with the game, the social contexts are about how players interact with each other. The game allows for very interesting player interactions, since there are only two options to keep playing: Visiting places that can reverse timeflow, called timeholes, or stealing it from other players. Either way players are forced to interact, both in good and bad faith. To steal from a player, one needs to be actively using the app in close proximity to the target. The attacker then has the option to select the target and start the attack. Stealing continues as long as the phone is continuously shook while the target is in range. The target also recieves an attack message and can potentially defend himself. The endgame of the game is to survive as long as possible and climb the ranks on the global leaderboard.

Implementation

Client

The Android client was implemented in Java using Android Studio, and uses Google Maps for most of the presentation. The UI however was built and designed from scratch. The game regularly sends and recieves updates using a background service, so players can play passively as well. The client is only responsible for presenting the data and letting the player interact with the game, the logic runs entirely on the server.

Server

The server was running on a dedicated VM that also included one public IP address. This allowed us to play the game everywhere, unlike many of our fellow students. The server uses the Play Framework for code execution and connection handling, Mongo DB as the database service and Google Firebase for user authentification and push messages. It took a while until everything worked together properly and the client actually recieved messages, but after those initial bumps the infrastructure worked pretty much flawlessly.

The server handles logins/logouts and updating the game. Players can call functions simply using HTTP-GET, the data is sent as JSON through the response message. This was done for ease of use and could be changed to also incorporate HTTP-POST methods and so on. Since the server functions did not have large input parameters, this was not strictly necessary though. The player accounts are bound to Firebase IDs and Firebase Cloud Messaging is used to send messages, such as friend requests, to the devices.

The code for both the server and client is not hosted on GitHub, but you can see roughly how it works in the picture below, although some a few things differ from the initial implementation idea / concept.

A productive whiteboard session

Final Thoughts

The project was overall really fun and everybody was quite happy with the final product. This was one of my first experiences with online multiplayer programming, although it was of course not real time. Setting up the frameworks and the server without prior knowledge was quite challenging, but also very interesting. Working with the Play Framework was pretty easy and Firebase worked well once everything was setup correctly.

Sadly we did not record any gameplay, so there is no trailer for this game. Since the game requires a server that it can contact, there is no point in providing a build. The project is also not hosted on GitHub but you can download both the client and server code below to toy around with.

Leave a Reply

Data protection
I, Alexander Epple (Place of residence: Germany), process personal data to operate this website only to the extent technically necessary. All details in my privacy policy.
Data protection
I, Alexander Epple (Place of residence: Germany), process personal data to operate this website only to the extent technically necessary. All details in my privacy policy.