CS 4730 Game AI CS 4730 – Computer Game Design Some slides courtesy Tiffany Barnes, NCSU.

Slides:



Advertisements
Similar presentations
7.1. O SCARS & A RTIFICIAL I NTELLIGENCE Interim awards and introduction to game AI.
Advertisements

RL for Large State Spaces: Value Function Approximation
Evolution of Artificial Intelligence In Video Games
Machine Learning in Computer Games Learning in Computer Games By: Marc Ponsen.
Artificial Intelligence in Game Design Representing NPCs as Finite State Machines.
Artificial Intelligence CGDD Artificial Intelligence Human-level intelligence - an unsolved problem AI “describes the intelligence embodied in any.
Artificial Intelligence in Game Design Intelligent Decision Making and Decision Trees.
Artificial Intelligence in Game Design Introduction to Learning.
Artificial Intelligence in Game Design Hierarchical Finite State Machines.
How do games work? Game Workshop July 4, Parts Sprites/pictures Map/background Music/sounds Player character Enemies Objects.
RED DEAD REVOLVER Artificial Intelligence Critique By Mitchell C. Dodes CIS 588.
Games Programming III (TGP2281) – T1, 2010/2011 Game AI Fundamentals John See 15 November 2010.
Game Design and Programming. Objectives Classify the games How games are design How games are implemented What are the main components of a game engine.
Artificial Intelligence in Game Design Probabilistic Finite State Machines.
Chapter 3.6 Game Architecture. 2 Overall Architecture The code for modern games is highly complex With code bases exceeding a million lines of code, a.
Neural Networks Slides by Megan Vasta. Neural Networks Biological approach to AI Developed in 1943 Comprised of one or more layers of neurons Several.
Artificial Intelligence in Video Games Jason Fuller 1.
CS 4730 AI and Pathfinding CS 4730 – Computer Game Design Some slides courtesy Tiffany Barnes, NCSU.
Chapter 11: Artificial Intelligence
Artificial Intelligence in Game Design Problems and Goals.
Chapter 13: Artificial Intelligence Chapter 13 Artificial Intelligence Page 139 Computations that make it possible for a machine to perceive, reason,
Game AI Fundamentals. What is Artificial Intelligence (AI)? Not easy to answer… “Ability of a computer or other machine to perform those activities that.
Survey of AI for games. AI vs. AI for games Traditional AI: – Made to handle unseen inputs, large state space – Too many options possible to compute an.
10/5/20151 Game elements Game Design Vishnu Kotrajaras, PhD.
Artificial Intelligence Introductory Lecture Jennifer J. Burg Department of Mathematics and Computer Science.
Jorge Munoz, German Gutierrez, Araceli Sanchis Presented by: Itay Bittan.
Artificial Intelligence in Game Design
CS 4730 Action vs. Interaction CS 4730 – Computer Game Design Credit: Several slides from Walker White (Cornell)
Artificial Intelligence Techniques Artificial Stupidity?
MICHAEL FINE Artificial Intelligence and The Singularity 1.
AI in games Roger Crawfis/Eric Fosler-Lussier CSE 786 Game Design.
Math / Physics 101 GAM 376 Robin Burke Fall 2006.
Idea1 : Net Aooni Arcade Idea2 : Shooting Arcade Project Brainstorming Computer Game 2011 Fall ♣ Lee Sang Min.
Machine Learning in Computer Games Marc Ponsen 11/29/04.
Chapter 1 Introduction to Game AI April 11,
Artificial Intelligence in Game Design Dynamic Path Planning Algorithms.
CS 4730 Game Architecture CS 4730 – Computer Game Design Credit: Some slide material courtesy Walker White (Cornell)
I Robot.
Artificial Intelligence in Game Design Complex Steering Behaviors and Combining Behaviors.
Artificial intelligence
Artificial Intelligence for Games Finite State Machines
Artificial Intelligence and Searching CPSC 315 – Programming Studio Spring 2013 Project 2, Lecture 1 Adapted from slides of Yoonsuck Choe.
Computational theory techniques in interactive video games.
Intelligent Database Systems Lab 國立雲林科技大學 National Yunlin University of Science and Technology 1 Evolving Reactive NPCs for the Real-Time Simulation Game.
AI Evaluation David Nowell CIS 588 2/14/05 Baldur’s Gate.
Artificial Intelligence Research in Video Games By Jacob Schrum
Artificial Intelligence in Games
CSE4AT3 Design Balancing Continued……………………………… …………………………………………..
Dr Nick Mitchell (Room CM 224)
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
Game AI Matthew Hsieh Meng Tran. Computer Games Many different genres  Action  Role Playing  Adventure  Strategy  Simulation  Sports  Racing Each.
Artificial Intelligence in Game Design Lecture 20: Hill Climbing and N-Grams.
Designing Intelligence Logical and Artificial Intelligence in Games Lecture 2.
Finite State Machines Logical and Artificial Intelligence in Games Lecture 3a.
Understanding AI of 2 Player Games. Motivation Not much experience in AI (first AI project) and no specific interests/passion that I wanted to explore.
The Game Development Process: Artificial Intelligence.
Chapter 14 Part 1: Core Game Mechanics By Nolan Driessen.
Game Architecture Rabin is a good overview of everything to do with Games A lot of these slides come from the 1st edition CS 4455.
Chapter 11: Artificial Intelligence
Chapter 11: Artificial Intelligence
Artificial Intelligence and Searching
CIS 488/588 Bruce R. Maxim UM-Dearborn
Finite State Machines in Games
Interaction with artificial intelligence in games
Solving Problems with Artificial Neural Networks (ANNs)
Chapter 14 Part 1: Core Game Mechanics By Nolan Driessen
Artificial Intelligence and Searching
Artificial Intelligence and Searching
Presentation transcript:

