5th Sem
5th Sem
Introduction to Game AI
Game AI refers to the use of artificial intelligence techniques to create responsive,
adaptive, and intelligent behaviors in non-player characters (NPCs), enemies, allies,
and other elements within a video game.
The goal is to create a dynamic and engaging experience for players by making the in-
game world feel alive and responsive to their actions.
• Reinforcement Learning (RL): Used in some games to allow NPCs to learn and
adapt over time by receiving feedback (rewards or punishments) based on their
actions.
• Deep Learning: Some advanced AI-driven games use deep learning for tasks like
image recognition (e.g., identifying player behavior patterns) or strategy planning (as
seen with AI that can compete at the highest level in games like Dota 2 or StarCraft
II).
3. Behavior Trees
• A more advanced technique for organizing complex behaviors. Behavior Trees break
down actions into smaller tasks (nodes), with decision-making structured
hierarchically.
• Behavior trees are often used in modern games because they are more flexible than
FSMs and are easier to scale for complex behaviors.
The advantages of game AI are numerous and can enhance the overall gaming experience.
Here are some of the benefits of game AI:
1. Improved gameplay experience: Game AI can create a more realistic and immersive
gaming experience by allowing NPCs to behave in a more realistic and unpredictable
way.
2. Increased replayability: Game AI can make games more replayable by creating a
unique experience each time the game is played.
3. Enhanced realism:Game AI can create a more realistic gaming environment by
simulating real-world behaviors and interactions.
4. Better player engagement:Game AI can engage players in a more meaningful way
by creating a sense of challenge and competition.
5. Personalization:Game AI can personalize the gaming experience by adapting to the
player's behavior and preferences.
6. Increased player satisfaction:Game AI can increase player satisfaction by providing
a more engaging and challenging gaming experience.
While game AI has many advantages, it also has some disadvantages. Here are some of the
potential drawbacks of game AI:
AI plays a pivotal role in game designing, streamlining processes, enhancing creativity, and
improving player experiences. Here are the key contributions of AI to game design:
• Behavioral Design: AI enables the creation of realistic and adaptive NPCs that can
interact with players in meaningful ways.
o Example: NPCs in The Last of Us use AI to react dynamically to players’
movements and strategies.
• AI Companions: Designing allies with personalities, emotions, and decision-making
capabilities to enhance storytelling and gameplay.
• Behavior Analysis: AI evaluates how players interact with the game, providing
insights to designers for refining gameplay and features.
• Predictive Analytics: Anticipates player needs or frustrations, helping developers
improve game design iteratively.
5. Immersive World-Building
• Inspiration for Designers: AI can propose creative ideas, such as level layouts,
character designs, or plot twists.
• Collaborative Design: Designers work alongside AI tools to refine and enhance
initial concepts.
7. Future Trends in Game Design with AI
• Generative AI Models: Tools like ChatGPT and DALL·E can help generate
storylines, character designs, and concept art.
• Self-Learning NPCs: AI characters that evolve in complexity as players progress,
providing unique challenges.
Game AI interferences
Game AI interference refers to the ways in which artificial intelligence (AI) can interfere with
or affect the gameplay experience in a video game. Here are some examples of game AI
interference:
Types of game AI interference:
Here are some examples of game AI interferences based on movement, path finding,
decision making, and strategy:
A)Movement Interferences:
1. Stuck in a loop: AI characters get stuck in a loop, repeating the same movement or action
over and over.
2. Getting stuck on geometry: AI characters get stuck on geometry, such as walls or
corners, and are unable to move.
3. Unrealistic movement speeds: AI characters move at unrealistic speeds, making it
difficult for players to react or interact with them.
1. Getting stuck in a corner: AI characters get stuck in a corner or against a wall, unable to
find a path out..
2. Ignoring obstacles: AI characters ignore obstacles or hazards, such as pits or traps, and
move through them.
3. Getting stuck on narrow paths: AI characters get stuck on narrow paths or corridors,
unable to navigate through them.
4. Failing to avoid collisions: AI characters fail to avoid collisions with other characters or
objects, causing them to get stuck or take damage.
D)Strategy Interferences:
1. Lack of coordination: AI characters lack coordination, making it difficult for them to
work together or execute complex strategies.
2. Failing to use abilities or resources: AI characters fail to use abilities or resources, such
as special attacks or items, making them less effective.
3. Overreliance on a single strategy: AI characters overrely on a single strategy, making
them vulnerable to counter-strategies or exploits.
4. Lack of adaptability: AI characters lack adaptability, making it difficult for them to adjust
to changing situations or player strategies.
Complexity of Game AI
Complexity in Game AI can be achieved by incorporating artificial stupidity and intelligent
mistakes, which can make the AI behavior more realistic and unpredictable. Here are some
ways to achieve complexity in Game AI:
Artificial Stupidity:
1. Limited knowledge: AI agents can have limited knowledge or understanding of the game
world, leading to mistakes and unexpected behavior.
2. Biased decision-making: AI agents can have biases or preferences that influence their
decision-making, leading to suboptimal choices.
3. Emotional influences: AI agents can be influenced by emotions, such as fear, anger, or
excitement, which can affect their decision-making and behavior.
4. Cognitive limitations: AI agents can have cognitive limitations, such as limited attention
or memory, which can impact their ability to process information and make decisions.
5. Social influences: AI agents can be influenced by social interactions, such as peer pressure
or social norms, which can affect their behavior and decision-making.
Intelligent Mistakes:
Game AI systems function by processing input from the game environment, performing
computations, and producing output that drives the AI's behaviors.
Inputs
• Sensory Data:
o Player Position: The AI can track the player's location, orientation, and
movement.
o Player Actions: The AI can observe the player's actions, such as attacking,
using abilities, or interacting with objects.
o Environmental Factors: This includes things like obstacles, terrain, and other
game elements that affect the AI's decision-making.
Outputs
• Actions:
o Movement: The AI can control its character's movement, including walking, running,
jumping, and other locomotion actions.
o Attacks: The AI can initiate attacks, use special abilities, and employ combat strategies.
o Decision-Making: The AI can make strategic decisions, such as choosing paths, selecting
targets, or prioritizing objectives.
Behaviors
• Pattern-Based Behaviors:
o Patrolling: The AI can move along predefined paths or within designated areas.
o Chasing: The AI can pursue the player or other targets.
• Goal-Oriented Behaviors:
o Objective Seeking: The AI can navigate towards and interact with specific game objects
or locations.
o Task Completion: The AI can perform a series of actions to achieve a particular goal.
A)Physical Properties
B)Behavioral modules
• Movement: Pathfinding and steering behaviors to navigate the environment.
• Decision-Making: Determines goals and actions based on game logic and current
state.
• Interaction: Handles reactions to collisions, pickups, or environmental changes.
A. Movement
Rigid body movement is achieved by applying forces instead of directly modifying position
to maintain realistic physics. Common techniques:
B. Pathfinding
For navigation:
C. Obstacle Avoidance
D. Collision Handling
• Respond to collisions based on game rules (e.g., taking damage, bouncing off walls,
picking up items).
• Use layers or tags to filter interactions (e.g., ignoring collisions with certain objects).
There are several types of steering outputs that can be generated, including:
1. Velocity-based steering: This type of steering output generates a velocity vector that the
AI agent should follow to reach its goal.
2. Vehicle movement: Steering output can be used to generate realistic vehicle movement,
such as driving or flying.
Variable matching
1. Exact matching: This type of variable matching involves matching variables exactly,
without any variation or flexibility.
3. Fuzzy matching: This type of variable matching involves matching variables using fuzzy
logic, which allows for some degree of variation or flexibility.
1. Rule-based systems: This technique involves using a set of predefined rules to match
variables.
2. Decision trees: This technique involves using a decision tree to match variables based on a
set of conditions and rules.
3. Neural networks: This technique involves using a neural network to match variables
based on patterns and relationships in the data.