The following blog post, unless otherwise noted, was written by a member of Gamasutras community.

The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.

Introduction

In this article I will go into depth about enemy design and enemy AI for melee combat systems. This is the second article in a three part series about how Level design, Enemy design, and Enemy AI can make melee combat systems more engaging. These articles discuss several major titles and feature input from leading combat designers.

The games analyzed for this article series are DmC: Devil May Cry, God of War 3, Bayonetta, Ninja Gaiden 2, Ninja Gaiden 3, Batman: Arkham City, Enslaved: Odyssey to the West, Assassin’s Creed 3, and Prince of Persia: Sands of Time. These titles were chosen to represent a selection of titles that span over a decade of combat design, commercial success, and middle ground of expectation for players’ experience levels, for example Assassin’s Creed 3 aims at an audience that has a solid understanding of gameplay mechanics but does not present a high level of difficulty, whereas Ninja Gaiden 3 has similarly high expectations of player performance to the Dark Souls/Demon Souls games. The Souls games and the recent Bloodborne represent an unusually extreme set of player expectations and as such are not a key reference point for this series of articles, but I may write about them in future in comparison to the principles seen in the selected titles.

The professionals I interviewed and their main titles are: Alex Sulman, who was involved with combat design on Heavenly Sword, God of War 3, and God of War Ascension; Rahni Tucker, the combat designer for DmC: Devil May Cry; Anthony Newman, the melee combat designer on The Last of Us; Ben Ruiz, a combat design consultant and designer of Aztez; Daniel Nordlander, who worked on the combat of Dead Island 2; Doug Walker, a systems designer on multiple Killzone games and responsible for designing the brutal melee system; Berendine Venemans, a designer on Killzone: Shadowfall and Watchdogs; and Tom Bird who worked as a programmer on the Overlord series.

The previous article focussed on level design for melee combat systems ( read it here ). The last article will compare which of these has the most impact on the combat and how the contribution of level design to the engagement of the combat system can be increased (read it here).

Enemy Design

Well designed enemies are an important part of a melee combat system. Enemies are the challenge for players to overcome using the combat system. I will first explain enemy abilities, then the importance of ‘tells’ (ways of communicating that an enemy is about to attack), followed by the varied purposes of enemies, and enemies in games that include ranged combat.

Abilities

Enemies have at least one attack and often a way to defend themselves, although this varies between games. In some games enemies have only one attack while in other games enemies have multiple attacks with differing variables such as damage dealt; duration of the anticipation, hit frames, and cooldown; optional added affects when the player is hit; whether it interrupts the player’s attacks; and how the player can defend against it (i.e. can it be blocked or interrupted). Also, in some games enemies attack with a combo (a sequence of rapid attacks) while in others their main attacks consist of one hit. Which combination the game uses is generally taught to the player from the start of the game. This is important to set a players expectations and to teach them how to fight against enemies. Games that do not teach the player this progressively are significantly more difficult to learn, and this steep difficulty curve means that they generally appeal to a gaming audience that enjoys tough challenges.

Tells

In the games studied, enemies always have some kind of ‘tell’ that signifies that they are about to attack the player, and this is a key feature for the readability of the combat system. The tell allows players to recognize that the enemy is about to attack.

“You want the enemy usually to provide some kind of challenge, but you want the player to be able to read the enemy and respond to the enemy and to beat it.” – Tom Bird, Overlord

A tell gives players the opportunity to respond to the enemy’s attack in some way. How the player responds depends on the game and which attack the enemy is using; in general, the player can either try to avoid the attack, block the attack, or counter attack in some way.

Tells have to be clear and distinctive, especially if enemies have more than one attack. Stronger attacks from enemies usually also have more obvious tells, thus making it easier for the player to respond. The harder it is for players to read these tells, the more difficult the combat becomes, but the feeling that the player is being given a strong warning of an impending attack means that the combat feels more fair. In essence, ‘fairness’ is the key reason for the existence of tells in combat design.

In general the tell is the start of the enemy’s attack animation, which is also used to set the player’s expectations for the attack. Often extra effects, possibly colour coded, are added to this to make it more obvious to the player. Some games also include sound effects, for example DmC, but this is not common, especially for standard-strength attacks when compared to the less-common powerful attacks.