CS 4730 Game AI CS 4730 – Computer Game Design Some slides courtesy Tiffany Barnes, NCSU

CS 4730 The Loop of Life Games are driven by a game loop that performs a series of tasks every frame Some games have separate loops for the front and and the game itself Other games have a unified main loop 2

CS 4730 The Game Loop Tasks –Handling time –Gathering player input –Networking –Simulation –Collision detection and response –Object updates –Rendering –Other miscellaneous tasks 3

CS 4730 The Game Loop Tasks –Handling time –Gathering player input –Networking –Simulation –Collision detection and response –Object updates –Rendering –Other miscellaneous tasks 4

CS 4730 What all do you have to simulate? Physics Environments Lighting Sounds Behaviors 5

CS 4730 Some Terms To Know AI: Artificial Intelligence – does not have to mean perfect human-like intelligence! Turing Test: Can a normal user tell the difference between interacting with a computer and a person NPC: Non-Player Character – any thing in the world that needs to be modeled, can make decisions, and can potentially have player interaction 6

CS 4730 Discussion How good should the AI be? 7

CS 4730 Discussion Are people more fun than NPCs? Why? 8

CS 4730 AI vs. Game AI Modern AI research is more in genetic algorithms and neural networks This isn’t really an option for game AI (right now) –We value efficiency over complexity –Too much other stuff to do in the game loop! –AI for us just has to be “good enough” to be fun We will look at three main AI roles: –State-based behavior, planning/strat, pathfinding 9

CS 4730 What Makes “Good AI”? Perceived by user as challenging –Cruel, but fair! User is surprised by the game –but later understands why Feeling that reality will provide answers –able to make progress solving problem What games have used AI effectively? 10

CS 4730 The Bar To Reach Have you failed in your attempt to create a game if your NPCs can’t pass the Turing Test? NO! Of course not! Sometimes NPCs can pass the Turing Test in very specific circumstances –Computer chess player Sometimes NPCs will never pass the Turing Test and we’re okay with that! –Koopa Troopas in Super Mario Bros. 3 11

CS 4730 “Good Enough” Your AI needs to be “good enough for the player to be challenged…” And “bad enough for the player to have fun…” Games are often played to escape from reality Playing against an AI that’s “too good” is incredibly frustrating Imagine a computer player of Othello or Scrabble that ONLY took optimal moves 12

