When we see Artificial Intelligence (AI) in today’s news, it’s usually along the lines of Large Language Models (LLMs) like ChatGPT or Llama2. Maybe even the existential risk of creating AGI (Artificial General Intelligence) without remembering that AI has been a staple of our lives for years, especially if you’re a gamer! Today let’s look at the history of AI in Video Games.
History of AI in Video Games
My interest in AI came from video games themselves. From the enemies in the early Sonic and Mario games, programmed by Eggman and Bowser respectively, or the computers of the programmers themselves (yes, I was a strange kid).
When I think of AI in gaming, I often think of Pac-Man and how innovative the AI patterns were. Each ghost would behave differently, according to their name and personality!
I was also astounded (and still am) about the different difficulty levels of AI in video games. What makes a computer character harder or easier in say Mario Party or Chess?
The Earliest AI in Video Games
One of the earliest AI in video games can be traced back to an opponent in OxO, a digital form of Tic-Tac-Toe in 1952 or the mathematical game Nim in 1941. Both used elementary systems compared to today.
Here are some examples of the common mechanics of AI in gaming that we’ve encountered over the decades of gaming:
Pathfinders and Decision Trees
Ever wondered why Goomba and Badnik would patrol their little areas in wait for Mario or Sonic? These video game enemies were “pathfinders”. They would move using predetermined patterns. This would create a challenge of timing to pounce on the enemy – like that first area in Super Mario Bros when fighting the first Goomba on the screen!
Decision trees would define or direct the behaviour of enemies relative to how you controlled your character. For example, if you get close enough to an enemy it could change its path and charge for you.
Finite State Machines
Another example of artificial intelligence in video games are “finite state machines”. These are computational models that have a finite number of different states and transitions between them.
We see finite state machines in the different states of a character when they are in different states. For example: “idle” or “running” or “jumping”. What comes to my mind are the classic Sonic sprites where he’s lying down his idle state, while Tails yawns, until the player brings them back into a non-idle state!
“Finite state machines” also works with some enemies. The baddies would switch between different states when our beloved characters enter the fray!
Scripting/Behaviour Trees
As we have become more advanced with Ai in video games, enemies and Non-Playable Characters (NPCs) have become more complex, allowing us to become more immersed in these digital worlds.
A good example of this is the first open world title of the Legend of Zelda franchise, Breath of the Wild. NPCs react to weather changes, seeking shelter and sometimes even limiting their interactivity (such as rain delaying a minigame that can normally be played). Enemies become more sophisticated with their decision making, deciding what weapon and tactic to use depending on the player’s position and health.
Natural Language Processing
I had to mention Facade when it comes to AI in gaming. Released in 2005, Facade portrayed a dinner party scenario where Natural Language Processing (NLP) was used for the player to interact with the AI characters. You would type responses and questions to interact with the dinner hosts.
The NLP system was used to determine intent and context behind the sentences and words typed. The characters Grace and Trip respond dynamically with dialogue generated appropriately to your inputs, including facial expressions and emotions!
The Future of AI in Video Games
With Neural Nets, Machine Learning and PCG (Procedural Content Generation), AI in gaming has become much more complex, with opportunities for further development becoming more apparent day by day.
Games like AI Dungeon (powered with GPT-3) allows you to shape the narrative of the game by inputting prompts. Just like the earlier mechanics of text-based games, but more than matching a one-word prompt to its preset commands (e.g. “open lock” or “climb down”).
You can even create a whole D&D scenario in ChatGPT. LLMs are now being used in Skyrim mods for NPCs, giving them a whole new lease of life and dialogue. This will literally change the game in how we interact and traverse digital worlds.
What changes when it comes to AI in gaming do you think will happen sooner rather than later?