The Art of Making Enemies

Vol. 18 // 2022
Artificial intelligence concept, copyright iLexx via Creative Market

“It’s cheating!”

The involuntary protest was loud enough to be heard across the room over the chorus of a myriad of games at a mid-90s gaming arcade. Hearing this brought a strange glee to my then 10-year old face, as I stood next in line behind the person who decried foul against his virtual opponent. The accuser’s character had gotten hit by another one of Goenitz’s Yonokaze wind blasts, while playing King of Fighters. His lamentations led me to assume that this person’s ‘Game Over’ was now imminent. My turn was a moment’s away. Even then, as I inserted the coin, I couldn’t help but wonder.

Difficult, sure. Hard, most definitely. Woefully aware of how difficult early games were, but could a game actually cheat? That seemed entirely a human concept.

Years later, it turned out that the actual act of a game cheating, when taken to its extreme form, is called the SNK Boss Syndrome. Being an SNK Boss, Goenitz was one of the foremost among the game bosses that helped perpetuate that reputation. Yet for all its awareness of the player’s actions and counter tactics, the AI in those games was not smart or sentient.

As a matter of fact, comparing Game AI to what passes as true AI, as we’ve come to know and call it, would straight up offend game developers of yore and data scientists alike. Both require, at times overlapping, but mostly different sets of expertise, skills and knowledge to implement.

A majority of 90s games relied on Game AI patterns and Finite State Machines. A step up from “the enemy will reveal weak spot after firing thrice” patterned approach, FSMs managed gamestate based decisions for all actors involved. In most cases, the game was always aware of the player character’s every information and just selected a degree of forgivebility based on chosen difficulty level. In purest form of the nomenclature, in the absence of deep learning, there was barely any AI as we have come to know it today.

Of course, AI in games has evolved a long way since. Not only are the enemies smarter, the games themselves take play patterns and behaviors into account.

One example would be Quake 3 where we witnessed some semblance of intelligent decision making. Quake 3 bots used Fuzzy Logic and their behaviour gave them distinct personalities. Their capacity to work as a team and give weight to team leader’s actions made them appear quite intelligent.

Halo 2 implemented Behaviour Trees or more specifically DAG (Directed Acyclic Graph) with a complexity added with impulses and by storing certain actions and stats encountered or performed during a session, in memory. This was ideal for large environments and added believability to enemies actions.

The subject of game AI can hardly be discussed without talking about F.E.A.R. series. F.E.A.R. has one of the most comprehensive AI’s ever to be put in a game. Its enemies coordinate among themselves, utilize the environment around them and appear to have a degree of common sense. In order to achieve this, F.E.A.R. uses a Goal Oriented Action Planning system that defines world states and constantly runs planning algos for each actor to accomplish their defined goals in that world.

Nowhere is the evolution of AI more apparent than in the Xenomorph in Alien: Isolation. It pits you against an enemy that truly feels more evolved and a smarter species than you and never feels unfair. This is achieved by using two AI modes, where a macro AI works in tandem with a Micro AI. The Director AI that is aware of the player’s whereabouts provides general hints to the Xenomorph AI but never the specifics. The Xenomorph’s AI based on it’s senses helps it traverse the maze of a space station and locate the player’s character. It also stores player’s action, so the same tactics are unlikely to work again. Furthermore, later in the game previously locked actions for the Xenomorph start unlocking making it seem like it’s learning.

S.T.A.L.K.E.R. has a director AI for NPCs and enemies which gives them their own journey in the world either separate from the player’s actions, or not entirely dependent on the player’s actions. They can make their own decisions, go out in the world, find each other and react accordingly. They keep memories of their interactions and experiences and act according to their environments, this leads to the creation of unique experiences every time.

To reiterate, Game AI is not quite the same as AI. The unanimous belief among game developers is that for commercial games we need an AI smart enough to offer a challenge but also forgiving enough to lose. It leaves one to ponder, however, whether it is because after achieving sentience it would be impossible to beat or just plainly refuse to play a number of games. After all, we came to learn of the ultimate conclusion of an AI long ago in War Games (1983), “The only winning move is not to play at all.”

Enemies are not the only entities that AI can benefit from, however, allies, the world and even the game flow itself benefits from it. A subpar companion/ally AI, can greatly take away from the experience. Most of the best regarded companions like Alyx from Half-Life 2, Elle from Last of Us and Elizabeth from Bioshock: Infinite are all driven by Behaviour Trees. Outside of QTEs and specific situations, they are also quite conveniently immortal, but implementing allies, which are going to be a major part of the game, feel believable and helpful is a far more demanding undertaking than implementing random grunts. It won’t be wrong to say that just like real life, it’s harder to make friends than enemies in game development.

Games continue to get smarter and smarter every day. The landscape of games as a whole is changing quickly because of the advent of indie games. Games like the upcoming Hello Neighbour 2 show a lot of promise in implementing neural networks that actively learn from their mistakes and your actions. AI, not just Game AI, would help capture realistic behaviour in future experiences. Even now, devs are benefiting from newfound boons of AI. Game developers are able to bring back a lot of older games using AI image scaling. Computer Vision will be used to enhance immersive and interactive technologies like Kinect.

AI in games has come a long way from its modest origins, like
Space Invaders’ ever increasing difficulty and varied patterns or
ghosts in Pacman changing behaviour depending on player actions. All these developments and technological innovations in
gaming mark one irrefutable fact: Even though the AI might beat
you at your favorite game. You win!

Related Articles