A multiplayer game in 48 hours?

Stan Stun and the Royal tomb
or how we created a multiplayer game in 48 hours…

“Stan Stun and the Royal tomb” is a game developed by Dragontale team, on Gi-Cluster Game Jam that took place on 12-13-14 of December 2014 in Athens, Greece.
The game jam theme was “Amphipolis“.

You can find the whole unity project (assets + source code) here.

Stan Stun Presentation
Every Jam is an opportunity for our team to try something new. Something we haven’t done before. This time we wanted to try Unity’s multiplayer mechanism. Moreover our Druid (Zafiris Panagiotidis), wanted to try out some dungeon generator algorithms. Yes, he is one of those procgen maniacs. 🙂

When we heard out the theme, we had the following thoughts:

“Shit…”

But seriously:

  1. The meaning of the word “Amphipolis” which is a combination of the words “Amphi” and “Polis”. “Amphi” is the equivalent of “bi-” or “uni-“. “Polis” means city.
  2. The Amphipolis Tomb that has been discovered lately, and the fact that the identity of the person burried there is still unknown. In addition, our attention was caught by a photo of a majestic mosaic that was found inside the tomb part of which was destroyed.
  3. The concept of opening a tomb that was not meant to be opened, shows a lack of respect to the world of the dead.

With those 3 pillars in mind we came up with the following game play. Our “Polis” would be a cube, divided in two areas, red and blue. Players (that can be up to three per team) can go around the cube and collect pieces of a broken mosaic. Each player can carry up to 6 pieces at a time. When a player is full, they have to deposit the pieces back to their base before they can collect more pieces. Pieces collected within their team’s area will give one point, while pieces collected within opponent team’s area will give three points. However, there is a twist! If an opponent shows up in their area, they can stun them (making them unable to move) for 3 seconds while at the same time they take all of the pieces the opponent is currently carrying. The winning team is the one with the most points in a three minute game.

Concept Art - Character creation

Art Approach:

The aesthetic experience of the game was influenced by the theme of “Amphipolis” and more specific, by patterns and colours related to artifacts that were found by archeologists inside the ancient tomb. We choose a palette of dark colours to create the feeling that the player is inside the ruins of Amphipolis.

Patterns that were found on the walls of the real tomb of Amphipolis were used as references and inspiration for the textures of the game in order to create a visual connection to the theme. For example, each side of the cube has a coloured Greek pattern to mark each team’s territory.

The main 3d features of the game were the stone walls and the ruins of marble columns. All the models had textures from either real photos of materials or hand-drawn pieces that were scanned and edited to match the desired visual experience.

Concept Art – Level patterns and environment features

Music Approach:

The first music concept was to have something mysterious, foggy and maybe spooky. Soon while playing the early prototype and considering the multiplayer – competitive aspect we realized we needed something more upbeat, fun and not too complicated. A few clear instruments (drums, bass synth, a backing electric guitar, one lead synth and one baking synth), each with a specific role, giving a nice groove without getting annoying.

You can listen to “Stan Stun and the Royal Tomb – Music Theme” here.

Concept Art - World perspective

Technical Approach:

Our first problem was the generation of the level. One player has to create a game room in order for others to join it.
The first player is the initiator of the temple generator. A cube with 6 sides that every single one of them is generated using an algorithm, based on Conway’s game of life.

Multiplayer was introduced using Unity’s default mechanism (here’s a cool tutorial by paladin studios).
We hardcoded the sides of cube giving sides 1-2-3 to the red team and sides 4-5-6 to the blue one. Each player to enter the game alternately joins the red and the blue team. Red players spawn on side 1, while blue ones on side 5. Every side had its respective base in order for players to deposit their collectibles.

Stun mechanism was passive. Meaning that if a player is in one of their team’s side, they would stun any enemy that came close enough (or chase them down). A flame effect was used, for showing players wheter they have stun capability or not, depending on which side they are on.

We tried as much as possible to make our code event based.
Diving into it you will find:

  1. EventManager: Our game’s events
  2. NetworkManager: Controller of network events
  3. UiManager: Controller of our UI
  4. SoundManager: Controller of our sound events
  5. MusicManager: Controller of music for our game

Concept Art - Grand mosaic

Moments:

Every time a new player is connected to a game room they receive the structure of the level from the first player.

We used Unity’s RPC method to send a string with the structure details. Although we hit Unity’s size limit for RPC calls we managed to compress the details of the request, overcoming this obstacle successfully.

Dragontale