Beginner’s Guide To Game AI

What is Game AI?

Game AI is mainly focused on the actions that an entity should take. The traditional AI literature refers to it as ‘Intelligent Agents’. The agent is usually a character in the game. He could also be a vehicle, a robot, or a whole group of entities, or even a country or civilization. In each case, it is a thing that needs to observe its surroundings, make decisions, and act upon them. This is similar to the Sense/Think/Act cycle:

Beginner’s Guide To Game AI

Sense: The agent detects the things in their environment that may influence their behavior. (e.g. threats nearby, items to collect, points of interest to investigate)

Think: The agent makes a decision about what to do in response (e.g. considers whether it is safe enough to collect items, or whether it should focus on fighting or hiding first)

Act: The agent performs actions to put the previous decision into motion (e.g. starts moving along a path towards the enemy or towards the item, etc)

In the real-world AI, the ones making the news at the moment, they are typically heavily focused on the ‘sense’ part of this cycle. For example, autonomous cars must take images of the road ahead, combine them with other data such as radar and LIDAR, and attempt to interpret what they see.

Usually, This is done by some sort of machine learning. These are referred to as ‘classification problems’. Games don’t tend to need a complex system to extract this information. There’s no need to run image recognition algorithms to spot if there’s an enemy ahead. The game knows there is an enemy and can feed that information directly into the decision-making process. So the ‘sense’ part of the cycle is often much simpler, and the complexity arises in the ‘think’ and ‘act’ implementations.

Constraints of Game AI development:

AI for games usually has a few constraints to respect: It isn’t usually ‘pre-trained’ like a machine learning algorithm. it’s not practical to write a neural network during development to observe tens of thousands of players and learn the best way to play against them. The game isn’t released yet. There are no players!

The game is usually supposed to provide entertainment and challenge rather than be ‘optimal’. If the agents could be trained to take the best approach against the humans, this is often not what the designers actually want. There is a requirement for the agents to appear ‘realistic’. So that players can feel that they’re competing against human-like opponents.

The AlphaGo program was able to become far better than humans. The moves chosen were so far from the traditional understanding of the game. The experienced opponents would say that it “almost felt like I was playing against an alien”. If a game is simulating a human opponent, this is typically undesirable, so the algorithm would have to be tweaked to make believable decisions rather than the ideal ones. It needs to run in ‘real-time’.

The algorithm can’t be monopolized the CPU usage for a long time in order to make the decision. Even taking just 10 milliseconds to make a decision is far too long. Most of the games have somewhere between 16 and 33 milliseconds to perform all the processing for the next frame of graphics. With that in mind, we can start to look at some extremely simple AI approaches that cover the whole Sense/Think/Act cycle. They are efficient and allow the game designers to choose challenging and human-like behaviors.

Learning and Adapting

AI does not use ‘machine learning’. It is not generally suited to real-time control of intelligent agents in a game world. We might want a computer opponent in a shooter game to learn the best places to go in order to score the most kills. The opponent in a fighting game like Tekken or Street Fighter to spot when we use the same ‘combo’ move over and over and start blocking it, forcing us to try different tactics. So there are times when some degree of machine learning can be useful.  Role of Big Data in Official Statistics

Conclusion:

This is a broad overview of some of the most common tools and approaches used in game AI. Many other techniques – less commonly used but potentially effective – have not been covered.

These include:

  • Algorithms for optimization tasks, including hill-climbing, gradient descent, and genetic algorithms;
  • Adversarial search/planning algorithms such as minimax and alpha-beta pruning; classification techniques such as perceptrons, neural networks, and support vector machines;
  • Systems to handle agent perceptions and memories;
  • AI architectural approaches, such as hybrid systems, subsumption architectures, and other ways to layer AI systems;
  • Animation tools such as motion planning and motion matching;
  • Performance considerations such as level of detail, anytime algorithms, and time slicing.

Recommended For You

About the Author: Team Techiversy

Leave a Reply

Your email address will not be published. Required fields are marked *