It’s been a few weeks since the last update due to travel and working on another project.
Improving Enemy AI
Much time and thought has gone into this, but there’s nothing to show for it yet. I removed ~1000 lines of enemy AI code in an effort to simplify the logic. I’m moving away from Utility AI because tuning the scores for a large number of scenarios has been a nightmare. I’m keeping the intent layer because it’s useful for setting action priorities based on the actor’s current situation. Potential actions are evaluated from highest to lowest priority. The first action that is valid for the current turn is selected. It’s simple but it works. The main enemy behavior problems I’m still trying to solve are positioning (when to move forward vs when to hold vs when to take cover, and where to go when taking cover), preventing kiting through corridors, and pulling enemies to doors. Only the more intelligent enemies have these behaviors; low intelligence enemies will simply move toward the player and attack.
Synchronous / Asynchronous Actions
A while ago, I had to change the way the run ability worked because it wasn’t triggering effects in the cells in between the start and end cells. The change was to have the player move through each cell instead of simply changing the player’s position to the destination cell. This created a new issue: running no longer avoided attacks of opportunity because the player was still adjacent to the enemy. There wasn’t a simple solution to this problem. I considered four different quick fixes (I’ll skip the details) but none of them worked. I determined the correct solution was to prevent the enemies from acting until the player completed the run action. But I didn’t want to make actors take turns sequentially because it would slow the game down too much (Legend worked this way originally). So, I added a synchronous flag to action types, enabling specific actions to execute synchronously. This required slightly reworking the game turn manager, a class I don’t like to touch, but the solution worked well and resolved the run issue.
Next week, I’ll continue focusing on enemy AI. This is the most important significant gameplay issue.

