SlideShare a Scribd company logo
SCHOOL OF COMPUTING & DATA SCIENCE
AI For Gaming
Yetunde Folajimi, Ph.D.
SCHOOL OF COMPUTING & DATA SCIENCE
Lecture 1:
AI FOR GAMING 2
Yetunde Folajimi, PhD
Introduction to AI in Gaming
SCHOOL OF COMPUTING & DATA SCIENCE
Course Overview
• AI in gaming: why it matters:
• Understanding the importance of AI in enhancing the gaming
experience and creating more engaging and immersive games.
• The role of AI in game development:
• AI helps create realistic characters and environments, automates
content generation, and adapts gameplay to individual players.
• AI techniques and tools for game development:
• Overview of the AI techniques and tools that are commonly used in
game development, such as pathfinding, decision-making, and
machine learning.
AI FOR GAMING 3
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
What is Artificial Intelligence?
• Artificial Intelligence (AI) is a branch of computer science that aims to
develop machines capable of performing tasks that typically require
human intelligence.
• Examples: Decision-making, learning, problem-solving, perception,
and natural language understanding
• AI vs. Traditional Programming: AI systems can learn and adapt to
new situations, while traditional programming relies on explicit
instructions
• Game AI: This type of AI focuses on creating intelligent behaviors
within a specific game context, aiming to provide enjoyable and
engaging experiences for players.
• General AI: This type of AI aims to create machines that can perform
any intellectual task a human can do, often referred to as "strong AI."
AI FOR GAMING 4
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
AI in Gaming
• AI Research and development techniques to control
nonplayer characters and enhance gameplay
• more immersive, challenging, and innovative games
• Goals:
• Create more immersive and realistic environments
• Improve non-player character (NPC) behavior
• Enhance player experience
• Generate dynamic & unpredictable gameplay
• Create more “reasonable” challenging
gameplay (no Cheating!).
• Generate new ideas for game design
• Analyze player behavior
• Optimize computing resources
AI FOR GAMING 5
Yetunde Folajimi, PhD
Boss Battle
SCHOOL OF COMPUTING & DATA SCIENCE
AI in Gaming: Early History
• Early video games used simple AI-controlled NPCs:
• Rule-based algorithms that relied on simple if-then statements to
dictate NPC behavior
• Examples:
• 1978: Space Invaders: The aliens moved in a predetermined pattern
and sped up as the player progressed through the game
• 1980: Pac-Man: Ghosts pursued the player character and changed
direction when they hit a wall
AI FOR GAMING 6
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
History of AI in Gaming:
Early Beginnings (1950s-1960s)
• 1950:Bertie the Brain, a video game version of tic-tac-toe,
built by Dr. Josef Kates for the 1950 Canadian National
Exhibition. Considered one of the first AI-controlled games.
• 1962:Spacewar!, created by Steve Russell, Spacewar! was
one of the earliest video games. It featured AI-controlled
spaceships that simulated movements and attacks.
AI FOR GAMING 7
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
History of AI in Gaming:
Early Beginnings (1970s)
• Board games began to be adapted for play against computer
opponents (beginning of computerized board gaming)
• 1972: Othello (Reversi) becomes the first board game to be
computerized, with a program written by Michael F. S. McTear.
• 1973: Arthur Samuel creates a checkers program that can play
at the level of an amateur human player.
• 1974: Richard Greenblatt and Thomas Knight write a chess
program called MacHack VI that becomes the first computer
program to defeat a human player in a chess tournament.
• 1975: The first commercially available computerized board
game, a backgammon program called "Backgammon Ace," is
released for the Atari 2600 video game console.
• 1976: Donald Michie creates a program called "MENACE"
(Matchbox Educable Noughts And Crosses Engine) that can
learn to play tic-tac-toe (also known as noughts and crosses)
through trial and error.
• 1977: Dan and Kathe Spracklen create a program called
"Chinook" that becomes the first computer program to win a
world championship in any game, in this case the game of
checkers.
• 1978: Claude Shannon, the father of information theory,
develops a program called "Chesster" that is capable of playing
a rudimentary game of chess.
AI FOR GAMING 8
Yetunde Folajimi, PhD
Arthur Samuel’s Checkers playing program
Simple chess AI
Source: https://blog.paessler.com/the-history-of-chess-ai
SCHOOL OF COMPUTING & DATA SCIENCE
History of AI in Gaming:
Rise of Game AI (1980s – 1990s)
• Game developers started incorporating AI techniques to enhance the gameplay
experience:
• 1980: Pac-Man introduced simple AI behavior for the ghosts, each with distinct
patterns, such as chasing or patrolling.
• 1983: AI defeated a human player in chess for the first time
• 1984: (1) Elite, a space trading and combat game, used adaptive AI for enemies,
allowing them to adapt to player strategies and evolve their tactics. (20) Karate
Champ
• 1985: The iconic platform game Super Mario Bros. showcased AI patterns and
behaviors for enemies like Goombas and Koopas.
• 1993: Doom, a popular first-person shooter that used advanced AI for its enemies
AI FOR GAMING 9
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
History of AI in Gaming:
Emergence of Intelligent Agents (2000s - 2010)
• AI in gaming became more sophisticated, and featured
intelligent agents that could make decisions and respond to
complex situations
• 2000
• The Sims, a life simulation game where AI-controlled characters had their
own needs and desires
• 2001
• Halo: Combat Evolved, pioneered advanced enemy AI and created dynamic
combat scenarios featuring AI-controlled allies and enemies.
• Grand Theft Auto III, an open-world game that featured a large number of
AI-controlled NPCs with their own behaviors and interactions
• 2003
• Call of Duty, another popular first-person shooter that used advanced AI for
its enemies
• 2005
• F.E.A.R a horror game that utilized advanced AI for enemy behavior,
including tactical decisions, flanking maneuvers, and adaptive responses to
the player's strategies to create tense and unpredictable combat scenarios.
• 2008:
• Left 4 Dead, a cooperative shooter that used advanced AI to create
dynamic and unpredictable gameplay
AI FOR GAMING 10
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
History of AI in Gaming:
Machine Learning and Deep Learning (Beyond 2010)
• Machine Learning and Deep Learning techniques
enable AI systems to learn and improve from
experience
• 2011
• The Elder Scrolls V: Skyrim, featured AI-driven NPCs with
complex routines, such as engaging in daily activities,
interacting with the environment, and exhibiting realistic
behaviors.
• 2016
• AlphaGo, developed by DeepMind, defeated world
champion Go player Lee Sedol. It utilized deep
reinforcement learning and neural networks to master the
complex game of Go.
• 2018
• OpenAI Five showcased an AI team playing the popular
game Dota 2 at a high level, demonstrating cooperative
gameplay and strategic decision-making.
• Red Dead Redemption 2 employed machine learning
techniques to create realistic animal behavior, such as
animals reacting to environmental stimuli and exhibiting
natural movements.
• AI used to generate content such as textures, environments,
and levels. "No Man's Sky" used AI to generate an entire
universe with over 18 quintillion planets.
AI FOR GAMING 11
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
History of AI in Gaming:
Machine Learning and Deep Learning (Beyond 2010) – contd.
• 2019: AI-Assisted Gameplay:
• AI used to enhance gameplay. "Assassin's Creed
Odyssey" used AI to create realistic and intelligent
enemy behavior that responded to player actions.
• 2020: AI-Powered Game Engines:
• AI used to power game engines, allowing for more
complex gameplay mechanics. Unity introduced a
machine learning toolkit that enabled developers to
create more advanced AI systems.
• 2021: AI-Generated Game Design:
• AI used to generate game designs and mechanics.
"DALL-E" was created by OpenAI using machine
learning algorithms to generate a unique puzzle game.
• 2022: AI-Driven Player Personalization:
• AI used to personalize the player experience, creating a
more immersive and engaging gameplay. "The Last of
Us Part II" used AI to analyze player behavior and
adapt the game difficulty and story based on the
player's preferences.
AI FOR GAMING 12
Yetunde Folajimi, PhD
Assassin's Creed Odyssey Fight
SCHOOL OF COMPUTING & DATA SCIENCE
AI Techniques in Gaming
• Includes rule-based systems, decision trees, and state machines,
behavior trees, utility systems, pathfinding, etc
• Rule-based systems: These are systems where NPCs follow a set of
predefined rules or behaviors.
• Decision Trees: Decision trees are hierarchical structures that help NPCs
make decisions based on certain conditions.
• State Machines: State machines are systems that manage the different
states of an NPC and determine how they transition between states based
on inputs.
• Pathfinding and Navigation
• Pathfinding: Finding the shortest or most efficient route between two points.
Navigation: Moving along the path.
• Importance of pathfinding in games: Pathfinding is crucial for realistic and efficient
movement of NPCs and characters in games.
• Common pathfinding algorithms: A* and Dijkstra's algorithms.
AI FOR GAMING 13
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
AI Techniques in Gaming (contd.)
• Decision Making
• Decision making is important for NPCs to respond intelligently to different
situations in the game.
• Finite State Machines (FSM) represents an NPC's behavior as a set of states and transitions
between them based on inputs.
• Behavior trees are a hierarchical structure used to represent decision-making processes for
NPCs
• Machine Learning in Gaming
• Machine learning is a subset of AI that focuses on creating algorithms that can learn from data
and improve over time.
• Supervised learning uses labeled data to learn patterns, while unsupervised learning finds
patterns in unlabeled data.
AI FOR GAMING 14
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
AI Techniques in Gaming (contd.)
• Reinforcement Learning
• Reinforcement learning is a type of machine learning where an agent learns to
make decisions by interacting with an environment and receiving feedback in
the form of rewards or penalties.
• Q-Learning is a popular reinforcement learning technique, while Deep Q-
Networks combine Q-Learning with deep neural networks for more complex
problems.
• Examples of games using reinforcement learning: Examples include AlphaGo,
which defeated the world champion in the game of Go, and OpenAI Five, which
played competitive matches against professional Dota 2 players.
• Natural Language Processing (NLP)
• NLP is a subfield of AI focused on enabling machines to understand, interpret,
and generate human language.
• NLP can be used to create more engaging dialogues, immersive narratives, and
realistic interactions with NPCs.
• Common NLP techniques: Text classification, sentiment analysis, and language
generation.
AI FOR GAMING 15
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
AI Techniques in Gaming (contd.)
• Interactive Dialog Systems
• These systems allow players to have dynamic and natural conversations with NPCs.
• Rule-based dialog systems: Use predefined rules and decision trees to generate dialogues.
• Machine learning-based dialog systems: Use machine learning techniques, such as neural
networks, to generate more natural and context-aware dialogues.
• Procedural Content Generation (PCG)
• PCG is the process of algorithmically creating game content, such as levels, characters,
and narratives.
• PCG can save development time, add replay value, and create unique experiences for
each player.
• Types of PCG: Level design involves creating game worlds, character generation focuses
on creating NPCs, and narrative involves creating dynamic storylines.
• Examples:
• Minecraft uses PCG to generate its randomly generated worlds.
• No Man's Sky: No Man's Sky uses PCG to generate its vast universe, including planets, animals, and
vegetation, as well as the game's missions and quests.
• Diablo III uses PCG to create its randomized dungeons’ layout, monsters, loot, and traps.
• Spelunky uses PCG to create its randomized levels with different layouts, traps, and enemies.
AI FOR GAMING 16
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
Case Study 1 –
Middle-Earth: Shadow of Mordor
• Game overview:
• Action-adventure game set in the Lord of the Rings universe, developed by Monolith
Productions.
• AI techniques used:
• The game features the Nemesis System, an AI-driven system that dynamically
generates unique and memorable enemies based on player interactions.
• Impact on gameplay:
• The Nemesis System creates a personalized and dynamic game world, as the
player's actions directly impact the hierarchy and relationships between enemies,
adding replay value and increasing player engagement.
AI FOR GAMING 17
Yetunde Folajimi, PhD
https://gfycat.com/
SCHOOL OF COMPUTING & DATA SCIENCE
Case Study 3 - Alien: Isolation
• Game overview:
• Alien: Isolation is a survival horror game developed by Creative Assembly, in which the player
must avoid a deadly alien creature.
• AI techniques used:
• The game's AI system features two distinct layers – one for the alien's "instincts" and another for
its "strategy" – which work together to create unpredictable and adaptive behavior.
• Impact on gameplay:
• The advanced AI system makes the alien an unpredictable and terrifying opponent, contributing
to the game's intense atmosphere and enhancing the player's sense of immersion.
AI FOR GAMING 18
Yetunde Folajimi, PhD
https://gfycat.com/
SCHOOL OF COMPUTING & DATA SCIENCE
Case Study 3 – Left 4 Dead
• Game overview:
• Left 4 Dead is a cooperative first-person shooter developed by Valve Corporation,
where players work together to survive a zombie apocalypse.
• AI techniques used:
• The game uses an AI "Director" to dynamically adjust the pacing and difficulty of the
game based on player performance and actions.
• Impact on gameplay:
• The AI Director ensures that each playthrough is unique and engaging, adapting the
game to suit different player preferences and skill levels, and fostering a sense of
replayability.
AI FOR GAMING 19
Yetunde Folajimi, PhD
https://gfycat.com/
SCHOOL OF COMPUTING & DATA SCIENCE
Case Study 4 – No Man's Sky
• Game overview:
• No Man's Sky is an open-world exploration game developed by Hello Games, set in
a procedurally generated universe with 18 quintillion unique planets.
• AI techniques used:
• The game combines procedural content generation (PCG) with AI techniques to
create diverse and dynamic ecosystems, including unique creatures and plants.
• Impact on gameplay:
• The combination of PCG and AI results in an expansive and immersive game world,
offering players endless opportunities for exploration and discovery.
AI FOR GAMING 20
Yetunde Folajimi, PhD
https://gfycat.com/
SCHOOL OF COMPUTING & DATA SCIENCE
Academic AI Versus Industry AI
• Academia often pursues theoretical advancements, while industry
focuses on practical applications
• The gaming sector presents unique opportunities and challenges for both
• Academic AI in Gaming
• Focus on fundamental research and algorithms
• Often open-source and accessible for learning and further research
• Limited by resources but not by market pressures
• Industry AI in Gaming
• Driven by market needs and commercial viability
• Emphasis on product development and user experience
• Operates under resource constraints and deadlines
• Collaborations between Academic and Industry AI
• Collaborations often lead to innovation in the gaming industry
• Industry can provide real-world application scenarios for academic AI
• Academia can supply novel ideas and techniques to the industry
AI FOR GAMING 21
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
Ethical Considerations
• Ensuring generated content is appropriate and relevant
• Respecting player privacy when analyzing in-game text input
• Balancing procedural generation with artistic direction
AI FOR GAMING 22
Yetunde Folajimi, PhD
Unpredictability
of outcome
•Unpredictabl
outcomes may
inadvertently
produce
inappropriate
content
Privacy concerns
• Collection and use
of player data in AI-
driven analytics and
personalization
Addiction
• AI can create more
engaging
experiences, leading
to addictive
gameplay and
unhealthy
behaviors.
Fairness and bias
• Unintentional
perpetuation of
biases in training
data can lead to
unfair outcomes in
games
SCHOOL OF COMPUTING & DATA SCIENCE
Ethical Considerations:
Bias and Fairness in AI
• AI algorithms can inadvertently perpetuate or exacerbate existing biases
• Unfair treatment of players based on demographics, preferences, or play style may
arise
• Example: In-game AI character interactions biased against certain player choices or
identities
• Developers must be proactive in identifying and mitigating biases in AI systems
AI FOR GAMING 23
Yetunde Folajimi, PhD
Source:
infoworld.com
SCHOOL OF COMPUTING & DATA SCIENCE
Ethical Considerations:
Privacy and Data Security
• AI-driven games may collect large
amounts of player data to provide
personalized experiences
• Ensuring the privacy and security of
this data is essential to protect players'
rights
• Developers should follow data
protection regulations and best
practices, such as GDPR
• Example: Implementing end-to-end
encryption and anonymizing player
data
AI FOR GAMING 24
Yetunde Folajimi, PhD
Source: “The dangers of in-game data collection”
https://www.polygon.com/features/2019/5/9/18522937/v
ideo-game-privacy-player-data-collection
SCHOOL OF COMPUTING & DATA SCIENCE
Ethical Considerations:
Transparency and Explainability
• Players should understand how AI-
driven game mechanics work and
influence their experiences
• Developers should strive for
transparency and explainability in their
AI systems
• This helps build trust between players
and developers, and encourages
informed decision-making
• Example: Providing clear explanations
of AI-driven matchmaking or
procedural content generation
AI FOR GAMING 25
Yetunde Folajimi, PhD
Source: “The dangers of in-game data collection”
https://www.polygon.com/features/2019/5/9/18522937/v
ideo-game-privacy-player-data-collection
SCHOOL OF COMPUTING & DATA SCIENCE
Ethical Considerations:
Addiction and Mental Health
• AI-driven games can be designed to optimize player engagement and
retention
• However, this may lead to concerns about addiction and mental health
implications
• Developers should consider the potential impact on players and design
responsibly
• Example: Implementing features that encourage healthy gaming habits,
such as time limits or cooldown periods
AI FOR GAMING 26
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
Ethical Considerations:
Responsibilities of Game Developers
• Address and mitigate biases in AI
systems
• Protect player privacy and data
security
• Be transparent about AI-driven
game mechanics
• Consider addiction and mental
health implications
• Encourage a culture of ethical AI
development within the gaming
industry
AI FOR GAMING 27
Yetunde Folajimi, PhD
https://ssir.org/articles/entry/ai_ethics_are_in_dange
r_funding_independent_research_could_help
SCHOOL OF COMPUTING & DATA SCIENCE
Future of AI in Gaming
• Trends in AI and gaming: The future will likely see more advanced AI
techniques, deeper integration of AI in games, and new game genres
driven by AI.
• Potential impact on game design and development: AI can change
how games are designed and developed, enabling new possibilities
and enhancing player experiences.
• Challenges and opportunities: The increasing use of AI in gaming
presents both challenges, such as ethical concerns, and opportunities
for innovation and growth.
AI FOR GAMING 28
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
The 18th Century Chess automation: Fraud?
AI FOR GAMING 29
Yetunde Folajimi, PhD
SCHOOL OF COMPUTING & DATA SCIENCE
Virtual Reality Timeline
AI FOR GAMING 30
Yetunde Folajimi, PhD
Source: Agarwal et al, 2020
SCHOOL OF COMPUTING & DATA SCIENCE
Summary
• AI and Game Development go hand in hand, offering new possibilities
for creating immersive and engaging gaming experiences.
• Throughout this course, we will explore various AI techniques,
including pathfinding, decision-making, machine learning, and natural
language processing.
• We will learn how to implement these techniques in Unity3D, a
powerful and widely-used game engine.
• By mastering these concepts, you'll be equipped to develop intelligent
and adaptive games that keep players engaged and entertained.
• Prepare for an exciting journey through the world of AI in game
development!
• Next Lecture 2: Unity3D: Overview and Setup
AI FOR GAMING 31
Yetunde Folajimi, PhD