“[In Devil May Cry: DmC the developers] put a lot of emphasis on [tells]. [The attacking enemy first] gets into his preparation pose, then we would usually [have] a glint on the weapon and a sound effect and then as they’re about to swing they do another little second preparation and then they swing.” – Rahni Tucker, DmC

In DmC the team made the tells very clear because they wanted players to be able to dodge every attack. In some games these tells are hard to spot. In Ninja Gaiden 2, the only tell players get is the enemy moving towards the player, which is not easy to spot with enemies constantly running around. The difference in readability is clear when compared to Batman: AC, in which an icon flashes above an enemy who is about to attack, and which it is hard for players to miss. How tells are communicated to the player and their clarity varies greatly between games, and a key factor in differentiating a game’s appeal to its target audience.

Purpose

It is important that different enemies challenge the player in a variety of ways to keep them engaged with the game. Enemies are generally designed with a distinct purpose in mind and placed in varying categories. Nordlander explains he focussed on designing enemies around the player’s mechanics;

“You basically put in a challenge based on a mechanic that you already established before and that means that the tactic that you normally can use, you can’t use anymore, so it forces you to find a different way to take out the enemy.” – Daniel Nordlander, Dead Island 2

The other people I interviewed gave similar responses. They all focus on forcing the player into a different behaviour when fighting different enemies. In other words, a variety of enemies is necessary to provide a variety of challenges to the player.

Enemy Purposes

One way to categorize enemies is by their gameplay purposes. This splits enemies into “four major reoccurring roles: Emphasizers, Enforcers, Smashers and Challengers.”(Birkhead) Each of these roles describes the enemy’s function within the game and how the player should react to them.

Emphasizers are enemies which emphasize a certain mechanic. They encourage players to use specific attacks or abilities against them to defeat them, yet at the same time it is still possible to take them out by regular means.

Enforcers are enemies which force the player to use a specific mechanic to defeat them. This means the player can only defeat them using these specific mechanics, with the other mechanics having little or (more often) no effect.

Smashers are enemies which can easily be defeated and allow the player to have fun smashing them up.

Challengers are tougher enemies which are meant to challenge the player and test their skills.

These roles exist in most melee combat games. The Smashers are usually the enemies which are first introduced and form a basic challenge for the player. After new mechanics get introduced the games often introduce Emphasizers and Enforcers. These are meant to test the player’s skill in specific mechanics. An important part of Enforcers, and Emphasizers to a lesser extent, is that it must be clear to the player that specific attacks do not work against them. A good example of this is in DmC, where Frost Knights can only be damaged by angelic weapons. If the player attacks them with another weapon, the attack clearly deflects. Sulman explains he prefers Enforcers over Emphasizers:

“My personal preference is more explicit lock and key because it forces me to remember and it gives me much more satisfaction when I execute it.” – Alex Sulman, God of War

Enforcers force the player to remember how to fight them and give a feeling of satisfaction when doing it right. Emphasizers hold the danger of the player not knowing there is a better way to fight the enemy and causing the fight to drag on for too long. To mitigate this risk, it is important to communicate to players what to expect from a different enemy and how to best fight them.

Enemies are also split into different categories depending on their strength. Tucker explains that when they split the enemies into categories for DmC, “there [were] the fodder guys, and then there was the middle rank guys that were a little bit trickier but not super hard, and then you’ve got the more elite baddies and then of course you’ve got bosses on top of that.” This allowed them to give the player various levels of challenge. It also enabled them to show the player how much they progressed when putting them against the fodder enemies later in the game. They kept the groups evenly spread, with higher groups being smaller because they required more work to create.

“We try to keep our enemies specific and simple the exception to that was the very base grunt. You see them a lot so you need them to be able to handle a lot of different things.” – Alex Sulman, God of War

To facilitate this the skeleton enemy from God of War 3 came in three forms: regular, shielded, and golden-armoured. The combat becomes boring very quickly if the player is constantly doing the same thing. They used enemies to create moments in which the player is forced to analyse an encounter and to optimise their approach, which creates variety for the player and prevents them from getting bored. These analysis-decision making moments are key to providing variety in melee combat games.

Games that include Ranged Combat

