I coded the base of this project alongside a tutorial on GameDev.tv. It provided the base game grid, player scripts, action point system, and AI with A* pathfinding. I made notes as I progressed and upon finishing the tutorial spent a month improving systems while implementing new mechanics. While there were some structural changes, the biggest changes are outlined below.
Aside from system level refactoring, actions such as "Move" were changed. Originally the player had unlimited moves in a turn and it always cost one action point. I changed it so you can only move twice per turn with the first move being free. I did this because I wanted to increase the pacing of the game while still forcing the players to plan their movements.
A pistol and an X-Ray rifle that can fire through walls were added with the pistol having its own animations. Weapon reloading was implemented along with accuracy and critical hit mechanics. These features were given their own UI. Critical hit rates are static per weapon while accuracy is determined by a number of factors such as target distance. Hidden accuracy boosts are given to offset how a hit percentage may not feel like that to players. The spin action now increases damage at the expense of accuracy.
Action button UI was modified to show current action point cost and supply quantity, like ammo, to the player. Action buttons now turn red if you can't use the action, and have a tooltip to provide information such as current damage or accuracy. Grid highlighting was reworked to show the cell your mouse is in. AOE effects, such as grenades, now show all cells that will be affected by the action. This also takes into account whether or not a wall will block the AOE's area.
Originally, the camera moved from player input or when using the shoot action. In that instance the camera would pull in to the shooter's shoulder. I wanted to make it more responsive to the game's current state however. Now the camera snaps to units the player sets as active. The camera also tracks units as they move and will aim at the target cell for more than just the shoot action. If an obstacle is between the camera and the target, the camera adjusts its position to no longer be blocked
The AI chooses an action by scoring each one and using the best. Originally however, it took turns one action at a time. I wanted it to plan ahead, so I created an "action list" class that held a list of possible actions. Enemies now evaluate several turns comprised of random actions and pick the one with the highest cumulative score. After every action, the turn is re-evaluated to account for random events such as missing a target. An aggression meter was added to alter behavior for actions like moving and healing.
The use of randomization allows for a large number of possible turns and therefore creates a slow system when considering too many options. To increase performance, I set iteration limits on choosing actions and lists. My main source of slowdown however was forcing the AI to consider all possible starting movements. I added a separate parameter limiting the AI to create lists for only the best movement candidates. These values were then tuned to increase AI speed while keeping it intelligent.