For months I’ve wanted to add castle maps for some more variety and to add some new tactical challenges.  I wanted to add walls, gates, and destructible obstacles.  And I never seem to learn how complicated even a seemingly small change can be.

This may look like it’s just opening and closing a gate, but you would not believe how complicated this is: Who controls the gate? And do you want to attack the gate or move through it? Should you be allowed to attack from inside the gate? I had to retool all of my attack code to allow attacking a gate instead of an enemy unit. And then I had to redo pathfinding: If you control the gate, you can go through it, but if you don’t control the gate, you can’t go through it. And what if you don’t have enough move to go past the gate? Should you sit there with the gate open? And the AI, when it’s choosing where to go and what to do, it can pathfind around the gate, and it can also choose to break through the gate. And I had to rework some meshes to fit the hex size. And I had to rework materials for dynamic lighting. I literally spent about a week on this system.

At least it looks like everything is working now, and we will have some castle sieges in Himeko Sutori very soon.