In games that also include ranged combat there are often enemies that also do not focus on melee combat. Venemans explains that in Killzone “for some enemies it was easier to kill them with melee”. For most enemies melee combat was not paid specific attention to in their design, and only a few enemies were more focussed on this aspect. There was still focus on making sure each enemy was different from the other, yet this was mainly done by giving them a different gun. Their other abilities depended on the gun they were holding, for example whether they could take cover or what their melee attack looked like. In Dead Island 2 and The Last of Us most enemies only have melee attacks: this shows that, in games which include ranged combat, the focus on melee combat when designing the enemies varies between games; however, the same design methods still hold yet are applied to different mechanics.

“If it’s first person, it feels really unfair [if] you get [hit from off-screen resulting in] a one hit kill from a direction you don’t know.” – Doug Walker, Killzone

A lot of games that include ranged combat are played from a first person view, which causes additional problems for melee combat. This is why enemies generally do not melee the player in first person shooters. Nordlander explains they had a similar problem with Dead Island 2; however, they still wanted to give the player the feeling of being overwhelmed by zombies. They solved this by adjusting the damage:

“When you are hit outside your field of view you take less damage. With many enemies that you’re fighting at once every hit they do can’t be that punishing so you have a larger buffer already with how many hits you can take.” – Daniel Nordlander, Dead Island 2

For first person games it can quickly become frustrating for players to get killed by something they did not see coming, yet some games have demonstrated there are solutions to this problem.

How Enemy Design Promotes Player Engagement

As described above, there are a few ways in which enemy design can promote player engagement with melee combat systems.

“[For DmC] We put all the enemies in a big table with Dante’s moves to see if there is a nice spread for the player to use on the different enemies.” – Rahni Tucker, DmC

The most important part is variety between the enemies with each enemy posing a different challenge to the player. They are designed to encourage players to use different tactics against each enemy instead of killing each enemy the same way.

In summary enemies can be classified into Emphasizers, Enforcers, Smashers, and Challengers to describe their function in the game and how players should react to them. Tells are very important to communicate to the player that the enemy is about to attack and give them the opportunity to respond. How tells are communicated to the player varies between games. How clear the tells are influences the difficulty of the combat system.

Similar rules apply to games which include ranged combat, but when designing enemies for such games the other mechanics also have to be taken into account. As a result not all enemies are focussed on melee combat. This can vary greatly between different games. It is important to have varied enemies which have tells at the start of their attacks to keep the player engaged in the combat.

Enemy AI

The enemy AI controls how all enemies move around, attack, and respond to certain events (such as the player attacking). Besides the individual enemy AI, there is often also a group AI controlling which enemy attacks when. I will first explain enemy attacks, followed by enemy grouping, other enemy behaviour, the difference between regular enemies and bosses, and enemy AI for games which include ranged combat.

Enemies Attacking

In most of the games I looked at, an enemy attacks the player every two-to-three seconds on average. Enemies do not attack the player simultaneously or shortly after one another.

“[Enemy attacks are regulated] in order to prevent that chaos of just everyone attacking you at once” – Alex Sulman, God of War

This allows players to avoid attacks gives the opportunity to and attack the enemies themselves without being overwhelmed. This is important to prevent player frustration, leading to a sense of unfairness in the combat system; however, the player is attacked often enough to keep a sense of danger. The enemies will usually not attack the player while they are still in the stagger animation that is played when reacting to the previous enemy’s attack.

Multiple enemies attacking simultaneously makes it harder for the player to avoid all the attacks. Regulating the pace of the attacks prevents the fight from being to chaotic and become unreadable for the player, and thus feeling unfair.

“We always try to make it that enemies almost never attack you off screen, which is always really unsatisfying because it’s really hard to read.” – Alex Sulman, God of War

Usually enemies also do not attack the player from off screen. This means that enemies also have to be aware of what the camera can see. This is particularly strong for attacks where there is only a visual tell and no audio warning for the player, and so it becomes frustrating for players because they cannot respond to something they were not aware was coming. In God of War 3 enemies also try not to move between the player and the camera, which is easier as the game has fixed camera positions in each level. It is useful for enemy AI to take the camera into account to prevent frustrating the players.

In many games, enemies have multiple attacks. Which attack is used can depend on a variety of factors. In Ninja Gaiden 2, if the player is blocking the enemies can try to grab the player instead of using their regular attacks, or the enemies use ranged attacks when in a distant group. Enemies are often also aware of what other enemies are doing. In most games this variety is regulated by a context driven decision tree to choose which attack to use, with some randomness included to use stronger attacks more sparingly.

