Enemy AI improvements
After the first playtest, I decided begin improving the enemy AI in the game. The enemies had a very simple behavior tree and most of their behavor was written in their blueprints. It felt a bit messy so I wanted to move as much as possible into the behavior trees. It took a bit of learning how to properly use the behavior trees and there's still ways to go, but I'm already quite happy how the AI for the regular enemies has turned out.
Before the improvements the enemies simply ran to the player and executed attack and if they lost sight of the player the enemy returns back to their original location.
The improvements include seperate behavior trees for melee and ranged enemies. In additional to sight, the AI can also react to sounds and damage. After hearing a sound, the enemy moves to investigate the location of the sound. The AI also makes use of different movement speed values for different tasks.
After noticing the player, the melee enemy moves to a close range, begins to strafe around the player and after a moment executes an attack.
The ranged enemy attempts to attack the player while keeping at range. If it loses line of sight to the player, it moves quickly to a better position. At low health the ranged enemy moves away, preferring a location outside of the players view and restores some health.