Sign inorRegister Site is for SALE!

Artificial stupidity: the art of deliberate mistakes

Everything should be stated as simply as possible, but not simpler.
 - Albert Einstein
To make the game entertaining and interesting, it is not necessary to make computer-controlled opponents smarter. In the end, the player must win. However, letting him win only because the manager of the opponents of AI is badly designed, is also unacceptable. Interest in the game can be increased if the mistakes made by the enemy are intentional. Carefully adjusting the mistakes of opponents, making them intentional, but believable, programmers will allow opponents to look smart and at the same time ensure the victory of the player. In addition, by monitoring AI systems and appropriately controlling them, you can turn situations in which opponents look silly into an interesting gameplay.

A common mistake in the development and implementation of AI systems in computer games is in too complex a design. The AI ​​developer can easily get carried away by creating an intelligent game character and losing sight of the ultimate goal, namely, creating an entertaining game. If a player has the illusion that a computer opponent is doing something clever, then it does not matter how the AI ​​(if any) creates this illusion. A sign of a good AI programmer is the ability to resist the temptation to add intelligence to where it is not needed, and to recognize situations in which more "cheap" and simple solutions are enough. Programming AI is often more like art than science. The ability to distinguish between moments in which cheap tricks are enough, and those where more complicated AI is required, is not easy. For example, a programmer, having full access to all structures of game data, can easily cheat by making the NPC omniscient. NPCs can know where the enemies are, where the weapons or ammunition lies, without seeing them. However, players often recognize such cheap stunts. Even if they can not determine the very nature of cheating, they may have a feeling that the behavior of the NPC is not like the natural.
A few tricks
It's pretty simple to create an NPC that can defeat a live player. It is much more difficult to create one that can lose a player in a tense battle. The difficulty is to show the player the skills of the NPC, but at the same time give the player a chance to win. Below are a few tricks that allow the game to show the intelligence of the NPC and provide an interesting gameplay. These tricks are mainly designed for first-person shooters (FPS), but some are applicable in other genres.
First move, then shooting
Nothing annoys more than instantaneous death from the hand of a computer opponent immediately after entering a new room or area. The player, getting to a new place, is likely to be overwhelmed by impressions from new textures, new objects, new geometry. The task of recognition among the background textures of the enemy's unique textures is not very much fun. This is especially true now, when budgets for creating polygonal models and textures have grown significantly. All NPC attacks occurring at such moments are very upsetting. We must strive to avoid such methods with all our might. In such situations, the player does not know about the future dangers and in no way can understand where he is shot.


The simplest way to reduce player irritation: when the enemy sees the player, he must start moving, and not shoot at him. Force the NPC before the attack to escape from the vulnerable open position to the shelter to warn the player of the starting combat. In the situation with several opponents, only one of them is enough, while the other NPCs can simply wait before attacking the player.

Telling a player about the upcoming fight is especially important in action-adventure games and FPS, because they usually consist of two main game modes. The player is either in the research mode / solving puzzles, during which there are not or almost no fights, or actively participates in the battle. Warning players that they go into combat mode, is vital for the game process. The player must switch from a slow, relaxed gameplay mode to a faster one.
Be visible
Although in real combat, opponents tend to be as invisible as possible, in the game world, excellent camouflage creates bad gameplay. Looking at pixels in search of opponents is not a very interesting process. Make NPC textures contrasting with the background, so that the player quickly discovers the enemies and proceeds to the present game process. On the uniform of opponents can be similar to camouflage patterns, but their color and brightness should strongly contrast with the environment.
Do not be a sniper
Active skirmishes are good, they force the player to move and create tension, thus increasing the pace of the game. But they are unpleasant when a player dies too fast. The simplest way to make an NPC stupider and accelerate the pace of the game is to give computer opponents a hit point. Thanks to this, you can use active skirmishes, without making the game too complicated for the player. The FPS often uses a spread of bullets up to 40 degrees.

Or you can reduce the complexity of the game, reducing the damage from enemy bullets. However, some additional advantages of poor sighting are lost. One of the random consequences of a bad aiming is the tension that occurs when tracer bullets fly over the player's head, clouds of concrete dust or a spark from bullets that hit the wall next to the player. In addition, a blunder reward player: players often feel close misses confirming the correctness of the chosen tactics of movement.

