Enter your date of birth:

Year
Month
Date

OK

Sort


RSS

Cast Your Vote

Which friendship achievement will you (or have you) complete(d) first?

Blog Tags

Developer Diary: Part 2 of Nathan Brierley on Artificial Intelligence

Spenser Norrish

Behold! The second part of Nathan Brierley's developer diary on artificial intelligence is here! Nathan goes into detail about changes made to the enemy AI in Army of Two: The 40th Day. This second part picks up right where we left off, so make sure you read the first part if you missed it.

 

We also put a great amount of effort into improving the enemy AI. We iterated on aspects of the AI that worked very well, and changed the aspects that didn't work particularly well. One way that we've made the enemy AI seem particularly smart is through 'standoff' or pre-combat AI. Standoff AI most often occurs in pre-combat situations, where players enter an area and can see the enemies interacting with the environment in some highly intelligent way. These events use scripted animations, but ultimately it's dynamic in how the situation plays out. For example, the player might come upon an enemy that takes a civilian hostage. The hostage taking is scripted, but how the scenario actually plays out depends entirely on the player. The AI will act different depending on how the player reacts, even though the initial encounter was scripted.

 

Caption: A top-down look at the wireframe view of a map in the Unreal Editor, where information about cover and navigation is inserted for the enemy AI.

 

One aspect of the enemy AI that we refined was the tactics that they use during full-out combat. In many shooters the actions of enemies are almost entirely scripted. Enemies will run out to specific pre-determined locations and remain there shooting at the player until they die. It's completely predictable and not much fun when you see it more than once. This is completely unlike Army of Two, where the behavior is completely dynamic. The enemies navigate around the world and use particular tactics. They navigate throughout the world using a dynamic path finding algorithm and a nav mesh, which tells the AI where it can go in the world. Additionally, there are cover nodes programmed into the levels that tell the AI what is suitable cover and what is not. This is important because one big goal that the AI has is moving from cover to cover as it tries to get into good positions to shoot at the player.  They communicate with each other in order to act as a team with the ultimate goal of attacking the player with tactics like flanking.

The behavior of the enemies depends heavily on aggro and play style as well. Continued efforts have been put into ensuring that aggro feels like an effective mechanism, so when one player has aggro the enemies will be mostly oblivious to the other player until they start generating their own aggro. Furthermore, players who are very aggressive will cause the AI to play more passively, whereas if players are simply hanging back picking off their targets one by one, they will tend to take risks. Melee combat, too, will be more interesting as enemies will be less likely to flee and actually have the ability to capture the player if they aren't quick enough.

 

Caption: More yellow-circle cover nodes can be seen in this view of a map in the Unreal Editor.

 

There is also a much greater array of behaviors that the enemy AI can exhibit. They can perform every type of move that players can. This means that they can step jump, take the player hostage, use combat shields, heal wounded mates, and more. They use these abilities intelligently too, and observant players (or rather, players who don't instantly kill everything in sight) will be able to witness really cool movie-like hero moments that are not scripted. Like in the movie Full Metal Jacket, players might witness enemies repeatedly try to rescue a wounded team mate, only to give up after taking too much fire. It's very awesome to see the enemies perform all these cool moves.

Staging now plays an important role in AI as well. In the original Army of Two players would essentially move into an area and the enemies would immediately know that they are there and begin attacking as if that is there sole purpose in life. Now many of the enemies already exist in the world, oblivious to the players until they make their presence known. Not only does this give players the opportunity to use new tactics, but it also has a big impact on how the enemies behave. They will interact with each other (or civilians), and if players use the right tactics the enemies might be oblivious to the fact that their nearby buddies just had their heads decapitated. This plays into weapon customization as well, as the enemies will react differently depending on what weapon setup is being used. Sniper rifles with silencers will allow players to pick off enemies before their presence is known, whereas shotguns will have the reverse effect.

 

Caption: Here you can clearly see the placement of yellow-circle cover nodes in the Unreal Editor.

 

Ultimately we've put a huge amount of effort into creating AI that is completely dynamic and goal oriented. Both the enemies and partner AI are capable of executing all of the coop moves that we offer players, and enemies do their very best to attack the players with actual squad tactics. The AI offers players really unique experiences, and allow for different experiences every time players replay the game using different tactics of their own.

 

Next week we'll have the next in a series of developer diaries that discuss multiplayer, and make sure you check us out on Twitter @Army_of_Two for more updates, and on Facebook!

comments (1)