Devlog 002


Devlog 002

Corsican is a turn-based strategy game in which you play as Napoleon. The game will have a grand-strategy layer and a tactical layer. I am going to focus on the tactical layer for battles first and scope up from there.

Today I spent some time coming to grips with Unity's Tilemap feature. I found some free hexagon tile art and implemented rendering a grid. I made it as far as rendering a map and detecting clicks on the hexes. The white block in the middle represents a unit, and the clicked on hex shows an "outline" to represent it is selected.

Once I was able to draw a given tile, then it was simple to add two additional tilemaps to represent Terrain and the other special effects. Here you can see various terrain tiles. The Trees are tiles on the TerrainTilemap which are rendered on top of the GroundTilemap. Lastly, when you click on a unit the neighboring hexes are "highlighted" by setting a tile to "white" on the EffectsTilemap. 

The other thing visible in this screenshot are red and blue units. I implemented definining units and loading them dynamically. Both "sides" use the same sprite (a white block) for which the color is set based on the Id of the owner. Units also have a direction which translates to a rotation value in unity.  

With all that working I added a few more Terrain types (the rocks) and implemented the ability to write a map to a file and load it back in. Now I can use the Unity editor to create the maps and write them to a file for reuse. This will be useful for rapidly testing map files and later on for writing the Scenario editor.

With the core of the map working, the ability to spawn in units, I needed some basic UI to show you the unit in the current hex and allow the player to select them. Once selected, now you can move your units. Like I mentioned, when a unit is selected the neighboring hexes are marked with a white tile as potential move targets. When one of these marked tiles is clicked then the UI resolves that to a movement command for the selected unit.

When a unit moves adjacent to an enemy then they are in range to attack that hex. You can see that hex get marked with a red tile.

The next steps are to implement the resolution of the actual attack command and probably firing.  See you next time!

Leave a comment

Log in with itch.io to leave a comment.