📜 ⬆️ ⬇️

Artificial stupidity: the art of intentional mistakes

image

Everything should be stated as simply as possible, but not simpler.
- Albert Einstein

For the game to be entertaining and interesting, it is not necessary to make computer-controlled opponents smarter. In the end, the player must win. However, to allow him to win only because the manager of AI opponents is poorly designed is also unacceptable. Interest in the game can be increased if the mistakes made by the enemy are intentional. By carefully setting 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, tracking the AI ​​systems and controlling them accordingly 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 too complex design. It is easy for an AI developer to get involved in 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 clever, then it doesn't matter how the AI ​​(if it exists) creates this illusion. The hallmark 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 “cheaper” and simple solutions are sufficient. AI programming is often more like art than science. The ability to distinguish moments in which fairly cheap stunts, and those that require more complex AI, is not easy. For example, a programmer, having full access to all game data structures, can easily cheat, making the NPC all-knowing. NPCs can know where the enemies are, where weapons or ammunition are lying, without seeing them. However, players often recognize such cheap tricks. Even if they cannot determine the very nature of cheating, they might get the feeling that the behavior of the NPC is not similar to the natural one.

Few tricks


It’s pretty easy to create an NPC capable of defeating a live player. It is much more difficult to create one that can lose to a player in a tense battle. The difficulty is to demonstrate the skills of the NPC player, but at the same time give the player 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 movement, then shooting.


Nothing is more annoying than an instant death at the hands of a computer opponent immediately after entering a new room or area. A player getting into a new place is likely to be overloaded with impressions of new textures, new objects, new geometry. The task of recognition among the background textures of the unique textures of the enemy is not a very great pleasure. This is especially true now that the budgets for creating polygonal models and textures have increased significantly. All NPC attacks occurring at such moments are very distressing. It is necessary by all means to strive to avoid such techniques. In such situations, the player does not know about the future dangers and in no way can he understand where he is being shot at.

image

The easiest way to reduce player irritation: when an enemy sees a player, he should start moving, not shoot him. Force the NPC to flee from the vulnerable open position to the shelter before the attack in order to warn the player about the beginning of the fight In a situation with several opponents, only one movement is enough, while other NPCs can simply wait before attacking a player.

Telling the 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 mode of research / solving puzzles, during which there are few or no battles, or is actively involved in the battle. Warning players that they go into battle mode, is vital for the gameplay. The player must switch from a slow, relaxed gameplay mode to a faster one.

Be noticeable


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 the NPC textures contrasting against the background, so that the player detects enemies faster and moves on to the actual game process. On the uniform of opponents may be similar to camouflage patterns, but their color and brightness should contrast strongly with the environment.

Don't be a sniper


Active shootouts 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 quickly. The simplest way to make NPCs stupid and to accelerate the pace of the game is to give computer opponents downed sights. Because of this, you can use active shooting, without making the game too difficult for the player. FPS often uses bullet spreads up to 40 degrees.

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

image

Miss the first time


For a weapon that deals a lot of damage (for example, killing with one or two hits), something more is needed. 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 blunders can be positioned strategically. One of the most annoying aspects of shots to a player in the back is that the player does not understand where he was shot from. In some FPS, they tried to reduce this problem by adding on-screen prompts (for example, flickering red icons), showing the direction of the attack. Such prompts (usually perceived as part of the user interface) destroy the illusion of reality and are surprisingly not as obvious to the player as might be expected.

Intentional blunders, especially when firing from behind, can reduce this problem, indicating the direction of the attack, without destroying the illusion of reality. A laser beam or tracer bullet that strategically hits a floor or wall directly in front of the player who is running away, indicates the direction from which the attack is taking place. In addition, directional information transmitted by laser beams or tracer is much more informative than simple flickering screen prompts. They allow the player to more correctly respond to the attack.

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

The last, more complex way to use intentional blunders is to allow the designer to guide the player. Having thoughtfully arranged the bullets flying near the player, the designer can push the player to move in the right direction.