Hit the first time
For weapons that deal big damage (for example, killing with one or two hits), something more is required. Usually it is not very interesting for the player to suddenly and unexpectedly get big damage. In such situations, players often feel cheated. You can reduce the irritation, deliberately missed the player for the first time. This gives the player a second to react, and maintains a high level of stress.

In addition, the intentional first misses can be strategically placed. One of the most annoying aspects of the shots to the player in the back is that the player does not understand where they shot him from. In some FPS, we tried to reduce this problem by adding hints on the screen (for example, flickering red icons) showing the direction of the attack. Such hints (usually perceived as part of the user interface) destroy the illusion of reality and are surprisingly not as obvious to the player as you might expect.

Intentional misses, especially when shooting from behind, can reduce this problem, indicating the direction of the attack, while not destroying the illusion of reality. A laser beam or a tracer bullet that strategically hits the floor or wall right in front of the evading player shows the direction from which the attack is taking place. In addition, information about the direction transmitted by laser beams or tracers is much more informative than simple flickering screen prompts. They allow the player to react more correctly to the attack.

Another valuable way to use intentional misses is to hit certain environment objects. For example, when a player approaches a barrel of water, a porcelain statue or a glass vase, the enemy instead of aiming at the player is better at aiming at the nearest object to be destroyed, the one that falls most dramatically is best. Do not forget - the goal of a good AI programmer is not to kill the player, but to create tension.

The last, more complex way of using intentional misses - they allow the designer to guide the player. Thoughtfully arranged bullets, flying next to the player, the designer can push the player to move in the right direction.
Warning Player
Another effective way to increase the enjoyment of the game is to warn the player before an attack. It can be implemented visually, reproducing a short animation of preparation for an attack, or audially, playing a sound (peep, click, etc.) or shouting "Gotcha!" Or "Get it!". Sound tips are especially important when a player is attacked from behind. They give the player a chance to react to the attack, so that he does not feel cheated.

Since people in real combat never stop to warn their enemies, you might think that because of this, computer opponents will look more stupid. On the contrary, such warnings can be used to draw attention to other, more noteworthy aspects of AI. For example, a smart NPC can be programmed to search for enemy bypass routes from the flank or to locate ambush sites [Lidén02]. If players immediately die after ambush, they will not be able to appreciate all the sophisticated tactics of the enemy. Intellectual behavior will be more noticeable if the NPC issues a warning sound so that the player has time to turn around and see the NPC's hiding place in an ambush cleverly chosen for the ambush. If the NPC in the ambush constantly kills the player, the game will no longer be fun. Warning the players, you give them time to see the AI ​​mind and react to its behavior without dying.

Another advantage of sound prompts is that the player quickly learns to react to certain sounds, if they are unchanged [Madhyastha95]. For example, if a particular phrase ("Gotcha!") Precedes the attack, after several such cases, the sound will cause the player to physically react. This conditional behavior can significantly increase the intensity of the game. Moreover, if the phrase "Gotcha!" Is used only when the enemy applies a certain AI combat strategy (for example, understands how to get around the player from the flank), then having seen several times the combination of flanking maneuver and shout "Gotcha!", In the future the player will expect a complex bypassing the flank, even if it does not see it.
Attack in the style of "kung fu"
In many games, the player is in the role of "Rambo" (in other words, alone confronts the whole army). Although in many genres mowing crowds of enemies in one burst is quite acceptable, opponents in such games are like defenseless lambs with very weak artificial intelligence. However, if our opponents are intelligent, then the battle with several of them is simultaneously too complicated for the player. On the other hand, more enemies create an interesting and dynamic gameplay.

The solution is to design battles in the style of "kung fu". In other words, even if there are several NPCs next to the player, only a pair attacks it. Others are engaged in recharging weapons, hiding or changing positions. None of the opponents should stay in one place for too long, even if the current position provides a good position for the attack. Changing roles in the attack and constantly moving, the opponents create an active combat situation in which the player is confronted by many enemies, but only a few attack him. Surprisingly, the players encountered with this situation usually do not realize that they are simultaneously actively attacked by not more than two opponents, even if the battle is with a large group of enemies.
Tell the player what you are doing
When a player sees the actions of the NPC, it is sometimes difficult for them to interpret them. Will the running enemy hide, call for reinforcements, go around the flank or just run without any purpose, trying not to run into a bullet? Complex behavior of the NPC often eludes the player. When this happens, the entire work of the AI ​​developer goes to rubble. An effective way to deal with this complexity is to literally tell the player what AI is doing. For example, when performing an action, the enemy may shout to his associates, "I walk from the flank!", "Cover!", Or "I retreat!". Such tips can have very high efficiency and often give a side effect: players assume the presence of intelligence where it does not exist.
Respond to errors
Even the most sophisticated AI systems are wrong, it's inevitable. If you approach the errors incorrectly, then the NPCs will seem dull. Having recognized the origin of the error and having reacted wisely to it, you not only keep the illusion of the intellect, but also turn the mistakes into special features.

