In the weekend of 26-28 January, I worked together with five other programmers and a musician at this years’ Global Game Jam. For who has not heard of the GGJ before: This is a yearly event that is hosted at the same time in many places around the world, where teams build a game from scratch in 48 hours time, with a theme that is only going to be known once the competition starts.
The theme of this year was ‘Transmission’.
The game we ended up with is valled InVected: Survival of the Sickest
Now, besides our game itself being stylized as ‘transmission of sickness’ (everyone is a virus attempting to take over the host by caputring the most area, the theme also appeared in our submission in another way: Players are able to join the game at any time by pointing their mobile (or other) device to a given IP-address and enter the correct room code, and then control one of the virus-characters using a ‘joystick’ on their screen.
In this way, more than sixteen people are able to play at the same time. (At the event, we were able to try it out with a max. of ten, but the system seems to scale rather well).
The game (both the main game logic and the graphical display logic) itself is written in Unity, but the network code where players can join and control a character, is written using Elixir. We use Phoenix to host the joystick player-control page, and :gen_tcp
to link the Unity-game with the server.
The Elixir application is structured in a classical OTP-way: We have a TCP listener that will start a new game whenever a Unity-game instance makes a request. This new game is handled by its own GameServer
process. The list of GameServers is managed by a GameServerBucket
process. Both of these are managed by the main Application
supervisor, because the application is not more complex than just mentioned .
The code is available on GitHub,(The elixir-application can be found in the snapp_server
directory) but be warned that this is hackathon-code, which means that most of it was written in the middle of the night, after a lot of sleep deprivation, while being under a lot of duress from the rapidly approaching deadline: It is not clean code. We are currently in the process of rewriting the game without Unity, and also cleaning up the Elixir codebase while we are at it, but this will be done slowly .
Here’s a small video of the stuff in action:
https://twitter.com/WiebeMarten/status/957945699596996610
We had a blast, and at our GlobalGameJam-location in Groningen, we won the prize for Best Technology for the system in which we were able to incorporate all these mobile devices with the main game: Jackpot for Elixir! .
I thought it would be nice to share this stuff with you, and I’d love to answer some of your questions as to why we made certain choices in this project, if there are any. Thanks!
~Wiebe-Marten/Qqwy