Warn Player


Another effective way to increase game enjoyment is to warn a player before an attack. It can be realized visually, playing a short animation of preparation for an attack, or audially, playing a sound (peep, click, etc.) or shouting “Gotcha!” Or “Get!”. Sound prompts 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 deceived.

Since people in real combat never stop to warn their enemies, you might think that computer opponents will look more stupid because of this. 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 routes to take an enemy from the flank or to find places for an ambush [Lidén02]. If the players die in the ambush immediately die, they will not be able to appreciate all the sophisticated tactics of the enemy. Intellectual behavior will be more noticeable if the NPC makes a warning sound so that the player has time to turn around and see the NPC hiding in the clever ambush site. If an NPC in ambush constantly kills a player, the game will no longer be fun. By warning players, you give them time to see the AI’s mind and react to its behavior without dying.

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 “Caught!” Is used only when the enemy applies a specific AI combat strategy (for example, he understands how to bypass a player from the flank), then having seen the combination of flanking maneuver and cry “Caught!” Several times, in the future the player will expect bypass from the flank, even if he does not see it.

Kung Fu 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 down crowds of enemies with one line is perfectly acceptable, opponents in such games are like defenseless lambs with very weak artificial intelligence. However, if our opponents are smart, then fighting with several of them at the same time is too difficult for the player. On the other hand, a greater number of enemies creates an interesting and dynamic gameplay.

The solution lies in the design of fights in the style of "Kung Fu". In other words, even if there are several NPCs near the player at the same time, only a couple attack him. Others are reloading 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 to attack. By changing roles in the attack and constantly moving, opponents create an active combat situation in which a player is confronted by many enemies, but only some of them attack him. Surprisingly, players who encounter such a situation usually do not realize that they are actively attacked by no more than two opponents at the same time, even if the battle is fought with a large group of enemies.

Let the player know what you are doing.


When a player sees NPC actions, it is sometimes difficult for him to interpret them. Will the fleeing enemy hide, call for reinforcements, bypass from the flank, or simply run without any goal, trying not to run into a bullet? The difficult behavior of the NPC often eludes the player. When this happens, all the work of the AI ​​developer goes to pieces. An effective way to cope 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 comrades-in-arms, “Bypassing from the flank!”, “Cover!”, Or “Retreat!” Such prompts can have very high efficiency and often give a side effect: players assume that there is intelligence where there is none.

React to errors


Even the most sophisticated AI systems are wrong, it is inevitable. If you approach the mistakes incorrectly, then the NPC will seem stupid. Recognizing the occurrence of an error and responding to it wisely, you not only save the illusion of intelligence, but also turn errors into features.