More Related Content

PDF
Artificial Intelligence in Games Introduction.pdf
PPTX
Artificial Intelligence in Gaming
PPTX
Ai on video games
PPT
Why i love bees: ARG and collective intelligence
PPTX
2. Gamified Development and Gamified Solutions: Why Gamify?
PPTX
AI in gaming
PPT
New5th worldotro ncdc
PPTX
Game playing in artificial intelligent technique
Artificial Intelligence in Games Introduction.pdf
Artificial Intelligence in Gaming
Ai on video games
Why i love bees: ARG and collective intelligence
2. Gamified Development and Gamified Solutions: Why Gamify?
AI in gaming
New5th worldotro ncdc
Game playing in artificial intelligent technique

Similar to AI For Gaming lecture1 introduction to AI for Gaming.pdf (20)

PDF
L21 Games and Gamification
PDF
Why AI Is Shaping our games - Johanna Pirker, 2019
PDF
L22 Games and Gamification
PDF
Presentation sanlab workshops
PDF
Science and Videogames. Computational intelligence in videogames
KEY
Presentation game
PPTX
Artificial intelligence
PDF
AIES 2021 Keynote lecture
PDF
9,5 Theses on the Power and Efficacy of Gamification
PPTX
Game development history
PPTX
Games Workshop for the CTU Doctoral Symposium by Calongne 2014
PPT
Finalpowerpoint
PPTX
Artificial Intelligence and Game playing
PPTX
Applications of Artificial Intelligence subject
PPTX
Powerpoint4
PPTX
What We Talk About When We Talk About Mid-Core
PPTX
two player games .
PPTX
Video Games and Artificial-Realities.pptx
PPS
STKTS training 2014 Game design Cybeast Championship
PDF
Handmade Pixels: Indie and the Quest for making smaller, newer, and more auth...
L21 Games and Gamification
Why AI Is Shaping our games - Johanna Pirker, 2019
L22 Games and Gamification
Presentation sanlab workshops
Science and Videogames. Computational intelligence in videogames
Presentation game
Artificial intelligence
AIES 2021 Keynote lecture
9,5 Theses on the Power and Efficacy of Gamification
Game development history
Games Workshop for the CTU Doctoral Symposium by Calongne 2014
Finalpowerpoint
Artificial Intelligence and Game playing
Applications of Artificial Intelligence subject
Powerpoint4
What We Talk About When We Talk About Mid-Core
two player games .
Video Games and Artificial-Realities.pptx
STKTS training 2014 Game design Cybeast Championship
Handmade Pixels: Indie and the Quest for making smaller, newer, and more auth...
Ad

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Approach and Philosophy of On baking technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
Encapsulation_ Review paper, used for researhc scholars
MYSQL Presentation for SQL database connectivity
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
The AUB Centre for AI in Media Proposal.docx
Spectral efficient network and resource selection model in 5G networks
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Network Security Unit 5.pdf for BCA BBA.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Diabetes mellitus diagnosis method based random forest with bat algorithm
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Big Data Technologies - Introduction.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Approach and Philosophy of On baking technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Ad

