The Many Flavors of Game AI

A video game character chef cooking a bunch of AI brands

Artificial Intelligence (AI) has a long and storied history within the realm of gaming, enhancing user experience and pushing the boundaries of interactive entertainment.  But which one is best for your game?

Reactive AI

The simplest form of Game AI is barely an AI at all! Any characters that interact with the player are given simple sets of behaviors that they enact in reaction to the player, and those behaviors are often called “AI”, even when their behaviors are incredibly rudimentary.

A screenshot of Pong
Pong’s AI is incredibly simple, but has kept it a hit for 50 years!

For instance, in Pong, the opposing AI paddle moves in reaction to where the ball is on the board along the y-axis. It cannot predict the ball’s path, and it does not respond directly to the player’s inputs.

Even though AIs like this are so simple, they can often be more than enough to overwhelm players, so difficulty can be adjusted by limiting their abilities in the game.

Back to Pong, the opposing AI paddle will always try to match the center of its paddle with the current position of the ball, but unlike the player, it has a limited speed it can move. This makes it possible for the player to win, by having the ball move faster than the paddle.

This simple form of AI is best when used in very narrow contexts, but once you need a non-player character to be adaptive to environments and situations it can’t possibly anticipate, more advanced forms of AI are needed.

Emergent Response AI

As game worlds have gotten bigger and bigger, it has become prudent to build functionality for non-player characters to consider both the player’s actions and the state of the game environment. This results in more nuanced and context-sensitive reactions, creating a sense of unpredictability and realism.

A screenshot of Halo, showing enemies reacting and scattering because of their advanced IA (for the time)
Halo’s AI set a new standard for first person shooters.

In the original Halo, enemies use a wide array of behavior trees to model their behavior, allowing them to make decisions based on a hierarchy of actions and conditions, leading to more realistic and varied behaviors.  

Enemies are aware of the environment around them, using AI pathfinding to navigate the game world efficiently, and finding the best routes based on the terrain and obstacles. More importantly, the “best route” for the enemy AI often involves tactics like flanking, finding other advantageous positions to assault the player character, and even running away after their leaders die.

In games like Far Cry, enemies can also react with complexity to each other! If wild animals are in the vicinity of human enemy characters, the animals and humans can attack each other, giving the player more tactical options than a direct assault.

This form of AI is incredibly adaptive, but it also takes a large amount of time to program, even longer to tweak and adjust until they feel “right”, and they’re also prone to unexpected errors and unintended behaviors that may not be discovered until long after the game ships. 

Luckily, there’s another form of AI that assists game devs to observe and edit their games over the long term.

Game Analytic AI

Game Analytics involves sifting through large datasets to gain insights on the interplay between player actions, game environment, and game responses, so developers can identify patterns and trends. Understanding player behavior helps tailor game content to meet player preferences and improve engagement.

These datasets are built by recording user gameplay with simplified data efficient methods, and uploading them to a database for analysis. While the work of analyzing this data often falls to devs, AI is often implemented to simplify the data in ways that are easier to parse. AI can generate heat maps, charts, and simple reports for analysis.

Once this database is built up to a certain level, devs utilize machine learning to train their AI on these datasets, then they can implement changes directly to the game based on the collected information.

A screenshot from CSGO showing an ai-based anti-cheat system
Counter Strike has been in an arms battle with cheaters for decades, and is often on the forefront of anti-cheat tech.

One of the most common uses of AI in this respect is with anti-cheating measures. AI can detect irregularities and possible cheating behaviors by identifying patterns that deviate from typical player behavior. The AI can then boot the offending player from the game, and possibly ban them based on how that player’s profile aligns with known and verified cheaters.

As with Emergent AI, these systems can still be prone to error, so they may read “false positives”, and block or ban a player incorrectly.  Players also find new and novel ways to cheat game systems over time, so developers are still needed who can monitor game activities, and either override the AIs decisions, or find things the AI could miss.

Procedural Generation

Procedural Generation is a technique where game content is created algorithmically rather than manually. This allows for the creation of vast and diverse game worlds with relatively little manual input.