“We really wanted the combat encounters to have a lot of surprises, a lot of unexpected things to happen”. – Anthony Newman, The Last of Us

The enemy AI in The Last of Us constantly takes into account what other enemies are doing when deciding what they should do. This is also because enemies are able to help other enemies or ask other enemies for help.

In Aztez multiple enemies can attack the player simultaneously:

“We have attacks happening at the same time, it feels really thrilling, really aggressive, but you also have enough defence mechanics at your disposal that you can turn that into something that helps you out.” – Ben Ruiz, Aztez

He explains that once the players learn to use the parrying and counter system they will want enemies to attack often to be able to use these to the fullest. They split up enemy attacks into categories with each category of attacks hitting in a different area. In Aztez, multiple enemies will never use an attack from the same category at the same time. In this way we can see that the unusual decision of allowing multiple incoming attacks needed to be balanced with other choices in the combat design, and it is reasonable to argue that a similarly wide-ranging suite of design decisions would need to be implemented in other games if they were to use this system.

Enemy Grouping

In several games enemies were split into two groups around the player; one near group and one far group.

“There is an area around the player where we don’t want the enemies to go at all because when they are that close they crowd you and you can’t see what you are doing.” – Rahni Tucker, DmC

The near group are enemies which are close to the player and form an immediate threat, and it only consists of a few enemies. The far group are enemies which are further away from the player and contains all other enemies. This is very helpful in making sure that not too many enemies are close to the player and it helps both incentivise player movement and to make a small amount of AI enemies fill a space more effectively (with benefits for visual impact, framerate, etc.).

“The player doesn’t need to be able to see the two groups, when they are playing they are looking at their closest enemies for that threat.” – Rahni Tucker, DmC

Enemies constantly switch between the near and far group by moving around and by adjusting to the player’s movement. This grouping is also used to control who attacks the player. Only enemies from the near group actually attack the player, with enemies from the far group may sparingly use ranged attacks if they are capable of them. The tells of these later attacks are generally more obvious, because the player is usually focussing on the closer group.

Not all games group enemies this way but instead let them move around individually. Aztez has enemies trying to keep a set distance from the player, which varies between enemy types, and some also try to maintain a distance from other enemies. Since Aztez is a 2D game this still causes enemies to be spread around the player enough to not overwhelm the player.

The Last of Us only tries to tactically spread human enemies around the player. The infected move around individually and with less apparent intelligence, which allows them to swarm the player if they draw to much attention to themselves. The combat of The Last of Us is designed around one-on-one or one-on-two combat, and so it is deliberate that the player becomes overwhelmed when fighting more than two enemies at once. The challenge presented by mass-melee combat in The Last of Us is part of both the realistic aesthetic of the game, which derives from the aspects of survival-horror genre that influences the design, and a signifier of an intentionally cautious combat experience (which arguably indicates a non-casual target audience).

These examples illustrate that there are other possible ways to prevent enemies from overwhelming the player other than only carefully mixing the Emphasizer, Enforcer, Smasher, and Challenger functions, yet these decisions also need to be integrated with the rest of the combat system and overall intended experience.

Other Enemy Behaviour – Idles, Defence, Chasing

When enemies are not attacking they are often moving around the player, playing some idle animation to cheer on the other enemies, or taunting the player. This is very important to make it appear as if they are still participating in the fight instead of simply waiting for their turn to attack the player. Enemies also try to move around to be on screen (in view of the camera), or switch to the near group before attacking the player.

In some games enemies also have the ability to respond to the player’s attacks with a block, dodge, or counter attack. Blocking and dodging can help teach the player which attacks do not work against that specific enemy without punishing the player for using that attack. Enemies counter-attacking is a more clear, yet unforgiving, way to teach players the same thing. This also strongly increases the difficulty of the game and thus is rarely seen, or only present on higher difficulty settings.

As mentioned in the previous article ( read it here ), enemies usually try to follow the player when the player tries to leave the fight. This keeps players engaged with the fight and strongly encourages them to defeat the enemies. In linear games, such as the God of War series, enemies follow the player until they reach an obstacle they cannot overcome. In open world games enemies often follow a certain distance from their set patrol area or until the player gets far enough away from them. As mentioned in the previous article, in open world games it is acceptable, and sometimes intended, for players to escape enemies.