AI For Gaming lecture1 introduction to AI for Gaming.pdf

  • 1. SCHOOL OF COMPUTING & DATA SCIENCE AI For Gaming Yetunde Folajimi, Ph.D.
  • 2. SCHOOL OF COMPUTING & DATA SCIENCE Lecture 1: AI FOR GAMING 2 Yetunde Folajimi, PhD Introduction to AI in Gaming
  • 3. SCHOOL OF COMPUTING & DATA SCIENCE Course Overview • AI in gaming: why it matters: • Understanding the importance of AI in enhancing the gaming experience and creating more engaging and immersive games. • The role of AI in game development: • AI helps create realistic characters and environments, automates content generation, and adapts gameplay to individual players. • AI techniques and tools for game development: • Overview of the AI techniques and tools that are commonly used in game development, such as pathfinding, decision-making, and machine learning. AI FOR GAMING 3 Yetunde Folajimi, PhD
  • 4. SCHOOL OF COMPUTING & DATA SCIENCE What is Artificial Intelligence? • Artificial Intelligence (AI) is a branch of computer science that aims to develop machines capable of performing tasks that typically require human intelligence. • Examples: Decision-making, learning, problem-solving, perception, and natural language understanding • AI vs. Traditional Programming: AI systems can learn and adapt to new situations, while traditional programming relies on explicit instructions • Game AI: This type of AI focuses on creating intelligent behaviors within a specific game context, aiming to provide enjoyable and engaging experiences for players. • General AI: This type of AI aims to create machines that can perform any intellectual task a human can do, often referred to as "strong AI." AI FOR GAMING 4 Yetunde Folajimi, PhD
  • 5. SCHOOL OF COMPUTING & DATA SCIENCE AI in Gaming • AI Research and development techniques to control nonplayer characters and enhance gameplay • more immersive, challenging, and innovative games • Goals: • Create more immersive and realistic environments • Improve non-player character (NPC) behavior • Enhance player experience • Generate dynamic & unpredictable gameplay • Create more “reasonable” challenging gameplay (no Cheating!). • Generate new ideas for game design • Analyze player behavior • Optimize computing resources AI FOR GAMING 5 Yetunde Folajimi, PhD Boss Battle
  • 6. SCHOOL OF COMPUTING & DATA SCIENCE AI in Gaming: Early History • Early video games used simple AI-controlled NPCs: • Rule-based algorithms that relied on simple if-then statements to dictate NPC behavior • Examples: • 1978: Space Invaders: The aliens moved in a predetermined pattern and sped up as the player progressed through the game • 1980: Pac-Man: Ghosts pursued the player character and changed direction when they hit a wall AI FOR GAMING 6 Yetunde Folajimi, PhD
  • 7. SCHOOL OF COMPUTING & DATA SCIENCE History of AI in Gaming: Early Beginnings (1950s-1960s) • 1950:Bertie the Brain, a video game version of tic-tac-toe, built by Dr. Josef Kates for the 1950 Canadian National Exhibition. Considered one of the first AI-controlled games. • 1962:Spacewar!, created by Steve Russell, Spacewar! was one of the earliest video games. It featured AI-controlled spaceships that simulated movements and attacks. AI FOR GAMING 7 Yetunde Folajimi, PhD
  • 8. SCHOOL OF COMPUTING & DATA SCIENCE History of AI in Gaming: Early Beginnings (1970s) • Board games began to be adapted for play against computer opponents (beginning of computerized board gaming) • 1972: Othello (Reversi) becomes the first board game to be computerized, with a program written by Michael F. S. McTear. • 1973: Arthur Samuel creates a checkers program that can play at the level of an amateur human player. • 1974: Richard Greenblatt and Thomas Knight write a chess program called MacHack VI that becomes the first computer program to defeat a human player in a chess tournament. • 1975: The first commercially available computerized board game, a backgammon program called "Backgammon Ace," is released for the Atari 2600 video game console. • 1976: Donald Michie creates a program called "MENACE" (Matchbox Educable Noughts And Crosses Engine) that can learn to play tic-tac-toe (also known as noughts and crosses) through trial and error. • 1977: Dan and Kathe Spracklen create a program called "Chinook" that becomes the first computer program to win a world championship in any game, in this case the game of checkers. • 1978: Claude Shannon, the father of information theory, develops a program called "Chesster" that is capable of playing a rudimentary game of chess. AI FOR GAMING 8 Yetunde Folajimi, PhD Arthur Samuel’s Checkers playing program Simple chess AI Source: https://blog.paessler.com/the-history-of-chess-ai
  • 9. SCHOOL OF COMPUTING & DATA SCIENCE History of AI in Gaming: Rise of Game AI (1980s – 1990s) • Game developers started incorporating AI techniques to enhance the gameplay experience: • 1980: Pac-Man introduced simple AI behavior for the ghosts, each with distinct patterns, such as chasing or patrolling. • 1983: AI defeated a human player in chess for the first time • 1984: (1) Elite, a space trading and combat game, used adaptive AI for enemies, allowing them to adapt to player strategies and evolve their tactics. (20) Karate Champ • 1985: The iconic platform game Super Mario Bros. showcased AI patterns and behaviors for enemies like Goombas and Koopas. • 1993: Doom, a popular first-person shooter that used advanced AI for its enemies AI FOR GAMING 9 Yetunde Folajimi, PhD
  • 10. SCHOOL OF COMPUTING & DATA SCIENCE History of AI in Gaming: Emergence of Intelligent Agents (2000s - 2010) • AI in gaming became more sophisticated, and featured intelligent agents that could make decisions and respond to complex situations • 2000 • The Sims, a life simulation game where AI-controlled characters had their own needs and desires • 2001 • Halo: Combat Evolved, pioneered advanced enemy AI and created dynamic combat scenarios featuring AI-controlled allies and enemies. • Grand Theft Auto III, an open-world game that featured a large number of AI-controlled NPCs with their own behaviors and interactions • 2003 • Call of Duty, another popular first-person shooter that used advanced AI for its enemies • 2005 • F.E.A.R a horror game that utilized advanced AI for enemy behavior, including tactical decisions, flanking maneuvers, and adaptive responses to the player's strategies to create tense and unpredictable combat scenarios. • 2008: • Left 4 Dead, a cooperative shooter that used advanced AI to create dynamic and unpredictable gameplay AI FOR GAMING 10 Yetunde Folajimi, PhD
  • 11. SCHOOL OF COMPUTING & DATA SCIENCE History of AI in Gaming: Machine Learning and Deep Learning (Beyond 2010) • Machine Learning and Deep Learning techniques enable AI systems to learn and improve from experience • 2011 • The Elder Scrolls V: Skyrim, featured AI-driven NPCs with complex routines, such as engaging in daily activities, interacting with the environment, and exhibiting realistic behaviors. • 2016 • AlphaGo, developed by DeepMind, defeated world champion Go player Lee Sedol. It utilized deep reinforcement learning and neural networks to master the complex game of Go. • 2018 • OpenAI Five showcased an AI team playing the popular game Dota 2 at a high level, demonstrating cooperative gameplay and strategic decision-making. • Red Dead Redemption 2 employed machine learning techniques to create realistic animal behavior, such as animals reacting to environmental stimuli and exhibiting natural movements. • AI used to generate content such as textures, environments, and levels. "No Man's Sky" used AI to generate an entire universe with over 18 quintillion planets. AI FOR GAMING 11 Yetunde Folajimi, PhD
  • 12. SCHOOL OF COMPUTING & DATA SCIENCE History of AI in Gaming: Machine Learning and Deep Learning (Beyond 2010) – contd. • 2019: AI-Assisted Gameplay: • AI used to enhance gameplay. "Assassin's Creed Odyssey" used AI to create realistic and intelligent enemy behavior that responded to player actions. • 2020: AI-Powered Game Engines: • AI used to power game engines, allowing for more complex gameplay mechanics. Unity introduced a machine learning toolkit that enabled developers to create more advanced AI systems. • 2021: AI-Generated Game Design: • AI used to generate game designs and mechanics. "DALL-E" was created by OpenAI using machine learning algorithms to generate a unique puzzle game. • 2022: AI-Driven Player Personalization: • AI used to personalize the player experience, creating a more immersive and engaging gameplay. "The Last of Us Part II" used AI to analyze player behavior and adapt the game difficulty and story based on the player's preferences. AI FOR GAMING 12 Yetunde Folajimi, PhD Assassin's Creed Odyssey Fight
  • 13. SCHOOL OF COMPUTING & DATA SCIENCE AI Techniques in Gaming • Includes rule-based systems, decision trees, and state machines, behavior trees, utility systems, pathfinding, etc • Rule-based systems: These are systems where NPCs follow a set of predefined rules or behaviors. • Decision Trees: Decision trees are hierarchical structures that help NPCs make decisions based on certain conditions. • State Machines: State machines are systems that manage the different states of an NPC and determine how they transition between states based on inputs. • Pathfinding and Navigation • Pathfinding: Finding the shortest or most efficient route between two points. Navigation: Moving along the path. • Importance of pathfinding in games: Pathfinding is crucial for realistic and efficient movement of NPCs and characters in games. • Common pathfinding algorithms: A* and Dijkstra's algorithms. AI FOR GAMING 13 Yetunde Folajimi, PhD
  • 14. SCHOOL OF COMPUTING & DATA SCIENCE AI Techniques in Gaming (contd.) • Decision Making • Decision making is important for NPCs to respond intelligently to different situations in the game. • Finite State Machines (FSM) represents an NPC's behavior as a set of states and transitions between them based on inputs. • Behavior trees are a hierarchical structure used to represent decision-making processes for NPCs • Machine Learning in Gaming • Machine learning is a subset of AI that focuses on creating algorithms that can learn from data and improve over time. • Supervised learning uses labeled data to learn patterns, while unsupervised learning finds patterns in unlabeled data. AI FOR GAMING 14 Yetunde Folajimi, PhD
  • 15. SCHOOL OF COMPUTING & DATA SCIENCE AI Techniques in Gaming (contd.) • Reinforcement Learning • Reinforcement learning is a type of machine learning where an agent learns to make decisions by interacting with an environment and receiving feedback in the form of rewards or penalties. • Q-Learning is a popular reinforcement learning technique, while Deep Q- Networks combine Q-Learning with deep neural networks for more complex problems. • Examples of games using reinforcement learning: Examples include AlphaGo, which defeated the world champion in the game of Go, and OpenAI Five, which played competitive matches against professional Dota 2 players. • Natural Language Processing (NLP) • NLP is a subfield of AI focused on enabling machines to understand, interpret, and generate human language. • NLP can be used to create more engaging dialogues, immersive narratives, and realistic interactions with NPCs. • Common NLP techniques: Text classification, sentiment analysis, and language generation. AI FOR GAMING 15 Yetunde Folajimi, PhD
  • 16. SCHOOL OF COMPUTING & DATA SCIENCE AI Techniques in Gaming (contd.) • Interactive Dialog Systems • These systems allow players to have dynamic and natural conversations with NPCs. • Rule-based dialog systems: Use predefined rules and decision trees to generate dialogues. • Machine learning-based dialog systems: Use machine learning techniques, such as neural networks, to generate more natural and context-aware dialogues. • Procedural Content Generation (PCG) • PCG is the process of algorithmically creating game content, such as levels, characters, and narratives. • PCG can save development time, add replay value, and create unique experiences for each player. • Types of PCG: Level design involves creating game worlds, character generation focuses on creating NPCs, and narrative involves creating dynamic storylines. • Examples: • Minecraft uses PCG to generate its randomly generated worlds. • No Man's Sky: No Man's Sky uses PCG to generate its vast universe, including planets, animals, and vegetation, as well as the game's missions and quests. • Diablo III uses PCG to create its randomized dungeons’ layout, monsters, loot, and traps. • Spelunky uses PCG to create its randomized levels with different layouts, traps, and enemies. AI FOR GAMING 16 Yetunde Folajimi, PhD
  • 17. SCHOOL OF COMPUTING & DATA SCIENCE Case Study 1 – Middle-Earth: Shadow of Mordor • Game overview: • Action-adventure game set in the Lord of the Rings universe, developed by Monolith Productions. • AI techniques used: • The game features the Nemesis System, an AI-driven system that dynamically generates unique and memorable enemies based on player interactions. • Impact on gameplay: • The Nemesis System creates a personalized and dynamic game world, as the player's actions directly impact the hierarchy and relationships between enemies, adding replay value and increasing player engagement. AI FOR GAMING 17 Yetunde Folajimi, PhD https://gfycat.com/
  • 18. SCHOOL OF COMPUTING & DATA SCIENCE Case Study 3 - Alien: Isolation • Game overview: • Alien: Isolation is a survival horror game developed by Creative Assembly, in which the player must avoid a deadly alien creature. • AI techniques used: • The game's AI system features two distinct layers – one for the alien's "instincts" and another for its "strategy" – which work together to create unpredictable and adaptive behavior. • Impact on gameplay: • The advanced AI system makes the alien an unpredictable and terrifying opponent, contributing to the game's intense atmosphere and enhancing the player's sense of immersion. AI FOR GAMING 18 Yetunde Folajimi, PhD https://gfycat.com/
  • 19. SCHOOL OF COMPUTING & DATA SCIENCE Case Study 3 – Left 4 Dead • Game overview: • Left 4 Dead is a cooperative first-person shooter developed by Valve Corporation, where players work together to survive a zombie apocalypse. • AI techniques used: • The game uses an AI "Director" to dynamically adjust the pacing and difficulty of the game based on player performance and actions. • Impact on gameplay: • The AI Director ensures that each playthrough is unique and engaging, adapting the game to suit different player preferences and skill levels, and fostering a sense of replayability. AI FOR GAMING 19 Yetunde Folajimi, PhD https://gfycat.com/
  • 20. SCHOOL OF COMPUTING & DATA SCIENCE Case Study 4 – No Man's Sky • Game overview: • No Man's Sky is an open-world exploration game developed by Hello Games, set in a procedurally generated universe with 18 quintillion unique planets. • AI techniques used: • The game combines procedural content generation (PCG) with AI techniques to create diverse and dynamic ecosystems, including unique creatures and plants. • Impact on gameplay: • The combination of PCG and AI results in an expansive and immersive game world, offering players endless opportunities for exploration and discovery. AI FOR GAMING 20 Yetunde Folajimi, PhD https://gfycat.com/
  • 21. SCHOOL OF COMPUTING & DATA SCIENCE Academic AI Versus Industry AI • Academia often pursues theoretical advancements, while industry focuses on practical applications • The gaming sector presents unique opportunities and challenges for both • Academic AI in Gaming • Focus on fundamental research and algorithms • Often open-source and accessible for learning and further research • Limited by resources but not by market pressures • Industry AI in Gaming • Driven by market needs and commercial viability • Emphasis on product development and user experience • Operates under resource constraints and deadlines • Collaborations between Academic and Industry AI • Collaborations often lead to innovation in the gaming industry • Industry can provide real-world application scenarios for academic AI • Academia can supply novel ideas and techniques to the industry AI FOR GAMING 21 Yetunde Folajimi, PhD
  • 22. SCHOOL OF COMPUTING & DATA SCIENCE Ethical Considerations • Ensuring generated content is appropriate and relevant • Respecting player privacy when analyzing in-game text input • Balancing procedural generation with artistic direction AI FOR GAMING 22 Yetunde Folajimi, PhD Unpredictability of outcome •Unpredictabl outcomes may inadvertently produce inappropriate content Privacy concerns • Collection and use of player data in AI- driven analytics and personalization Addiction • AI can create more engaging experiences, leading to addictive gameplay and unhealthy behaviors. Fairness and bias • Unintentional perpetuation of biases in training data can lead to unfair outcomes in games
  • 23. SCHOOL OF COMPUTING & DATA SCIENCE Ethical Considerations: Bias and Fairness in AI • AI algorithms can inadvertently perpetuate or exacerbate existing biases • Unfair treatment of players based on demographics, preferences, or play style may arise • Example: In-game AI character interactions biased against certain player choices or identities • Developers must be proactive in identifying and mitigating biases in AI systems AI FOR GAMING 23 Yetunde Folajimi, PhD Source: infoworld.com
  • 24. SCHOOL OF COMPUTING & DATA SCIENCE Ethical Considerations: Privacy and Data Security • AI-driven games may collect large amounts of player data to provide personalized experiences • Ensuring the privacy and security of this data is essential to protect players' rights • Developers should follow data protection regulations and best practices, such as GDPR • Example: Implementing end-to-end encryption and anonymizing player data AI FOR GAMING 24 Yetunde Folajimi, PhD Source: “The dangers of in-game data collection” https://www.polygon.com/features/2019/5/9/18522937/v ideo-game-privacy-player-data-collection
  • 25. SCHOOL OF COMPUTING & DATA SCIENCE Ethical Considerations: Transparency and Explainability • Players should understand how AI- driven game mechanics work and influence their experiences • Developers should strive for transparency and explainability in their AI systems • This helps build trust between players and developers, and encourages informed decision-making • Example: Providing clear explanations of AI-driven matchmaking or procedural content generation AI FOR GAMING 25 Yetunde Folajimi, PhD Source: “The dangers of in-game data collection” https://www.polygon.com/features/2019/5/9/18522937/v ideo-game-privacy-player-data-collection
  • 26. SCHOOL OF COMPUTING & DATA SCIENCE Ethical Considerations: Addiction and Mental Health • AI-driven games can be designed to optimize player engagement and retention • However, this may lead to concerns about addiction and mental health implications • Developers should consider the potential impact on players and design responsibly • Example: Implementing features that encourage healthy gaming habits, such as time limits or cooldown periods AI FOR GAMING 26 Yetunde Folajimi, PhD
  • 27. SCHOOL OF COMPUTING & DATA SCIENCE Ethical Considerations: Responsibilities of Game Developers • Address and mitigate biases in AI systems • Protect player privacy and data security • Be transparent about AI-driven game mechanics • Consider addiction and mental health implications • Encourage a culture of ethical AI development within the gaming industry AI FOR GAMING 27 Yetunde Folajimi, PhD https://ssir.org/articles/entry/ai_ethics_are_in_dange r_funding_independent_research_could_help
  • 28. SCHOOL OF COMPUTING & DATA SCIENCE Future of AI in Gaming • Trends in AI and gaming: The future will likely see more advanced AI techniques, deeper integration of AI in games, and new game genres driven by AI. • Potential impact on game design and development: AI can change how games are designed and developed, enabling new possibilities and enhancing player experiences. • Challenges and opportunities: The increasing use of AI in gaming presents both challenges, such as ethical concerns, and opportunities for innovation and growth. AI FOR GAMING 28 Yetunde Folajimi, PhD
  • 29. SCHOOL OF COMPUTING & DATA SCIENCE The 18th Century Chess automation: Fraud? AI FOR GAMING 29 Yetunde Folajimi, PhD
  • 30. SCHOOL OF COMPUTING & DATA SCIENCE Virtual Reality Timeline AI FOR GAMING 30 Yetunde Folajimi, PhD Source: Agarwal et al, 2020
  • 31. SCHOOL OF COMPUTING & DATA SCIENCE Summary • AI and Game Development go hand in hand, offering new possibilities for creating immersive and engaging gaming experiences. • Throughout this course, we will explore various AI techniques, including pathfinding, decision-making, machine learning, and natural language processing. • We will learn how to implement these techniques in Unity3D, a powerful and widely-used game engine. • By mastering these concepts, you'll be equipped to develop intelligent and adaptive games that keep players engaged and entertained. • Prepare for an exciting journey through the world of AI in game development! • Next Lecture 2: Unity3D: Overview and Setup AI FOR GAMING 31 Yetunde Folajimi, PhD