Developers set the rules and parameters, and the game generates content based on these guidelines. This can include levels, landscapes, quests, and more. Procedural generation can be particularly effective in creating levels that offer a fresh experience every time a game is played. While powerful, procedural generation requires extensive testing to ensure the generated content is coherent, balanced, and enjoyable.

A csreenshot showing Deathstate, which has an advanced procedural level-generation system.
Deathstate was part of a wave of “roguelikes” that exploded after the popularity of procedural generation.

Workinman’s Deathstate was a game where we implemented procedural generation to not only create varied levels, but also to generate items, enemies, bosses, and randomize the appearance of in-game shops.  

Specialized AI

Neural Networks trained with Machine Learning Models are at the heart of many modern AI applications. These models learn from vast amounts of data to perform specific tasks with high accuracy.

Neural networks have a long history, with initial concepts dating back to the 1940s. However, they have only recently become practical due to advances in computing power and data availability. The process involves setting objectives, providing relevant data, and allowing the AI to learn and improve through training iterations.

For instance, image recognition software is trained by giving an AI a simple order, like to identify walk signs, and is given a few patterns to look for. The AI is then given a series of pictures, some that have walk signs, and others that do not, and the AI has to identify which pictures have a walk sign. Once it goes through those images, it is told the answers, and the AI then uses that information to reassess its own ability to correctly or incorrectly identify the correct images, and then creates new rules or patterns to follow on the next set of images.

Walk sign
To identify a walk sign effectively, an AI would have to be able to recognize it at any angle, lighting condition, or even if partially obscured. A model needs to trained with inputs of images of signs from all possible angles and within a variety of conditions before it can really know what a “walk sign” is.

The process of training an AI in this way is a Machine Learning Model, and over the past 80 years, many different methodologies and training methods have been iterated on and adjusted for a variety of niche purposes.

In gaming, VR devices like the Quest 3 use algorithms built by neural networks to map physical spaces around the user, and track their hand positions, allowing applications in both AR and VR space to work quickly and effectively.

Voice recognition systems, such as those used in virtual assistants and in-game commands, leverage neural networks for accurate and responsive performance.

Generative AI

Generative AI represents a frontier in AI research and application, capable of creating new content from learned patterns. Generative AI models observe existing content, receive prompts, and generate new content based on learned patterns. These models are trained on vast datasets and can produce coherent text, realistic images, voices, music, and even videos.

These methods of generating content can be used for a wide variety of applications.  For instance, Unreal Engine is experimenting with using prompts in conjunction with procedural generation to automatically create editable 3D environments using their asset library.

Unreal Engine's procedural environmental design
Using simple prompts, Unreal Engine can create 3D environments using pieces from their asset library.

Most uses of Generative AI still have some issues that may not currently make them the best choice for production. Generated assets can have inconsistencies across different poses and angles. Generated 3D models can be structured inefficiently, not only having a large polycount that bloats the file sizes, but making it difficult to rig and animate the model. Generative animations and video often have severe visual glitches.

Generated text and images can also suffer from a lack of context that results in poor or incorrect outputs, can infringe on IP, or generate content that goes against the developer’s core values. Human intervention is needed to evaluate AI output to ensure quality.

Many of these issues exist because we’re in the early stages of this new AI methodology. Generative AI is still in its infancy, and although it has a wide range of applications, we’re still exploring where it fits best in game development workflows and applications.

Which AI is for Me?

Workinman has 20+ years of experience utilizing a variety of AI applications across hundreds of games, to properly leverage the breadth of AI applications and methodologies for your games.  We use qualified, proven AI-enhanced tools to streamline production, reduce costs, and ensure quality.  

With a wide array of different learning models and applications at our disposal, we have the experience and knowledge to create games with AI efficiently, and find the right fit for your goals and within your budget. Reach out to us to get started.

Previous Post
Play Inside and Outside with Bert and Ernie in Sesame Street!
Next Post
Trauma Informed Care Training in Virtual Reality