Game playing
 GAMES ARE FUN! .THEY ARE LIMITED, WELL-DEFINED RULES .THEY PROVIDE
ADVANCED, EXISTING TEST-BEDS FOR DEVELOPING SEVERAL IDEAS AND
TECHNIQUES THAT ARE USEFUL ELSEWHERE.
Area of interest
 Definitions
 History, Overview
 Concepts
 Applications
 Current trends in this field
 One of the most studied and
most interesting areas of
Artificial Intelligence is game
playing. They are Fun, and
HARD to create
DEFINITION
 Game artificial intelligence refers to techniques used in computer and video
games to produce the illusion of intelligence in the behavior of non-player
characters (NPCs)
 Hacks and cheats are acceptable and, in many cases, the computer abilities must
be toned down to give human players a sense of fairness. E.g racing and shooting
 Emphasis of game AI is on developing rational agents to match or exceed human
performance
Definition cont …
 AI has continued to improve, with aims set on a player being unable to tell the
difference between computer and human players - remember Turin test?
 A game must ‘feel’ natural
 Obey laws of the game
 Characters aware of the environment
 Path finding (A* algorithm)
 Decision making
 Planning
 Game ‘bookkeeping’, scoring
 ~50% of game project time is spent on building AI
Why are games relevant to AI?
 Games are fun!
 They are limited, well-defined rules
 They provide advanced, existing test-beds for developing several ideas and techniques that are useful
elsewhere.
 They are one of the few domains that allow us to build agents.
 Studying games teaches us how to deal with other agents trying to foil our plans
 Huge state spaces – Games are highly complex! Usually, there is not enough time to work out the
perfect move. E.g Go & Chess
 Nice, clean environment with clear criteria for success
 Game playing is considered an intelligent human activity.
 AI has always been interested in abstract games.
 Games present an ideal environment where hostile agents may compete
State space
 Coarser-grain than Tactical AI (Very Large space search)
 Problem solving
 Goal formulation
 Problem formulation
 Search
 Solution
 Execution
The Illusion of Human Behaviour
 Game AI is about the illusion of human behaviour
 Smart, to a certain extent (Creativity)
 Non-repeating behaviour
 Unpredictable but rational decisions
 Emotional influences (Irrationality, ‘Personality’)
 Body language to communicate emotions
 Being integrated in the environment
 Game AI needs various computer science disciplines
 Knowledge Based Systems
 Machine Learning
 Multi-agent Systems
 Computer Graphics & Animation
 Data Structures
Computer Games Types
 Strategy Games
 Real-Time Strategy (RTS)
 Turn-Based Strategy (TBS)
 Helicopter view
 Role-Playing Games (RPG)
 Single-Player
 Multi-Player (MMORPG)
 Action Games
 First-Person Shooters (FPS)
 First-Person Sneakers
 Sports Games
 Simulations
 Adventure Games
 Puzzle Games
History and overview
 Minimax - Developed by John von Neumann in 1928 - This algorithm is used
extensively in game theory
 Samuel’s learning program (1959) - The program learns through the manipulation
of the summation of heuristics. - If the program wins, it raises high heuristic values and
lowers low ones. If it loses, it does the opposite.
 1960s - Progress and success in Game AI. - Creating a successful AI meant coming up
with the right rules for it to follow. 1970s-1980s - Transition to games as entertainment
- Using search based AI to emulate entertaining characters would be unnatural and
clumsy - Game play is based more on skill than on rules
 Early 1990s - Increased realism becomes the primary focus of the game industry - A
rift develops between the developers of popular games and AI researchers
CONCEPTS Technologies / techniques
used
 Machine learning
 Waypoint Graph
 Continuous Control
 Cellular Automata
 Case Based Reasoning
 Blend Database
 Dynamic Programming
 Finite State Machines
 Fuzzy Logic
 Influence Mapping
 Motion Graph
 Motion Capture
 Navigation Mesh
 Navigation Graph
 Artificial Neural Networks
 Policy Search
 Path Planning
 Path Following
 Steering
 Alpha-Beta pruning
 MiniMax
Game setup
 Two players: A and B
 A moves first and they take turns until the game is over. Winner gets award, loser gets
penalty.
 Games as search:
 Initial state: e.g. board configuration of chess
 Successor function: list of (move, state) pairs specifying legal moves.
 Terminal test: Is the game finished?
 Utility function: Gives numerical value of terminal states. E.g. win (+1), lose (-1) and draw (0)
in tic-tac-toe
 A uses search tree to determine next move.
How to Play a Game by Searching
 General Scheme
