At this point my game programming experience was severely limited, consisting entirely of a half finished abandoned 2D game engine, written in C++, and a multiplayer version of Tetris (heavily influenced by Battle Tetris Gaiden) of which the code can be found here. It would however become apparent that other projects, such as writing a renderer in OpenGL that displays point cloud data, did provide me with useful skills (skills mainly focusing on linear algebra).
I had a clear idea for the game pretty early on, I have always been fascinated with time manipulation in games because it is very clearly something we have no control over in the real world. Games such as Prince of Persia: The Sands of Time , Braid and Superhot all providing great use of time as a game mechanic. Another area of games that I was particularly interested in at the time were competitive local multiplayer games, in the vein of Nidhog, Samurai Gunn and #IDARB to name a few.
I knew I wanted to put these two concepts together but needed to be smart about it, I would only have around 5 days to make the game and that included learning Unity as I went. It also posed an interesting design challenge, how to do time manipulation in a multiplayer environment? This is a difficult question, some games have tried but never felt right, Max Payne 3 has in my opinion the best implementation of multiplayer time manipulation. I however avoided some of the pain by deciding that the time manipulation would be a local effect, with players being able to shoot a time bubble where everything inside the bubble would be slowed down.
The control scheme for the time bubble is rather complex, the right bumper shoots the projectile and then when you release the bumper it expands to become the time bubble. The players can only have one time bubble active so shooting a new one cause the old bubble to disappear.
For the player movement I wanted to keep it simple. In the game you have the ability to double jump and also the ability to wall jump, this allows an experienced player to easily navigate the environment.
This makes up effectively the whole game, a simple dual joystick platformer where the aim is to kill all other players.
The implementation of the game wasn’t too painful, it gave me plenty of time to white box the player movement making sure it felt “right”, this for me was probably the most fun part of making the game. Unity allows you to easily surface variables into the editor so you can change them as the game is running, this was great for white boxing as it allowed me to tweak my parameters and instantly see how they felt.
I learnt quite early on this was a very useful feature, even if it does reset them when you stop running the game (a little/very annoying gotcha). So with that moving forward I would try and surface any variable that I thought would be useful to tweak. Unity also has nice formatting for many of its data structures such as vectors, colors, GameObjects and Boolean values to name a few.
The Time bubble was probably the most challenging aspect of the game, a few avenues on how to implement it
were explored. The first promising avenue was the
Time.timeScale property, this however did not have the
desired effect given that this effects the whole Time class resulting in all game objects being slowed.
The next attempt to slow down the objects inside the bubble relied on programmatically changing the various parameters of the Rigidbody of the game objects when entering and exiting the bubble. This involved changing the effect of gravity on the object and its mass etc. This also proved to be unsatisfactory as it didn’t always behave as expected.
I eventually just decided that the easiest and cleanest way to get this working would be to write my own Rigidbody class that could have its physics model slowed down. This wasn’t too much of an issue given that the game play was effectively 2D meaning the physics model didn’t need to be to sophisticated to make the game feel “right”
public Vector3 gravity; public float drag = 0.1F; public float maxVelocity = 0.5F; public float timeScale = 1F; public bool collision = true; public bool noClip = false;
These are the public variables I made accessible so that they could be easily be modified in the Unity inspector
and also modified in code, such as the
timeScale property being modified by the bubble.
This script was then added to every object that needed to be affected by the bubble, so in the case of this game that meant all player avatars and all the bullets.
Finishing the game
There were more than a few challenges when making this game, most of them caused by my limited knowledge and the time pressure. I really wanted a polished complete experience that could actually be played. With that in mind it was important that I got the core game play end to end complete as soon as possible. That means I created the whole game with “programmer art”, below is a screenshot of the first build of the game that was feature complete. Feature complete in the sense that it has full controller support with main-menu, player-selection, level-selections, full-game play and a results view.
As you can tell It’s not a very pretty game at this stage, but it was all there and gave me the opportunity to continue to tweak values and get the game feeling right.
Once that was complete I had about 5 hours to polish what was there, so I did what any art impaired programmer would do and threw a bunch of lights at it. I also added an effect for when you die and respawn, that I personally think looks pretty cool.