From octoroks in The Legend of Zelda to enemies in Call of Duty, odds are that if you’ve played a video game you’ve encountered artificial intelligence ā whether you’ve realised it or not. Game AI can take many forms, but generally speaking it’s any entity that has a sense of awareness or knowledge of the world around it, and can act or react to it accordingly. Thereās a tendency among players to think of AI as just ‘organic’ things in the world, like humans or animals, but the reality is that AI can be anything that acts with awareness of the world around it ā it doesn’t even have to be organic! For example, a turret in a level that shoots at someone in its area of influence is an AI (since it is reacting to a target’s presence in the world). A human NPC in a world might not even necessarily be an AI if they just stand in one spot and don’t actually take any action or process information about the space around them, in which case they’re just like any other game element. This distinction matters because anything that exhibits this sort of reactionary awareness usually needs to be tamped down to maintain a fair level of challenge. At a baseline, a game engine controlling the AI will always have all the information about the game ā where the player is, what they’re doing, how fast they’re moving, where they are relative to the AI, and so on. The player, on the other hand, only really knows what they can see and hear from their perspective. Therefore the AI easily has the ability to go Terminator mode and beat the player with expert tenacity since they can read all the factors of a situation. It’s similar to if you were playing a game of Counter Strike where every member of the enemy team was using an aimbot ā it would be almost impossible to win unless you’re incredibly lucky (or have thousands of hours in CS:GO) because everyone knows exactly where you are and where to aim. This is why much of the work of AI designers is mostly limiting what information an AI has and is able to use at any given time, which allows them to control their efficiency in performing their task to give players a fair challenge.
Ashley Graham from the Resident Evil 4 Remake is an excellent example of an AI. Her simple behaviour is given the illusion of life through attention to detail in her animation and dialogue. Credit: Capcom.
Warning shots
To counter the fact that AI are operating with different information than players have, designers often use little tricks to help stop the AI from overwhelming the player. One such trick in shooters, where players have a limited directional field of view, is that enemies who are out of view for the player are given a much greater chance of missing their shots when the player isn’t looking at them. This makes their bullets act more as warnings for the player, and gives them the opportunity to notice their presence and engage the threat before unfairly catching them off-guard. AI are also forcibly given limited scope of vision that are constrained to a specific area around them, which allows a player to see an AI and prepare to encounter them accordingly while still remaining unseen to the AI. Similarly, in action games where players are fighting multiple enemies at once, many games will have unseen coordination systems running behind the scenes during a battle that help determine the level of challenge. For example, instead of having every active enemy attack the player at the same time and create a no-win situation, the engine will establish a plan of attack ā one or two enemies are chosen to lead, which paces the battle out more slowly and saves the player from having to juggle too many combatants all at once. In real life, if you’re fighting ten people at once they’ll probably just gang up on you and kick your butt. But the point of AI design isn’t to replicate real life, it’s to create an appropriate level of challenge. It might not be exactly how a player expects a real-life counterpart to act, but in many cases, if AI performed just like its real-life counterparts then the game would be far too hard because it’s so intelligent ā most players wouldn’t have fun at all. For many players, fighting AI who are smarter and more well-equipped than you ends up being more frustrating than it is fun, and sometimes it takes a little bit of cheating on the developer side to make it an engaging experience.Masking behaviours
Another overlooked part of AI design is ‘masking’ AI behaviours to appear less logical and robotic, which in turn helps to add to the game world’s immersion. Since an AI is operating based on computer-driven parameters, the actions they perform tend to be exact and rigid: they might shoot perfectly in a straight line, have very obvious transitions between one behaviour and another, or walk unwaveringly between two points while patrolling. This can make them feel too much like computer programs and not enough like fallible creatures living in a real world. This is where other disciplines like animations, feedback and effects are added to make an AI feel more organic and less machine-like; behaviours such as taunts, speaking to other AI, or pausing to perform some mundane action can help make them feel more like a real organic creature reacting to stimuli in the environment, even if they have little effect on their in-game competency.In most games, AI move using a grid called a “Navigation Mesh” which follows terrain and tells them what assets they can and can’t walk on.