CS 4730 The AI Loop Given the changes to the environment, what should the NPC do? Cognition of the NPC –Perception (processing the state of the environment) or “Sense” –Decision making (decide what to do based on perception) or “Plan” –Control (update NPC one time step) or “Act” 13

CS 4730 Perception The NPC’s estimation of game-related information Includes perceived strategies of PCs Identifies most important factors for the NPC to respond to Think of it as the NPCs “attention span” 14

CS 4730 Decision Making Determining a course of action for this time step for this particular state of the game Usually requires a trade off between accuracy of the decision and speed of computation Computer COULD simulate out several steps to make a “better” decision, but at a cost of speed and potentially “fun” 15

CS 4730 Control Adjusting the appropriate variables of the NPC to carry out the decision made –Steering or throttle in a racing game –Crouching or taking a shot in an FPS –Using a potion or casting a spell in an RPG 16

CS 4730 The Sum Of The Parts The sum of all these parts makes up the AI of an NPC It can be incredibly complex –Large fight in a tactical shooter It can be pattern based –Behaviors of a sentry in Metal Gear Solid –Behaviors of any boxer in Punch Out It can be … well, stupid –Goombas or Koopas in Super Mario Bros. 3 17

CS 4730 Pong AI What is the challenge in creating the AI for Pong? 18

CS 4730 Chase/Evade Consider a very simple AI task Algorithm for the predator?

CS 4730 Enhancements to Chase Speed Control –Velocity, Acceleration max/min –Limited turning Radius Randomness –Moves –Patterns

CS 4730 Steering Behaviors Pursue Evade Wander Obstacle Avoidance Wall/Path following Queuing Combine behaviors with weights What could go wrong?

CS 4730 AI Strategies Reaction vs. Deliberation When having the NPC make a decision, how much thought goes into the next move? How is the AI different in: –Frozen Synapse –Kingdom Hearts –Civilization –Halo 22

CS 4730 AI Strategies Reaction-Based –Fast, but limited capabilities Implementations –Finite-State Machines –Rule-Based Systems –Set Pattern 23

CS 4730 AI Strategies Deliberation-Based –Much slower, but more adaptable Implementations –A* / Dijkstra –Roadmaps –Genetic Algorithms 24

CS 4730 Set Pattern Describe the AI behavior of a Koopa Troopa –Or any other bad guy from SMB3 25

CS 4730 Finite-State Machines An abstract construct for determining the behavior of an NPC Any given behavior state is represented along with rules for transitioning between states The standard bad guys in Metal Gear Solid are excellent examples of this 26

CS 4730 Switch FSM 27

CS 4730 Switch FSM void RunLogic( int * state ) { switch( state ) { case 0: //Wander Wander(); if( SeeEnemy() ) { *state = 1; } break; case 1: //Attack Attack(); if( LowOnHealth() ) { *state = 2; } if( NoEnemy() ) { *state = 0; } break; case 2: //Flee Flee(); if( NoEnemy() ) { *state = 0; } break; } 28

CS 4730 Switch FSM Within each state can be more complex AI In Metal Gear Solid, when an enemy sees you, they follow you as long as you are “discovered” When the discovery period expires, the enemies return to their previous state, which is set pattern 29

CS 4730 More Advanced FSM 30

CS 4730 Problems with State Machines Too Predictable –Sometimes a good thing, sometimes not Limited –Can have a very small set of options available at any one time 31

CS 4730 Probabilistic FSMs We can change the personality of an NPC by adjusting the state probabilities 32

CS 4730 Probabilistic FSMs Other aspects: –Sight –Memory –Curiosity –Fear –Anger –Sadness –Sociability Modify probabilities on the fly? 33

CS 4730 Goal Based The NPC has a central goal to achieve and a set of operations it can use It will selectively choose an operation based on which will get it closer to the goal at that moment Goal could be nearly anything –A particular score –Health of the PC 34