top of page
ezgif.com-gif-maker (44).gif

Monster tactics is a gameboy inspired retro game that I developed as a personal project using Unity. It is a turn based strategy game set on in a grid based world in which you control units in combat.

Page in development

Level Editor

Levels in Monster Tactics can be made with a custom level editor. This editor allows the user to quickly place, replace, and remove tiles and set their height.

​

I created this editor to allow my friend to easily create levels for the game, practice building editor tools, and see what I could do with the Odin Inspector plugin.

Add.gif

Add

Remove.gif

Remove

Height.gif

Height

Replace.gif

Replace

Tiles

Level data is stored as a dictionary with pairs of Vector2Int and Tile. This makes looking up specific tiles quick and has the added benefit of preventing duplicate data, as the dictionary will never allow duplicate Vector2Int keys. 

This data is stored in a ScriptableObject which can be saved as a file. This makes the data persistent and makes it easy to access the data. This should also make it fairly easy to implement a run-time level editor later that would allow players to create their own levels inside the game.
​
Tiles are also stored as ScriptableObjects, this makes them easy to reuse in different maps because they're saved as assets in the project. New Tile assets can easily be created, just pick a texture for the top and sides, and configure how difficult the terrain is.
​
Tiles consist of quads. Every quad on a tile shares the same texture, with an exception for the top, which has its own texture. The current setup isn't ideal however, in future it would be better to procedurally generate the tile geometry and UVs so a tile requires fewer draw calls.

Code_AMHaktD1Wf.png
Movement.gif

Character Movement

The player can move characters around. Once a character is selected and told to move, it's movement range gets highlighted on the ground and an arrow is drawn to show the path they will take. 

​

The movement range is calculated using a slightly modified breadth-first search algorithm. that additionally incorporates checking the height difference between tiles (to prevent people walking up cliffs when they shouldn't) and terrain difficulty to slow characters down.

Waves.gif

Waves

To make the game look more interesting I created a tiled wave effect to surround the maps in the levels in the game. This effect is achieved with a grid of tiles. These tiles then have their Z-position altered based on perlin noise that scrolls past.

waves.png
bottom of page