Back to Home

Artificial Stupidity: The Art of Intentional Mistakes

artificial intelligence · game design · artificial intelligence · playtesting · playtests

Artificial Stupidity: The Art of Intentional Mistakes

Original author: Lars Lidén
  • Transfer
image

Everything should be stated as simple 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 AI’s opponent manager is poorly designed is also unacceptable. Interest in the game can be increased if the mistakes made by the opponent are intentional. By 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 tracking AI systems and managing them accordingly, you can turn situations in which opponents look stupid into an interesting gameplay.

A common mistake in the development and implementation of AI systems in computer games is too complex design. An AI developer can easily get carried away with creating a smart game character and lose sight of the ultimate goal, namely the creation of an entertaining game. If the player has the illusion that the computer opponent is doing something smart, it doesn’t 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 the recognition of situations in which “cheaper” and simpler solutions are enough. AI programming is often more like art than science. The ability to distinguish between moments in which enough cheap tricks and those where more complex AI is required is not easy. For example, a programmer, Having full access to all game data structures, it can easily cheat, making NPC all-knowing. NPCs can know where the enemies are, where the weapons or ammunition are, without seeing them. However, players often recognize such cheap tricks. Even if they cannot determine the very nature of cheating, they may have the feeling that the behavior of NPCs is not natural.

Some tricks


It’s quite simple to create an NPC that can defeat a live player. It is much more difficult to create one that can lose the player in a tense battle. The difficulty is to demonstrate the NPC skills to the player, but at the same time to let the player win. Below are a few tricks that allow the game to show NPC intelligence and provide interesting gameplay. These tricks are mainly designed for first-person shooter (FPS), but some are applicable in other genres.

First movement, then shooting


Nothing is more annoying than instant death at the hands of a computer adversary immediately after falling into a new room or area. A player, getting into a new place, will most likely be overwhelmed with impressions of new textures, new objects, new geometry. The task of recognizing among the background textures the unique textures of the enemy is not a very great pleasure. This is especially true now that budgets for creating polygonal models and textures have grown significantly. All NPC attacks that occur at such times are very upsetting. We must strive to avoid such tricks by all means. In such situations, the player does not know about impending dangers and in no way can understand where they are shooting at him.

image

The simplest way to reduce a player’s irritation is when the enemy sees the player, he should start moving, not shoot him. Get the NPC to flee from a vulnerable open position for cover before an attack in order to warn the player of a starting battle. In a situation with several opponents, only one of them is enough, while other NPCs can just wait before attacking a player.

Prompting a player about an upcoming battle is especially important in action-adventure games and FPS, because they usually consist of two main game modes. The player is either in research / puzzle solving mode, during which there are no or almost no fights, or is actively involved in the battle. Warning players that they are entering combat mode is vital to the gameplay. The player must switch from a slow, relaxed gameplay mode to a faster one.

Be noticeable


Although in a real battle, opponents tend to be as invisible as possible, in the game world, excellent camouflage creates poor gameplay. Looking at pixels in search of opponents is not a very interesting process. Make the NPC textures contrasting with the background so that the player quickly detects enemies and moves on to the real game process. The opponents' uniforms may have camouflage-like patterns, but their color and brightness should strongly contrast with their surroundings.

Don't be a sniper


Active firefights are good, they make the player move and create tension, thus increasing the pace of the game. But they are unpleasant when a player dies too fast. The easiest way to make NPCs dumber and to speed up the pace of the game is to give downed sights to computer opponents. Thanks to this, you can use active skirmishes without making the game too difficult for the player. FPS often uses bullet scatter up to 40 degrees.

Or you can reduce the complexity of the game by reducing damage from enemy bullets. However, some additional advantages of poor aiming are lost. One of the random consequences of poor aiming is the stress that occurs when flying tracer bullets fly over a player’s head, clouds of concrete dust or a spark from bullets hitting a wall next to the player. In addition, a miss rewards the player: players often consider close misses as confirmation of the correctness of the chosen tactics of movement.

image

Miss the first time


For a weapon that does a lot of damage (for example, kills with one or two hits), something more is required. Usually a player is not very interested in suddenly and unexpectedly taking a lot of damage. In such situations, players often feel cheated. You can reduce irritation by deliberately missing the player for the first time. This gives the player a second to react, and maintains a high level of stress.