-Consider all legal moves, each of which will lead to some new state of the
environment (‘board position’)
 Evaluate each possible resulting board position
 Pick the move which leads to the best board position.
 Wait for your opponent’s move, then repeat.
 Key problems
 Representing the ‘board’
 Representing legal next boards
 Evaluating positions
 Looking ahead
Applications
 Training Simulators
 Effective training often requires thousands of people
 Computer generated stand-ins can cut costs
 Military simulations
 Management simulations
 Economic simulations
 Education
 Software for pre-school children
 Entertainment
 Virtual Environments
 Simulated worlds allows AI researchers to concentrate on algorithms instead of sensors
 Again, computer generated robots are cheaper than actual robots
Applications
 Human-level AI
 Every person is an expert on human-level intelligence
 Testing of AI is easy
 Movies
 Crowd scenes
 Flocking behavior
 Realistic Movement
Game AI Major Challenges
 Resources - Realism in computer games focused on graphics - Advanced
graphics requires many CPU cycles - Recent advances in computer hardware have
someone alleviated this issue.
 Deadlines - Game engine must be developed before AI can be tested - AI
programmers often have to compromise to meet deadlines
 Over Intelligence - Perfect AI would be easier to code - It would lack
believability and not be fun. - Human-level AI should quit, surrender, or run away-
even fight to the end.
 Research and Development - Lack of cohesion between AI research community
and game developers - AI in modern computer games seems trivial to AI
researchers
Summary
 Games are to AI as grand prix racing is to automobile design Games are fun to
work on (and dangerous)
 They illustrate several important points about AI
 perfection is unattainable, must approximate
 it is a good idea to think about what to think about
 uncertainty constrains the assignment of values to states
References
 Artificial Intelligence: A Modern Approach' (Second Edition) by Stuart Russell and
Peter Norvig, Prentice Hall Pub.
 http://www.cs.umbc.edu/471/notes/pdf/games.pdf
 http://l3d.cs.colorado.edu/courses/AI-96/sept23glecture.pdf
 Theodore L. Turocy, Texas A&M University, Bernhard von Stengel, London School
of Economics "Game Theory" CDAM Research Report Oct. 2001
 http://www.uni-koblenz.de/~beckert/Lehre/Einfuehrung-KI-SS2003/folien06.pdf
[6] http://ai-depot.com/LogicGames/MiniMax.html