Regular Enemies Vs. Bosses

AI for bosses is different from AI for regular enemies and even mini-bosses which appear in different locations.

“You’re building AI to work anywhere and you’re building a boss to work somewhere.” – Alex Sulman, God of War

AI for bosses is designed specifically for the boss arena. Bosses can rely on the specific size and shape of the arena as well as on the position in which they appear. Regular enemies will be fighting the player in arenas of various sizes and shapes, spawning on various positions. As a result the AI for regular enemies cannot rely on these things and has to be more general.

AI in Games That Include Ranged Combat

The AI in shooters is generally focused on the shooting aspect of the gameplay. The melee part is usually always available to the player (except perhaps when carrying very heavy weapons), yet the AI might refrain from using it often.

“The core mechanic is about shooting, then you don’t actually need or want AI to get to close. The closer the AI [gets] to the player, the more stupid they look because they don’t have the animations to support what they’re thinking of doing or they don’t have the time frame to do it.” – Doug Walker, Killzone

In games that include ranged combat the AI also has to be able to handle the player using melee attacks and respond to these in a fun way. The AI has to be designed around all mechanics available to the player. It varies between games how much they take the melee combat into account, mainly depending on whether the enemies have melee attacks themselves, respond differently to melee attacks, and the importance of the melee system to the game. Destiny has integrated melee combat to be a key part of the experience, but many ranged combat games do not, and this choice varies depending on the intended player experience.

Melee combat design for first person games is a complex challenge of combining tells, feedback, and a strong sense of what is a viable distance from which to attack. Early leaders in this area were games such as Zeno Clash, Chronicles of Riddick, and the Aliens Versus Predator games (disclosure: the editor and contributing author to this piece was a designer on the 2010 AvP game). This is a large field that could be the subject to its own study, and has developed significantly in recent years, with titles such as Destiny and Dishonored providing strong examples of satisfying melee in first person gaming.

How Enemy AI Promotes Player Engagement

The enemy AI is important for the flow of melee combat as it controls the enemy behaviour.

It is important that the AI does not overwhelm the player or cause the fight to be chaotic and unreadable. To prevent this most games split up the enemy AI into a near group and a far group. The near group provides the player with an immediate threat, and these are the enemies that the player naturally pays most attention to. The far group contains all the other enemies which are either waiting to move to the near group or performing some idle action to give the illusion they are still part of the combat.

Most games have a slot system to control which enemy attacks when, which is also to prevent the enemies from overwhelming the player. Enemies often also try to move on screen before attacking the player to allow players to react to the attack.

Some games also have a chasing AI in place to keep the player engaged in the fight when they try to flee. In first person games this is harder to do which is solved by different games in different ways.

Games which include ranged combat also need the AI to respond to the melee combat, increasing the complexity of production for the development team. This sometimes causes the developers to create AI which avoids using melee attacks. How the AI functions varies between games, yet it always focuses on providing challenge for the player without overwhelming them.

Conclusion

The design of enemies, the selection of their attacks, behaviours, and AI patterns/responses is a complex task which is easily underestimated. This article provides a high-level view of some of the main areas that need to be taken into consideration when designing enemies in a melee combat game.

I hope you have enjoyed this article. It is the second article in a three part series. The first article in this series focuses on level design for melee combat systems ( read it here ). The next, and last, article in this series will be comparing the importance level design and enemy design in the context of creating a melee combat system (read it here). It will also be looking ahead for areas of improvement in this field.

If you have any feedback or comments, or simply liked this piece, please add a note below. Thank you for reading!

-----

About the writer: Bart Vossen is a designer looking for awesome companies to work with and can be contacted via http://bartvossen.weebly.com.

Editor and contributing author: Prof. Mata Haggis is the Associate Professor of Creative & Entertainment Games at NHTV University in Breda, The Netherlands. His own Gamasutra blogs can be read here: http://www.gamasutra.com/blogs/author/MataHaggis/889046. He is working on a playable interactive narrative experience (PINE) game called Fragments of Him (http://www.fragmentsofhim.com), and occasionally blogs about that on http://games.matazone.co.uk.