In addition, intentional first misses can be placed strategically. One of the most annoying aspects of shooting a player in the back is that the player does not understand where they shot him from. Some FPS tried to reduce this problem by adding on-screen prompts (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 by indicating the direction of attack, while not destroying the illusion of reality. A laser beam or tracer bullet that hits the floor or wall right in front of the runaway player indicates the direction from which the attack is taking place. In addition, directional information transmitted by laser beams or tracers is much more informative than simple flickering on-screen prompts. They allow the player to respond more correctly to the attack.

Another valuable way to use intentional misses is to get into certain objects of the environment. For example, when a player approaches a water barrel, a porcelain statue or a glass vase, instead of firing a shot at an opponent, the enemy is better to take aim at the object to be destroyed that is closest to it, the best one that is falling apart most dramatically. Do not forget - the goal of a good AI programmer is not to kill the player, but to create tension.

The last, more complicated way to use intentional misses - they allow the designer to guide the player. By carefully positioning the bullets flying next to the player, the designer can push the player to move in the right direction.

Warn player


Another effective way to increase the enjoyment of the game is to warn the player before the attack. It can be implemented visually, reproducing a short animation of preparation for an attack, or audibly, by playing a sound (squeak, click, etc.) or shouting “Gotcha!” or "Get it!". Sound prompts are especially important when a player is attacked from behind. They give the player a chance to respond 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 dumber. On the contrary, such warnings can be used to draw attention to other, more remarkable aspects of AI. For example, a smart NPC can be programmed to search for enemy flank routes or find ambush locations [Lidén02]. If the players immediately die after an ambush, then they will not be able to evaluate all the sophisticated tactics of the enemy. Intelligent behavior will be more noticeable if the NPC emits a warning sound, so that the player has time to turn around and see the NPC hiding in a smartly chosen ambush spot. If an NPC in an ambush constantly kills a player, the game will no longer be fun. Warning players

Another advantage of sound prompts is that the player quickly learns to respond to certain sounds if they are unchanged [Madhyastha95]. For example, if a specific phrase (“Gotcha!”) Precedes the attack, after several such cases, the sound will cause the player a physical reaction. This conditional behavior can significantly increase the intensity of the game. Moreover, if the phrase "Gotcha!" It is used only when the enemy uses a certain AI combat strategy (for example, understands how to get around the player from the flank), then after seeing several times the combination of the flank maneuver and the scream “Caught!”, in the future the player will expect a difficult evasion from the flank, even if he does not see it .

Kung Fu Style Attack


In many games, the player is in the role of "Rambo" (in other words, alone confronts an entire army). Although in many genres mowing crowds of enemies in one turn is quite acceptable, opponents in such games are like defenseless lambs with very weak artificial intelligence. However, if our opponents are smart, then a fight with several of them at the same time is too difficult for the player. On the other hand, more enemies create an interesting and dynamic gameplay.

The solution is to design kung fu fights. In other words, even if there are several NPCs next to the player at the same time, only a couple attacks him. Others are engaged in reloading weapons, hiding or changing their position. None of the opponents should remain in one place for too long, even if the current position provides a good position for attack. Changing roles in the attack and constantly moving, the opponents create an active combat situation in which the player is opposed by many enemies, but only some attack him. Surprisingly, players who encounter such a situation usually do not realize that no more than two opponents are actively attacking them at the same time, even if the battle is with a large group of enemies.

Tell the player what you are doing.


When a player sees NPC actions, it is sometimes difficult for them to interpret them. Will the running enemy hide, call for reinforcements, avoid the flank, or just run away without any goal, trying not to run into a bullet? Complex NPC behavior often eludes the player. When this happens, all the work of the AI ​​developer goes to waste. An effective way to deal with this difficulty is to literally tell the player what the AI ​​is doing. For example, when performing an action, an adversary may shout to his associates “I’m going around from the flank!”, “Cover!”, Or “I’m retreating!”. Such hints can have very high efficiency and often give a side effect: players assume the presence of intelligence where it is not.

Respond to mistakes


Even the most sophisticated AI systems are wrong, this is inevitable. If you approach errors incorrectly, then NPCs will seem dumb. Recognizing the occurrence of an error and reacting wisely to it, you will not only maintain the illusion of intelligence, but also turn errors into particulars.

Consider the calculations necessary to accurately hit the target. In a rich 3D world with moving objects (including other NPCs and a player), despite all the complex physical calculations, errors inevitably arise. A grenade bounces off an object or other NPC and falls at the feet of the NPC who threw it. (Do not forget that players also make this mistake sometimes!)

If we just let the NPC stand and wait for the explosion, then the AI ​​will seem pretty pathetic. However, if we recognize the error, we will be able to respond to it accordingly. If the NPC throwing a grenade covers his head, demonstrates surprise and / or fear, shouts “No-no!”, Then this no longer looks like an AI error. Now the mistake has turned into a feature, it adds NPC personality, and a little humor and interesting variation appear in the game.

image

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, cornered, but as a result, he should still win. One way to implement it is to embed a “push to the edge” into the AI ​​architect itself. In this model, NPCs actively attack the player almost until his death. Player performance is carefully monitored so that his health or resources are almost completely depleted, but not completely. 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 so that the players do not understand that they are being manipulated in this way. If this trick can be recognized, it definitely destroys the sensations from the gameplay.

Intentional Vulnerabilities


Players learn to focus on the weaknesses of the enemy, even if they arise unintentionally. Therefore, instead of allowing the player to find such vulnerabilities, it is often better to embed them in NPC behavior. For example, a running NPC may need to stop and prepare a weapon, i.e. it takes more time to attack than a stationary one. An adversary attacked from behind may be taken by surprise and respond more slowly. Adding imperfections to the behavior of NPCs can also make them more realistic and give them personality. For example, when recharging, the NPC can sometimes take longer. An enemy who knows how to avoid min-traps can accidentally run into one of them. Planned vulnerabilities make computer-controlled characters more realistic. Unintentional errors destroy realism.

Playtesting


The most important AI programmer tool is playtesting. Even for a developer with many years of experience creating AI, gameplay testing is the only reliable way to determine when you can use “cheap” solutions and when to use more sophisticated artificial intelligence techniques. Do not underestimate the importance of inexperienced AI testers' reactions. Even experienced AI developers are often surprised by the results of the playtesting and interpretations invented by players.

The selection of testers is a critical process. Under no circumstances should play testers be members of the game development team, and it is better that they are not connected in any way with the game development industry.

Any knowledge of AI techniques and tricks can affect the interpretation of events by the play tester. Secondly, there should be a lot of play testers. There are two reasons for this. First: after making changes to the AI, a new set of new players is required. Reusable play testers are subject to the prejudices inspired by the previous version of AI. Their interpretation of NPC behaviors and game techniques will differ from those of beginners. Second: since the skills of the players are very different, a large number of play testers are needed. Perhaps the only one out of thirty testers will be able to find a critical AI weakness that makes NPCs look stupid or easy to kill. When tested by a small team of players, AI may look flawless, but fail if the game enters a large market.

Playtesting must be carried out throughout the development process, and not just at the end of production. Recognizing factors affecting interest and tension is a complex and lengthy process. Plan that you have to drop ideas several times and start from scratch. In addition, it is important to let some of the play testers test the game during the entire development process. Players are better at mastering the game and are more likely to find loopholes in the implementation of AI. In addition, after a long game, they will learn to recognize AI tricks.

There should be a lot of observers at every playtest. During the game session, observers make notes about the player’s in-game actions, his physical reactions, such as posture and facial expression. You should also write down the questions that need to be asked to the player, but questions should be asked only after the completion of the game process. It is important that observers do not say anything during the playtest, even if players have difficulty.

After completing the gameplay, you need to interview testers to find out their reaction to the game. It is important to determine what happened according to the player, and not what was implemented in the AI. Often, players assume complex behavior where it does not exist. And vice versa - players are missing out on complex AI behavior. Ask the play tester 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 gameplay session and ask him questions about his actions.

A few examples


A common mistake made by AI developers is to re-design. Often a much simpler solution and cheaper, but inventive solutions are much better. For example, programmers often overcomplicate design when developing squad tactics. Complex exchange of information and interactions between fighters are often not noticed by the player, and therefore are optional. Valve's Half-Life game [Valve98] has an impressive example of how simple behaviors can create rich gameplay that forces the player to assume intelligent behavior.

The paratroopers in Half-Life use the “kung fu” fighting style: regardless of the number of paratroopers the player is fighting with, in fact, a maximum of two are allowed to shoot at the same time. There really is no communication between the paratroopers. Instead, each unit of fighters is given two attack slots. If the paratrooper wants to attack, but both slots are full, then he finds himself another occupation (for example, reloading weapons or moving to a new position for attack). When one of the attacking paratroopers runs out of ammunition, it releases the attack slot and switches to search and reload behavior. Then one of the non-attacking paratroopers discovers an empty slot, occupies it and starts shooting at the player.

image

Another simple rule has been added: when the attack slot is released, and there are several paratroopers in the battle, the fighter releasing the attack slot shouts “Cover me!”. Although no communication occurs between these paratroopers, the player perceives it this way: one of the fighters asks to cover him, and the second opens a covering fire. In reality, the attack slot is freed up and engaged in another paratrooper who does not know anything about reloading the first.

During the playtest, it was discovered that when a player throws a grenade at an NPC group, the Half-Life path search algorithm is not able to find an escape path for all NPCs. The behavior of the remaining NPCs looked extremely dumb, they darted around, trying to find a way out. Instead of reworking the path finding system (a difficult task), Valve decided to detect the problem and play a special animation of the paratroopers trapped - they squatted and covered their heads with their hands. This behavior was very well accepted by play testers, because it added character to the game.

Conclusion


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 an 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 personality to the computer characters. 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 AI, and not to look for unintentional ones. This article also describes various tricks for AI systems to maximize the entertainment factor. In addition, you should not assume that years of development of AI systems can replace thorough testing of the gameplay.

References


[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 www.valvesoftware.com

Read Next