-
-
Main game menu
-
In-game action
-
In-game action
-
In-game
-
In-game action
-
Logged into the online service
-
Converting your Fitbit steps into energy credits on the platform
-
Competitive fitness steps-to-energy leaderboard
-
In-game upgrades screen. Use your Fitbit generated energy here for upgrades and improvements to your player ship!
-
More in-game action
-
Can you collect enough space crystal to re-fuel and complete the game?
Inspiration
I have always loved the sci-fi genre and games. One other thing I enjoy is running and going for long walks out in nature. Recently, my wife and I both got Fitbit trackers to help encourage our walking and fitness routine. We found using them to compete for the 'highest' number of steps each day to be quite addictive and fun.
When I stumbled upon this hackathon, I was researching Docker containers and Kubernetes for work related purposes. I thought to myself: why not combine the already addictive Fitbit experience of competing for steps and walking, with a fun sci-fi adventure game, and use an online service running on Openshift to enable Fitbit to talk to the game on player's devices?
This would provide people with a mobile game that is not only fun to play, but also motivational in terms of exercise and fitness.
In addition to that, I could make the game experience even more fun/competitive by adding online leaderboards to the platform running on top of Openshift.
Thus, Stranded in the Expanse was born!
What it does
Stranded in the Expanse is sci-fi, action adventure experience that gamifies fitness. You use your Fitbit tracker device to help you progress in the game. The game encourages health and physical activity by giving the player in-game credit that they can use to upgrade their player's ship, in reward for steps counted on their Fitbit tracker. The online platform that makes this all possible runs on top of OpenShift's online platform.
- Players download the app from Google Play, install it, run it, and hit the register button to register a free account.
- They then do a 'once-off' hook up of their Fitbit account, to their Stranded in the Expanse account and perform an update of their Fitbit stats at least once a day.
- They login to the game using their registered details whenever they wish to play, and the game automatically converts any steps they have completed on Fitbit into 'energy credits' in the game, which they can use to upgrade their player's ship, and improve it.
- The aim of the game is to re-fuel your stranded ship by harvesting energy crystals in space. Once the player has harvested the required amount, they are able to play the end-game sequence and return home.
- Whenever the player wants more / better upgrades for their ship, the incentive is there for them to go out and walk/run with their Fitbit device!
How I built it
I started off using the MongoDB/Node.js template on Openshift. I spent quite a long time messing around with this and learning about how it worked, and how the network link between the containers was created. I also learned how the Openshift online platform worked, and how webhooks worked.
Once I had all of this figured out, I deleted my sample / test project, and started fresh.
I developed a very basic game menu and simple game prototype that just had a flying ship in Unity3D and got that up and running.
Next, I developed a base node.js solution that was able to read from and insert values into my mongoDB instance. This part took quite a bit of skilling up, and I spent a significant amount of time learning about node.js and mongoDB here.
Never-the-less, I found myself making good progress and just kept iterating on the game client and the online platform, adding an API manager to the game that was able to talk to my Node.js API. I built-in a way for the platform to register and login users, and authenticate them when API calls were made from the game. I plumbed in methods for the platform to talk to the Fitbit API and store any synchronized fitbit data for the player's on their accounts. I then built a way for the platform to communicate this to the game client.
Once the core mechanic was in place, I began resolving all the game's logic. This includes things such as: player control and input, enemy spawning patterns / behaviors, attacks, player weapons, as well as the movement of random space objects and mining mechanics to collect space crystal with the mining laser.
From there I added live leaderboards (total fitbit steps) for players to compete on and a way for the game platform's API to work with these, and added a message of the day service too. The leaderboards can be viewed online on the site, as well as through the game client.
Challenges I ran into
MongoDB and Node.js! I needed to learn a fair bit here. I now know what Node.js developers mean when they talk about 'callback hell'.
I also ran into some challenges getting my game client to operate smoothly when making web requests to my node.js web API. I needed to figure out how to get these calls onto background threads, which is traditionally quite difficult to achieve with the Unity3D engine. I did manage this in the end though, and web requests now play out smoothly on background worker threads and don't lock up the UI.
Accomplishments that I'm proud of
Completing a full solution from the back-end server in Node.js, and mongoDB database, to a custom middleware game API in Node.js to a full featured, fun client-side game on user's device. I'm really proud I managed to complete this full solution considering I've only had late nights and weekends to work on it around my full-time job and commitments as husband and father.
Having a game released into the wild that is free, and that encourages fitness.
What I learned
- I learned a lot about Openshift's platform, and the benefits it brings to the table. In terms of both easing workflows, and not having to manage Dockerfiles and complicated container networking.
- I also learned a lot about Node.js and MongoDB.
What's next for Stranded in the Expanse
I would definitely like to take this further. I think it is very unique (gaming and fitness!) and has great potential to go further.
- I would like to integrate with other fitness trackers next - like the Jawbone for example.
- After that I would like to spend more time on the gameplay and storyline of the gameplay.
- Then, I would like to add more online platform related features like daily challenges for extra rewards etc... (more things to encourage players to meet exercise goals in exchange for massive energy crystal boosts and upgrades!)

Log in or sign up for Devpost to join the conversation.