Raycast-Based Targeting

Previously, I mentioned that stuff like obstacles blocking shots and the cover system broke when I shifted from a raycast-based targeting system to a purely tile-based targeting system. Now, the reason I did that was because I wanted to forget about obstacles and cover for a moment and simplify the targeting system.

If we look at games like Final Fantasy Tactics and Fell Seal, both movement and attack targeting are described in terms of tile distances, including vertically. This also applies for any AoE abilities. It made things easier to visualize and was easier for the player to count tiles to plan out their actions.

But given that Gunwitches revolves primarily around long-ranged gun-based attacks, and that I wanted to be able to create more interesting levels, we need some line-of-sight (LoS) code to determine whether an attack should be able to hit a certain tile, even if it is within range.

Only blue guy #4 can be shot!

In this case, I implemented a very permissible LoS code to also allow units to shoot around corners.

Elevated Terrain Tiles

I have the high ground!

Not pictured here, but those elevated tiles are built up of separate multi-tile blocks: each block can have variable length, width, and height in tiles. The way targeting works is it still counts range in tiles along the X and Y-axis (regardless of the height or Z-axis difference), but now all attacks must specify a maximum Z-range. For now, this defaults to 3x the standard attack range to reflect that 1 X/Y-unit is 3x the size of 1 Z-unit.

For movement, by default units can move to a tile with a maximum Z-difference of 1. Later on, I could modify this based on the unit, so units could jump to a higher tile as long as it's within their max Z-range.

Next week: I think it's time to set aside the code and start working on the visuals for the game. While core gameplay is important, the look and feel of the game needs to be established earlier on as well - plus it wouldn't hurt to have nicer-looking screenshots to show off! I already have a rough idea for the overall theme, so for next week I'll be researching and working on a rough concept for one of the main Gunwitches: the Turret Witch!