Consider the calculations necessary to accurately defeat the target. In a rich 3D world with moving objects (including other NPCs and the player), in spite of all the complex physical calculations, mistakes inevitably occur. The grenade jumps from the object or another NPC and falls to the feet of the abandoned NPC. (Do not forget that players also sometimes make this mistake!)

If we just let the NPC stand and wait for the explosion, the AI ​​will seem pretty pathetic. However, if we recognize the error, we will be able to respond appropriately to it. If an abandoned grenade NPC covers his head, demonstrates surprise and / or fear, "No-e-em!" Shouts, then it no longer looks like an AI error. Now the error has turned into a feature, it adds NPC personality, and the game has a bit of humor and interesting variability.

Retreat at the last moment
The task of the AI ​​system is to create an interesting and intense gameplay for the player. Ideally, the player should have a sense of complexity, cornering, but as a result he still has to win. One way to implement it is to build in the "pushing to the edge" into the AI ​​architecture itself. In this model, NPCs actively attack the player almost to the death. The player's scores are carefully monitored to ensure that his health or resources are almost completely depleted, but not to the end. When the player reaches the limit, the AI ​​retreats, attacks less efficiently, and it becomes easier to kill. After the victory such a situation is perceived by the player as a real feat. However, with this approach, the developer must be very careful that the players do not understand that they are manipulated in this way. If this trick can be recognized, it uniquely destroys the sensations of the game process.
Intended vulnerabilities
Players learn to focus on the weaknesses of the opponent, even if they occur unintentionally. Therefore, instead of allowing the player to find such vulnerabilities, it is often better to integrate them into NPC behavior. For example, a running NPC may need to stop and prepare a weapon, that is, it takes more time to attack than a stationary one. The enemy, who was attacked from behind, can be caught unawares and react more slowly. Adding imperfections to NPC behavior can also make them more realistic and give them personality. For example, when recharging an NPC, it can sometimes last longer. An enemy who knows how to avoid min-traps may accidentally run into one of them. The planned vulnerabilities make computer-controlled characters more realistic. Unintentional errors destroy realism. To properly select the balance requires a thorough testing of the game process (playtesting).
The most important tool of the AI ​​programmer is the playlisting. Even for a developer with many years of experience in creating AI, testing the game process is the only reliable way to determine when to use "cheap" solutions, and when to use more sophisticated techniques of artificial intelligence. Do not underestimate the importance of the reactions of inexperienced testers to AI. Even experienced AI developers are often surprised by the results of playtelling and interpretation invented by players.

The choice of testers is a critical process. Pleit testers should in no case be members of the game development team and it is better that they are in no way connected with the game development industry.

Any knowledge of the techniques and tricks of developing artificial intelligence can affect the interpretation of events by the playtest. Secondly, there should be a lot of playtests. There are two reasons for this. First: after making changes to AI, a new set of players-beginners is required. Reusable playtesters are prone to prejudices inspired by the previous version of AI. Their interpretation of NPC behaviors and game techniques will differ from the perception of newcomers. Second: since the skills of players are very different, you need a large number of playtests. Perhaps the only one of the thirty tester will be able to find the critical weakness of AI, because of which NPCs look stupid or they are easy to kill. When tested by a small team of players, the AI ​​may look flawless, but prove to be a failure after the game has entered the big market.

Plateting should be carried out throughout the development process, and not only at the end of production. Recognizing the factors that affect interest and tension is a complex and lengthy process. Plan that you have to reject ideas several times and start from scratch. In addition, it is important to allow some of the playtesters to test the game throughout the development process. Players are better able to learn in the game and are more likely to find loopholes in implementing AI. In addition, after a long game they will learn to recognize the AI ​​tricks.

