Computational theory techniques in interactive video games.

Slides:



Advertisements
Similar presentations
Solving problems by searching
Advertisements

Heuristic Search techniques
Finite State Machines. Finite State Machines (FSMs) An abstract machine that can exist in one of several different and predefined states Defines a set.
AI Pathfinding Representing the Search Space
8.3. A GENT AND D ECISION M AKING AI Agent driven AI and associated decision making techniques.
Game AI Kevin Dill Senior AI Engineer Blue Fang Games
Pathfinding Basic Methods.
Lecture 12: Revision Lecture Dr John Levine Algorithms and Complexity March 27th 2006.
CSE 380 – Computer Game Programming Pathfinding AI
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
The Game Development Process Game Architecture. Outline Tokens Initial Architecture Development Nearing Release Postmortem.
QUICK MATH REVIEW & TIPS 2
Artificial Intelligence in Game Design Introduction to Learning.
1 AI for Computer Game Developers Finite state machines Path finding and waypoints A-Star path finding.
Multi-Source Shortest Paths T. Patrick Bailey CSC 5408 Graph Theory 4/28/2008.
Deteministic method (FSM) Dan Witzner Hansen. 2 Last week The objective of the course is to introduce the students to a wide variety of artificial intelligence.
Domineering Solving Large Combinatorial Search Spaces.
Games Programming III (TGP2281) – T1, 2010/2011 Game AI Fundamentals John See 15 November 2010.
UnInformed Search What to do when you don’t know anything.
Intelligent Pac-Man Ghost AI
A* Pathfinding Algorithm Game Design Experience Professor Jim Whitehead February 20, 2009 Creative Commons Attribution 3.0 (Except A* algorithm images)
By: Jamal Redman & Rashad Blackwell. Chapter 7 provides an overview of how educational software, apps, and learning games support and promote problem.
Quoridor Classic Game Manager Kevin Dickerson April 2004.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Graphs II Robin Burke GAM 376. Admin Skip the Lua topic.
CS426 Game Programming II Dan Fleck. Why games?  While the ideas in this course are demonstrated programming games, they are useful in all parts of computer.
Artificial Intelligence in Game Design Problems and Goals.
Game AI Fundamentals. What is Artificial Intelligence (AI)? Not easy to answer… “Ability of a computer or other machine to perform those activities that.
1 Game AI Path Finding. A Common Situation of Game AI A Common Situation of Game AI Path Planning Path Planning –From a start position to a destination.
Computer Science – Game DesignUC Santa Cruz CMPS 20: Game Design Experience 2D Movement Pathfinding.
Artificial Intelligence Lecture 9. Outline Search in State Space State Space Graphs Decision Trees Backtracking in Decision Trees.
WAES 3308 Numerical Methods for AI
TGP2281: Game Programming III also better known as Game AI.
P ROBLEM Write an algorithm that calculates the most efficient route between two points as quickly as possible.
Abstract: Cryptology is a combination of the processes of keeping a message secret (cryptography) and trying to break the secrecy of that message (cryptoanalysis).
“Planning is bringing the future into the present so that you can do something about it now.” – Alan Lakein Thought for the Day.
Machine Learning for an Artificial Intelligence Playing Tic-Tac-Toe Computer Systems Lab 2005 By Rachel Miller.
Piñata Game: Keeping Score in Alice By Maggie Bashford Professor Susan Rodger Duke University July
Toward More Realistic Pathfinding Authored by: Marco Pinter Presentation Date: 11/17/03 Presented by: Ricky Uy.
Scratch pong challenge Pong is a classic 1970s video game  Open the pongv1.sb2 file in Scratch  Click the.
Intelligent Database Systems Lab 國立雲林科技大學 National Yunlin University of Science and Technology 1 Evolving Reactive NPCs for the Real-Time Simulation Game.
Quoridor and Artificial Intelligence
Games Programming with Java ::: AI ::: Games Programming with Java Montri Karnjanadecha Andrew Davison.
A* Path Finding Ref: A-star tutorial.
Dr Nick Mitchell (Room CM 224)
Warship C++: An entity of Battleship
Artificial Intelligence in Game Design Influence Maps and Decision Making.
Finite State Machines using Alice Stephen Cano CIS 4914 Senior Project Wednesday December 5th.
1 CO Games Development 1 Week 8 A* Gareth Bellaby.
CSCE 552 Spring 2010 AI (III) By Jijun Tang. A* Pathfinding Directed search algorithm used for finding an optimal path through the game world Used knowledge.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Finite State Machines Logical and Artificial Intelligence in Games Lecture 3a.
CSCE 552 Fall 2012 AI By Jijun Tang. Homework 3 List of AI techniques in games you have played; Select one game and discuss how AI enhances its game play.
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.
ICS 699 – Sony PlayStation Game Programming Project -Matthew Sharritt.
The Game Development Process: Artificial Intelligence.
Artificial Intelligence Solving problems by searching.
CS 134 Video Game “AI”.
Enemy and Friendly AIs Richard Gesick.
Lesson Objectives Aims Understand the following “standard algorithms”:
Introduction to Artificial Intelligence
Reinforcement Learning
Safe Path Planning for an Autonomous Agent in a Hostile Environment
A* Path Finding Ref: A-star tutorial.
What to do when you don’t know anything know nothing
Interaction with artificial intelligence in games
HW 1: Warmup Missionaries and Cannibals
Games Programming with Java
HW 1: Warmup Missionaries and Cannibals
Presentation transcript:

Computational theory techniques in interactive video games

Video games began with “Tennis for Two” in 1958 In the 1970’s Atari produced the console game Pong Pac Man was released in 1980 Since then the video game industry has grown to a 20+ billion dollar a year industry (Dec 2008, World of Warcraft hits 11.5 million subscriptions)

Today’s games have become increasingly complex, engaging and intelligent Computer controlled Artificial Intelligence has had to evolve in order for this to happen What is “Artificial Intelligence” or “AI” in terms of a video game?

Academic AI vs. Game AI Academic AI is trying to create a real intelligence through artificial means Game AI seeks to be believable and fun Academic AI focuses on solving a problem optimally Game AI is actually written to be sub-optimal (Who wants to play a game that is impossible to win?)

Goals of Game AI then are: Simulate intelligent behavior Provide a believable challenge (that can then be overcome by the player) Be fun! Two areas that deal directly with computational theory Movement – The A* Algorithm Behavior – Finite State Machines No →

The A* algorithm NPC (Non-Player Characters) need to be able to move through their environment in an intelligent way i.e. don’t get stuck on a tree, take the shortest path to their destination Highly limited computational resources

The Search Area Divide the search area into a square grid This method uses a 2-dimensional array Record the status of each square as walkable or un-walkable Path is found by figuring out which squares we should take to get from A to B

Starting the Search Begin at A, add it to an “open list”. This is a list of squares that need to be checked Find all reachable squares adjacent to the start point, ignore un-walkable squares. Add each to open list and save point A as its “parent square” Drop A from open list and add to closed list

Choose adjacent square on the open list and repeat Which square to choose? – Lowest F cost Path Scoring F = G + H G = cost to move from A to a given square following the path to get there ex. 10 for ↕ or ↔, 14 for diagonal H = estimated cost to move from a given square to the final destination

H is an estimate that can be calculated several ways. This example uses the “Manhattan Method” which calculates the total number of squares moved horizontally or vertically to reach the target square and multiplies that number by 10 (G value)

Choose the lowest F score square from the open list Drop chosen square from open list and add to closed Check adjacent squares, add squares to open list if they are not there already. Make selected square the parent of new squares If adjacent square is already on open list, re- compute G value to see if it is lower. If it is, re-compute F

Once the target square is added to the closed list we are ready to determine the path Just have to start at the red target square and work backwards moving from one square to its parent following the arrows

Finite State Machine Provide illusion of intelligence Powerful tool for modeling NPC behavior Quick to code Easy to debug Little computational overhead Intuitive Very flexable

The ghosts in Pac-Man could easily be implemented as a finite state machine Evade state common to all ghosts Chase state unique to each ghost i.e. One takes all lefts, one rights, one goes straight, and the last heads for the player Player eating a power pill is the transition from the Chase state to the Evade state. A simple timer running down is used to trigger the transition back

Code example: enum StateType{state_RunAway, state_Patrol, state_Attack}; void Agent::UpdateState(StateType CurrentState) { switch(CurrentState) { case state_RunAway: EvadeEnemy(); if (Safe()) { ChangeState(state_Patrol); } break; case state_Patrol: FollowPatrolPath(); if (Threatened()) { if (StrongerThanEnemy()) { ChangeState(state_Attack); } else { ChangeState(state_RunAway); } break; case state_Attack: if (WeakerThanEnemy()) { ChangeState(state_RunAway); } else { BashEnemyOverHead(); } break; }//end switch }

FSM’s can easily be created for more complex behavior

Questions

References Buckland, Mat. Programming game AI by example. Wordware, Print. Funge, John. Artificial intelligence for computer games. A K Peters, Ltd., Print. Kehoe, Donald. "Designing Artificial Intelligence for Games (Part 1)." Intel Software Network (2009): n. pag. Web. 29 Apr Lester, Patrick. "A* Pathfinding for Beginners." Policy Almanac. N.p., Jul Web. 29 Apr Nareyek, Alexander. "AI in Computer Games." Queue (2004): Web. 29 Apr