Consider the calculations necessary to accurately hit the target. In a rich 3D world with moving objects (including other NPCs and players), despite all the complex physical calculations, errors inevitably occur. The grenade bounces off an object or another NPC and falls to the feet of the NPC that has thrown it. (Don't forget that players sometimes make this mistake too!)

If we just let the NPC stand and wait for the explosion, the AI ​​will seem rather pathetic. However, if we recognize the error, we can respond to it accordingly. If an NPC who has thrown a grenade covers its head, demonstrates surprise and / or fear, shouts “No-eh!” Then this no longer looks like an AI error. Now the error has become a feature, it adds the NPC personality, and in the game there is a bit of humor and interesting variation.

image

Retreat at the last moment


The task of the AI ​​system is to create for the player an interesting and intense gameplay. Ideally, the player should have a sense of complexity, corners, but as a result he should still win. One of the ways to implement it is to embed “pushing to the edge” into the AI ​​architecture itself. In this model, NPCs actively attack the player almost until death. The player’s records are 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 effectively, and it becomes easier to kill. After the victory, this 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 uniquely destroys the sensations of 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 integrate them into the behavior of NPCs. For example, a running NPC may need to stop and prepare a weapon, that is, it takes more time to attack than a fixed one. An enemy attacked from behind may be caught off guard and respond more slowly. Adding imperfections to the behavior of NPCs can also make them more realistic and give them individuality. For example, when recharging an NPC, it can sometimes mess around longer. An enemy who knows how to avoid booby traps may accidentally run into one of them. Planned vulnerabilities make computer-controlled characters more realistic. Unintentional mistakes destroy realism. For the proper selection of the balance requires careful testing of the game process (playtesting).

Playtesting


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

Tester selection is a critical process. In no case should the playtesters be members of the game development team and it’s better that they are not related to the game development industry.

Any knowledge of the techniques and tricks of the development of artificial intelligence can affect the interpretation of events by the playters. Secondly, there should be plenty of playters. There are two reasons for this. First: after making changes to the AI, a new set of novice players is required. Reusable playters are subject to prejudices suggested by the previous version of AI. Their interpretation of NPC behaviors and game techniques will be different from the perception of beginners. Second, since the players skills are very different, a large number of playters are needed. Perhaps only one out of thirty testers will be able to find the critical weakness of AI, due to which NPCs look stupid or easy to kill. When testing by a small team of AI players, it may look perfect, but it may turn out to be a failure after the game is released on a large market.

Playtesting should be carried out throughout the development process, and not just at the end of production. Recognizing factors that affect interest and intensity 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 playters to test the game during the entire development process. Players are better mastered in the game and are more likely to be able 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 each playtest. During a game session, observers take notes on the player's in-game actions, his physical reactions, such as posture and facial expression. It should also record the questions that need to be asked to the playmaster, but questions should be asked only after the completion of the gameplay. It is important that the observers say nothing during the playtest, even if the players have difficulties.

After completing the game process, you need to interview the 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 the presence of complex behavior where there is none. And vice versa - players miss the complex behavior of AI. Ask the playites 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 replay of the gameplay session and ask him questions about his actions.

A few examples


The standard error of AI developers is to over-complicate the design. Often, a much simpler solution and a cheap one, but inventive solutions turn out to be much better. For example, programmers often over-complicate design when developing tactics of units. Difficult information exchange and interactions between fighters are often overlooked by the player, and therefore not necessary. Valve's Half-Life game has an impressive example of how simple behaviors can create rich gameplay that forces a player to assume intellectual behavior.

The paratroopers in Half-Life use the kung-fu fight style: regardless of the number of paratroopers the player fights with, in fact, at the same time, a maximum of two are allowed to shoot at him. There is really no communication between the paratroopers. Instead, each squad of fighters is given two attack slots. If a paratrooper wants to attack, but both slots are full, he finds another occupation (for example, reloading weapons or moving to a new position for an attack). When one of the attacking paratroopers runs out of ammunition, it releases the attack slot and switches to the search and reload behavior. Then one of the non-attacking paratroopers detects an empty slot, takes 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 battle, the fighter who frees the attack slot shouts, “Cover me!”. Although there is no communication between these paratroopers, the player perceives it this way: one of the fighters asks to cover him, and the second one opens the covering fire. In reality, the attack slot is released and is engaged in another paratrooper who knows nothing about reloading the first one.

During the testing, it was discovered that when a player throws a grenade into an NPC group, the Half-Life path finding algorithm is not able to find an 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 pathfinding system (a difficult task), Valve decided to detect the problem and reproduce the special animation of the paratroopers trapped - they squatted and covered their heads with their hands. This behavior was perceived very well by the playters, because it added character to the game.

Conclusion


This article discusses important concepts. 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 a player, but to add tension, control the pace of the game and give computer characters individuality. 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 looking for unintended ones. This article also describes various tricks for AI systems to maximize the entertainment factor. In addition, you should not assume that the years of development of AI systems can replace rigorous testing of the game process.

Links


[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

Source: https://habr.com/ru/post/334300/


All Articles