Tanks Arena
Video Game
Game Concept
Tanks Arena is a video game prototype produced in the Unity game engine. The game draws inspiration from top-down multiplayer games such as Boomerang Fu, and sees players control heavily stylised tanks which fire absurdly bouncy projectiles. Many of the game mechanics, such as the ricoheting bullets, were inspired by old tank-operating games such as Tank Trouble and the 'Tanks' game from Wii Play.
The two main game-modes include Single Player, in which the player battles AI adversaries through a series of challenging levels, and Multiplayer, in which two players battle in chaotic arenas filled with obstacles and power-ups. Perhaps the game's most interesting feature is the Arena Editor which allows players to create their own custom arenas in which to play.
The game was built almost entirely from scratch in Unity using C#. I created all of the assets myself, including all of the gameplay scripts, the 3D models and the custom UI components, with the only exceptions being the music, the sound-effects and a single explosion particle effect.
Important Note
This project is completely unrelated to the official Unity tutorial involving a tank-based game. I didn't watch or draw any inspiration from this tutorial, as I'm sure is obvious from the game's code and structure.
Gameplay Trailer
I put together a short trailer showing a wide range of multiplay and single player gameplay. Click below to watch the trailer on YouTube.
UI and Menu Design
Possibly my favourite part of the whole project was creating game's various menus, including the main menu, the pause menu and the arena editor interface. I found designing these menus surprisingly challenging, and spent a good deal of time studying the UI design in games such as Sifu, Hitman 3 and Boomerang Fu before settling on the final style seen below.
As the majority of Unity's built-in UI components weren't suitable for the designs I had in mind, I ended up creating a wealth of custom UI components, including custom pickers, alerts, dialogue boxes and more.
A particularly interesting menu to design was the pause menu. I opted to have two panels slide in from each side of the screen when the game is paused, allowing for a seamless transition to and from gameplay.
3D Modelling
The very first task in making the game was to create the 3D models that would be needed. This was a great opportunity to dust off my 3D modelling skills, and I had a blast making these assets with Blender. Every element from the tank models to the arena walls to the crates and explosive barrels was modelled from scratch in Blender.
The arena walls posed an interesting problem. I knew that I wanted the game to work with a grid-based system to allow for an in-game arena editor, and that I wanted the walls to look like roughly like the striped barriers you can see in the final game. This proved rather more complex that I had anticipated, as each wall block in the grid would have to react to all eight of its neighbouring blocks in order to create an appropriate transition between the blocks. This required a total of 15 different wall assets and some interesting code later on to select the appropriate asset.
Arena Editor
The feature that I was most excited to implement in the game was an Arena Editor that would allow the player to create their own arenas to use in the game. I have always been a huge fan of games which offer level editors, especially when these are powerful enough to replicate any of the original levels playable in the game. With this in mind, the Arena Editor took shape fairly early on in the process, and so I was able to use it to create each of the official levels and arenas featured in the final game.
It was also important to me that the editor felt satisfying to use, and I spent a lot of time experimenting with different animations and sound effects to find just the right balance between the animations looking smooth and feeling snappy.
Programming the Gameplay
The core of the project was of course programming the gameplay. This was perhaps surprisingly one of the simplest parts of the game, but nonetheless there were some fun problems to be solved such as handling explosions, managing ricocheting bullets and adding destructible crates. The main task here was creating the player-controlled tank and bringing it to life with satisfying movement controls. I experimented with various different control schemes and mechanics before settling on the final controls, and then spent a great deal of time tweaking speeds and other values to get the feel of the controls just right. Some alternative mechanics that I implemented but subsequently abandoned included having players turn the tank manually rather than simply aiming with the joystick and giving players the ability to aim their tank's turret independently of the body of the tank.
Single Player
The single player game-mode sees players battling waves of AI tanks through nine increasingly challenging levels. This involved creating AI adversaries of various difficulties for the player to encounter in these levels. This is handled by an AITank component which interfaces with the same Tank component controlled by the player through the PlayerTank component, which ensures that the AI tanks move and handle in exactly the same way as the player. Whilst I'm fairly happy with the resulting AI opponents, I'd love to go back and improve on this aspect of the game one day – their simple behaviour could be hugely improved with proper path-finding and the ability to intentionally bounce bullets off walls.
Multiplayer
In multiplayer, two players battle against each other. Multiplayer functions relatively similarly to Single Player, with the main addition being power-ups. I hope to add many more someday, but for now there are four power-ups featured in the game:
- Rockets – The player receives three rockets, which are fast-travelling projectiles that explode on impact.
- Homing Rockets – The player receives three 'homing rockets'. These travel much more slowly that the regular rockets, but automatically lock-on to and follow their targets.
- Shield – The player receives a small shield which protects them from one bullet hit (but not from explosions!)
- Rapid Fire – The player can fire a continuous stream of bullets for a short amount of time.
Code Available on GitHub
I've made the game's code public on my GitHub. Some of the scripts date back to my first experiments with Unity many years ago, so please don't judge them too harshly :)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Instantiate a new Arena object from an input Level object
public static void CreateArena(Level level)
{
// Create a 'root' gameObject with the Arena component
GameObject arenaHook = new GameObject(level.levelName);
Arena arena = arenaHook.AddComponent<Arena>();
// Create each of the blocks making up the arena's block matrix
List<List<Block>> blockMatrix = new List<List<Block>>();
for (int i = 0; i < level.Height; i++)
{
List<Block> row = new List<Block>();
for (int j = 0; j < level.Width; j++)
{
// Name the block
string blockName = "B(" + i.ToString() + "," + j.ToString() + ")";
// ...
Back to Home Page