There should be many observers on each playlist. During the game, observers make notes about the player's in-game activities, about his physical reactions, such as posture and facial expression. You should also write down the questions you need to ask the playtist, but you should ask questions only after the game process is over. It is important that observers do not say anything during the playtest, even if the players have difficulties.

After the completion of the game process, you need to interview the testers to find out their reaction to the game. It is important to determine what happened in the opinion of the player, and not what was realized in the AI. Often, players assume that they have complex behavior where they do not exist. And vice versa - players miss the complex behavior of AI. Ask the playtist about the actions and intentions of the NPC. Try not to ask leading questions. In advanced game engines there is a recording mode in which you can show the player a repeat of the game process session and ask him questions about his actions.
A few examples
The standard error of AI developers is the overcompliance of the design. Often a much simpler solution is enough, and cheap, but inventive solutions are much better. For example, programmers often override the design when developing tactics for squads. A complex exchange of information and interaction between fighters is often not noticed by the player, and therefore not necessary. Valve's Half-Life game [Valve98] has an impressive example of how simple behaviors can create rich gameplay that makes players assume intelligent behavior.

Paratroopers in Half-Life use the style of battle "kung fu": regardless of the number of paratroopers with which the player fights, in fact simultaneously it is allowed to shoot a maximum of two at the same time. Between the paratroopers, in fact, there is no communication. Instead, each group of fighters is given two attack slots. If the paratrooper wants to attack, but both slots are full, then he finds another occupation (for example, recharging the weapon or moving to a new position for the attack). When one of the attacking paratroopers run out of ammo, it releases the attack slot and switches to the search and recharge behavior. Then one of the non-attacking paratroopers detects an empty slot, takes it and starts shooting at the player.


Added another simple rule: when the attack slot is released, and in battle there are several paratroopers, then the attacking slot firing the fighter shout "Cover me!". Although there is no communication between these paratroopers, the player perceives this as follows: one of the fighters asks to cover it, and the second one opens the cover of the fire. In reality, the attack slot is released and is occupied by another paratrooper, who knows nothing about recharging the first one.

During the pleating, it was found that when a player throws a grenade into an NPC group, the Half-Life search algorithm can not find the escape route for all NPCs. The behavior of the remaining NPCs looked extremely blunt, they rushed around, trying to find a way out. Instead of reworking the path-finding system (a difficult task), Valve decided to detect the problem and reproduce a special animation of the trapped paratroopers - they crouched and covered their heads with their hands. This behavior was very well received by the playtesters, because it added a character game.
This article discusses important concepts. The efforts of developers in the field of artificial intelligence are so often focused on making computer opponents smart, that they neglect the adequate perception of how AI makes the game interesting. The task of a complex AI is not to kill the player, but to add tension, control the pace of the game and give the computer characters personality. Simple solutions are often better and more interesting than complex artificial intelligence. By adding intentional vulnerabilities to NPC behavior, we force the player to pay attention to the planned weaknesses of the AI, rather than look for unintended ones. This article also describes various tricks for AI systems to maximize the entertainment factor. In addition, do not assume that the years of development of AI systems can replace thorough testing of the game process.
[Lidén02] Lidén, Lars, "Strategic and Tactical Reasoning with Waypoints," AI Game Programming Wisdom, Charles River Media, 2002.
[Madhyastha95] Madhyastha, Tara and Reed, Daniel, "Data Sonification: Do You See What I Hear?" IEEE Software, Vol. 12, No. 2, 1995.
[Valve98] Valve LLC, "Half-Life," 1998. See .
MeLavi 29 september 2017, 12:02
Vote for this post
Bring it to the Main Page


Leave a Reply

Avaible tags
  • <b>...</b>highlighting important text on the page in bold
  • <i>..</i>highlighting important text on the page in italic
  • <u>...</u>allocated with tag <u> text shownas underlined
  • <s>...</s>allocated with tag <s> text shown as strikethrough
  • <sup>...</sup>, <sub>...</sub>text in the tag <sup> appears as a superscript, <sub> - subscript
  • <blockquote>...</blockquote>For  highlight citation, use the tag <blockquote>
  • <code lang="lang">...</code>highlighting the program code (supported by bash, cpp, cs, css, xml, html, java, javascript, lisp, lua, php, perl, python, ruby, sql, scala, text)
  • <a href="http://...">...</a>link, specify the desired Internet address in the href attribute
  • <img src="http://..." alt="text" />specify the full path of image in the src attribute