Artificial intelligence

  • 1.
    Game playing  GAMESARE FUN! .THEY ARE LIMITED, WELL-DEFINED RULES .THEY PROVIDE ADVANCED, EXISTING TEST-BEDS FOR DEVELOPING SEVERAL IDEAS AND TECHNIQUES THAT ARE USEFUL ELSEWHERE.
  • 2.
    Area of interest Definitions  History, Overview  Concepts  Applications  Current trends in this field  One of the most studied and most interesting areas of Artificial Intelligence is game playing. They are Fun, and HARD to create
  • 3.
    DEFINITION  Game artificialintelligence refers to techniques used in computer and video games to produce the illusion of intelligence in the behavior of non-player characters (NPCs)  Hacks and cheats are acceptable and, in many cases, the computer abilities must be toned down to give human players a sense of fairness. E.g racing and shooting  Emphasis of game AI is on developing rational agents to match or exceed human performance
  • 4.
    Definition cont … AI has continued to improve, with aims set on a player being unable to tell the difference between computer and human players - remember Turin test?  A game must ‘feel’ natural  Obey laws of the game  Characters aware of the environment  Path finding (A* algorithm)  Decision making  Planning  Game ‘bookkeeping’, scoring  ~50% of game project time is spent on building AI
  • 5.
    Why are gamesrelevant to AI?  Games are fun!  They are limited, well-defined rules  They provide advanced, existing test-beds for developing several ideas and techniques that are useful elsewhere.  They are one of the few domains that allow us to build agents.  Studying games teaches us how to deal with other agents trying to foil our plans  Huge state spaces – Games are highly complex! Usually, there is not enough time to work out the perfect move. E.g Go & Chess  Nice, clean environment with clear criteria for success  Game playing is considered an intelligent human activity.  AI has always been interested in abstract games.  Games present an ideal environment where hostile agents may compete
  • 6.
    State space  Coarser-grainthan Tactical AI (Very Large space search)  Problem solving  Goal formulation  Problem formulation  Search  Solution  Execution
  • 7.
    The Illusion ofHuman Behaviour  Game AI is about the illusion of human behaviour  Smart, to a certain extent (Creativity)  Non-repeating behaviour  Unpredictable but rational decisions  Emotional influences (Irrationality, ‘Personality’)  Body language to communicate emotions  Being integrated in the environment  Game AI needs various computer science disciplines  Knowledge Based Systems  Machine Learning  Multi-agent Systems  Computer Graphics & Animation  Data Structures
  • 8.
    Computer Games Types Strategy Games  Real-Time Strategy (RTS)  Turn-Based Strategy (TBS)  Helicopter view  Role-Playing Games (RPG)  Single-Player  Multi-Player (MMORPG)  Action Games  First-Person Shooters (FPS)  First-Person Sneakers  Sports Games  Simulations  Adventure Games  Puzzle Games
  • 9.
    History and overview Minimax - Developed by John von Neumann in 1928 - This algorithm is used extensively in game theory  Samuel’s learning program (1959) - The program learns through the manipulation of the summation of heuristics. - If the program wins, it raises high heuristic values and lowers low ones. If it loses, it does the opposite.  1960s - Progress and success in Game AI. - Creating a successful AI meant coming up with the right rules for it to follow. 1970s-1980s - Transition to games as entertainment - Using search based AI to emulate entertaining characters would be unnatural and clumsy - Game play is based more on skill than on rules  Early 1990s - Increased realism becomes the primary focus of the game industry - A rift develops between the developers of popular games and AI researchers
  • 10.
    CONCEPTS Technologies /techniques used  Machine learning  Waypoint Graph  Continuous Control  Cellular Automata  Case Based Reasoning  Blend Database  Dynamic Programming  Finite State Machines  Fuzzy Logic  Influence Mapping  Motion Graph  Motion Capture  Navigation Mesh  Navigation Graph  Artificial Neural Networks  Policy Search  Path Planning  Path Following  Steering  Alpha-Beta pruning  MiniMax
  • 11.
    Game setup  Twoplayers: A and B  A moves first and they take turns until the game is over. Winner gets award, loser gets penalty.  Games as search:  Initial state: e.g. board configuration of chess  Successor function: list of (move, state) pairs specifying legal moves.  Terminal test: Is the game finished?  Utility function: Gives numerical value of terminal states. E.g. win (+1), lose (-1) and draw (0) in tic-tac-toe  A uses search tree to determine next move.
  • 12.
    How to Playa Game by Searching  General Scheme -Consider all legal moves, each of which will lead to some new state of the environment (‘board position’)  Evaluate each possible resulting board position  Pick the move which leads to the best board position.  Wait for your opponent’s move, then repeat.  Key problems  Representing the ‘board’  Representing legal next boards  Evaluating positions  Looking ahead
  • 13.
    Applications  Training Simulators Effective training often requires thousands of people  Computer generated stand-ins can cut costs  Military simulations  Management simulations  Economic simulations  Education  Software for pre-school children  Entertainment  Virtual Environments  Simulated worlds allows AI researchers to concentrate on algorithms instead of sensors  Again, computer generated robots are cheaper than actual robots
  • 14.
    Applications  Human-level AI Every person is an expert on human-level intelligence  Testing of AI is easy  Movies  Crowd scenes  Flocking behavior  Realistic Movement
  • 15.
    Game AI MajorChallenges  Resources - Realism in computer games focused on graphics - Advanced graphics requires many CPU cycles - Recent advances in computer hardware have someone alleviated this issue.  Deadlines - Game engine must be developed before AI can be tested - AI programmers often have to compromise to meet deadlines  Over Intelligence - Perfect AI would be easier to code - It would lack believability and not be fun. - Human-level AI should quit, surrender, or run away- even fight to the end.  Research and Development - Lack of cohesion between AI research community and game developers - AI in modern computer games seems trivial to AI researchers
  • 16.
    Summary  Games areto AI as grand prix racing is to automobile design Games are fun to work on (and dangerous)  They illustrate several important points about AI  perfection is unattainable, must approximate  it is a good idea to think about what to think about  uncertainty constrains the assignment of values to states
  • 17.
    References  Artificial Intelligence:A Modern Approach' (Second Edition) by Stuart Russell and Peter Norvig, Prentice Hall Pub.  http://www.cs.umbc.edu/471/notes/pdf/games.pdf  http://l3d.cs.colorado.edu/courses/AI-96/sept23glecture.pdf  Theodore L. Turocy, Texas A&M University, Bernhard von Stengel, London School of Economics "Game Theory" CDAM Research Report Oct. 2001  http://www.uni-koblenz.de/~beckert/Lehre/Einfuehrung-KI-SS2003/folien06.pdf [6] http://ai-depot.com/LogicGames/MiniMax.html