You already know what kind of problems with the enemy AI we encountered in the early stages of development. Now it’s time to go into details about how we’ve improved and expanded the AI of one of Hellraid’s many enemy types: the Skeleton hordes.
The first step was to create probable battle situations. If the player is surrounded by groups of Skeletons, one of possible scenarios is that the strongest units attack first. Or, another strategy, a number of weaker units engage the player in combat, while the rest block the escape route or hunt the remaining cooperative players.
The Skeletons have to be able to evaluate which strategy will be the most effective against the player(s). They need to consider such factor as the terrain configuration, their headcount, and the player’s equipment and skill level. Then the AI decides if it’s best to make a massive frontal attack, lay an ambush, or perhaps wear the player down in a series of duels and smaller skirmishes (1vs1, 1vs2, 1vs3).
The expanded AI created a need for new animations. Consequently, we added evasions and dodges, counter and parrying animations, sneaking and encircling, and finally taunting, which is characteristic for units not directly involved in the fight at the moment. It also makes the gameplay more varied and dynamic.
Right now, out testers are hard at work trying to “break” the game and find holes in the new AI of the Skeletons. The testers set up traps, attack the poor Skeletons from all sides simultaneously, or drop heavy objects on their heads. This way, we create new situations to which the Skeletons should be able to adapt with the help of our HTN Planner.
One of the most basic problems was how to stop the Skeletons from getting in each other’s way. One unit evading the player’s attack would often bump into another unit, who happened to try to join the fight. We’ve solved this problem by introducing a new condition that cancels an evasion if there’s another AI character in the way. While we were at that, we also fixed path finding as to prevent the Skeletons from approaching the player from behind the backs of their AI comrades.
Another problem, which we’re dealing with now, is detection of dynamic objects on the map (such as corpses or destroyed objects) that may block the AI’s paths. We’re also in the middle of eliminating “synchronized dances”, as we call it.
A synchronized dance is a case when many enemies choose the same attack pattern at the same time, which looks like a group of clowns mocking each other. To avoid this, we improve not only the group AI coordination, but also create new variants of attacks and reactions, expanding the range of available behaviors.
We’ve still got much work ahead. We haven’t finished refining the elements we added to the AI yet but we’re already planning to introduce new conditions and behavior patterns that will make the combat in Hellraid a truly unforgettable experience.
To give this blog update a nice closure, we have a question to you: what kinds of behavior, beyond what we mentioned above, do you expect from the AI-controlled Skeletons?