Artificial Intelligence in Game Design

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Artificial Intelligence: Knowledge Representation
Polygon Scan Conversion – 11b
Chapter 4: Informed Heuristic Search
Wall Building for RTS Games Patrick Schmid. Age of Empires.
Heuristic Search techniques
Great Theoretical Ideas in Computer Science
AI Pathfinding Representing the Search Space
CS1022 Computer Programming & Principles
1 Motion and Manipulation Configuration Space. Outline Motion Planning Configuration Space and Free Space Free Space Structure and Complexity.
Pathfinding AI John See 29 Nov, 13 Dec 2010.
Pathfinding Basic Methods.
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.
Data Structure and Algorithms (BCS 1223) GRAPH. Introduction of Graph A graph G consists of two things: 1.A set V of elements called nodes(or points or.
Artificial Intelligence in Game Design Introduction to Learning.
Chapter 9 Graph algorithms. Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Abstract Terrain Representation in Full Spectrum Command Ramesh Saran USC-ICT.
Soldier of Fortune 2: Double Helix Paris York CIS 588.
1 University of Denver Department of Mathematics Department of Computer Science.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Tactical AI in Real Time Supervisor: Aleks Jakulin Crew: Damir Arh, Matija Jekovec, Mitja Luštrek Gregor Leban, Martin Žnidaršič, Uroš Čibej Translation:
The Greedy Wall Building algorithm Rami Khouri. Ideal definition of Wall Either keeps valuable assets in, or enemies out…mostly keep enemies out Impassable,
Artificial Intelligence in Game Design Event and Sense Management.
Visibility Graphs and Cell Decomposition By David Johnson.
Multimodal Analysis Using Network Analyst. Outline Summarizing accessibility Summarizing accessibility Adding transportation modes to a network Adding.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Pathfinding: Search Space Representations Chapter 2.1 Dan Bader.
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.
Teaching Deliberative Navigation Using the LEGO RCX and Standard LEGO Components Gary R. Mayer, Dr. Jerry Weinberg, Dr. Xudong Yu
© Peter Andreae CS4HS Algorithms Searching for an item in a list Sorting a list Searching for a word in text Analysing Networks.
Computer Science – Game DesignUC Santa Cruz CMPS 20: Game Design Experience 2D Movement Pathfinding.
1 CO Games Development 1 Week 6 Introduction To Pathfinding + Crash and Turn + Breadth-first Search Gareth Bellaby.
WAES 3308 Numerical Methods for AI
1 The Use of Artificial Intelligence in the Computer Game Industry.
Path Planning Part I: Search Space Representation Part II: Table Lookup Path Finder Path III: Convincing Hunting Ref: AIWisdom 2.
August 31, 2005 Game Developer Conference Europe Killzone’s AI: Dynamic Procedural Tactics Guerrilla Games - 1 Killzone’s AI: Dynamic Procedural Tactics.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Artificial Intelligence in Game Design
Artificial Intelligence in Game Design Cooperative Movement.
Artificial Intelligence in Game Design Dynamic Path Planning Algorithms.
Artificial Intelligence in Game Design Content Generation.
Probabilistic Smart Terrain Dr. John R. Sullins Youngstown State University.
Jumping, Climbing, and Tactical Reasoning Section 2.5 Tom Schaible CSE 497 – AI & Game Programming.
Game Maker Terminology
Fundamental Data Structures and Algorithms (Spring ’05) Recitation Notes: Graphs Slides prepared by Uri Dekel, Based on recitation.
Artificial Intelligence in Game Design Complex Steering Behaviors and Combining Behaviors.
WORLD NAVIGATION Don’t Fall Asleep Through These Topics  Tile Graphs  Points of Visibility  NavMesh  Path Smoothing  Hierarchical Pathfinding.
Random Map Generation and Transport Unit AI for Strategy Games By Russell Kuchar.
Multimodal Analysis Using Network Analyst. Outline Summarizing accessibility Summarizing accessibility Adding transportation modes to a network Adding.
REFERENCE: “ARTIFICIAL INTELLIGENCE FOR GAMES”, IAN MILLINGTON. A* (A-STAR)
11/8/2001CS 638, Fall 2001 Today Admin Path Planning –Intro –Waypoints –A* Path Planning.
Artificial Intelligence in Game Design Influence Maps and Decision Making.
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
Motion Planning Howie CHoset. Assign HW Algorithms –Start-Goal Methods –Map-Based Approaches –Cellular Decompositions.
A* Reference: “Artificial Intelligence for Games”, Ian Millington.
Source: CSE 214 – Computer Science II Graphs.
A* Reference: “Artificial Intelligence for Games”, Ian Millington.
How do I get there? Roadmap Methods Visibility Graph Voronoid Diagram.
Chapter 5.4 Artificial Intelligence: Pathfinding
Game Engine Architecture
The Heroes 3 Random Map Generator
CSE 381 – Advanced Game Programming Terrain
Graphs Chapter 11 Objectives Upon completion you will be able to:
Chapter 22: Elementary Graph Algorithms I
UMBC Graphics for Games
Reference: “Artificial Intelligence for Games”, Ian Millington.
CS679 - Fall Copyright Univ. of Wisconsin
Fundaments of Game Design
Some Graph Algorithms.
Presentation transcript:

Artificial Intelligence in Game Design Map Representation and Path Finding

Path Creation Strategy Path Planning Movement “Where to move to” “How to get there” “Get there” Current location Idea: Specify goal location and let AI find path from current position to goal

Waypoints Path = graph structure Vertices = waypoints on path Edges between waypoints directly reachable from one another Current location

Waypoints and Costs Goals: Provide waypoints that let characters reach all locations on level Can SEEK any location from some waypoint Minimize number of waypoints Cost of path planning = O(number of waypoints)2 Key idea: Waypoint creation done offline (during game design) Path planning done many times during gameplay

Defining Waypoints Defining waypoints manually Usually at points where direction change necessary Corners Intersections Doors Character must be able to directly seek waypoint from any adjacent waypoint Character must be able to directly seek all points in map from some waypoint

Defining Waypoints Manually

Defining Waypoints Convenient to generate waypoints automatically Simplest case: simple 2D grid (square or hex) Some points impassible (water, mountains, etc.)

Defining Waypoints Automatically Can often use floor tiles Used by level designer to create level Used to define visibility, lighting areas, where sounds can be heard, etc. Usually triangular or rectangular

Defining Waypoints Automatically One waypoint per tile Usually in center Link waypoints in adjacent tiles May still need to tweak manually Make sure all points directly reachable from a waypoint Add strategic waypoints (cover, shadow, etc.) Make special waypoints for door entry, exit, etc.

Triangular Mesh Generation Automatically generating triangular tiles that cover level Connect some two adjacent walls to form a triangle Continue connecting adjacent walls and/or adjacent borders Continue until all walls are part of some triangle

Waypoint Cleanup Can automatically remove some “redundant” waypoints Not an endpoint (degree > 1) All adjacent points can directly reach each other without using that waypoint Often based on visibility (ray tracing)

Path Creation Path = list of adjacent waypoints Move along path using FollowPath steering Seek “close enough” to next path waypoint 73 73 27 21 45 Desired path 27 45 21

Path Creation Initial waypoint = May need to test each Waypoint in same tile as character Closest waypoint to character May need to test each Avoid going backward initially Less of a problem with small tiles Seek that first waypoint Goal:ATM Should seek this first

Path Creation Reaching goal = Arrive at goal from that last waypoint Character in same tile as goal Character at waypoint nearest goal Arrive at goal from that last waypoint

Hierarchical Paths Simple maps at different levels of detail Better than single map with thousands of points Single best solution to minimizing pathfinding costs Connect points on high-level maps to entrances/exits on low level maps

Hierarchical Paths Requires hierarchical representation of location Me At podium Path to room 301 exit Room 301 Path from 301 exit to Meshel Hall exit Meshel Hall Path from Meshel Hall exit to Kilcawley Center entrance Holy Grail Path from Kilcawley Center entrance to Computer Lab entrance Under seat D001 Computer Lab Path from Computer Lab entrance to seat D001 Kilcawley Center

Path Planning Good path May have several possible paths from current location to goal Need to find “best” path Otherwise character does not look intelligent! Goal Bad path

Edge Costs “Best” path defined by edge costs Good path Cost = 22 “Best” path defined by edge costs Time to travel path Distance, etc. Best path = path with smallest total cost 6 4 4 3 5 4 Goal 7 5 4 Bad path Cost = 47 5 4 2 5 3 4 4

Terrain-based Costs Can base cost on terrain type Grass = 1 Desert = 2 Forest = 3 River = 20 Often multiply by edge distance 5 miles of desert = cost of 10 8 miles of grass with ¼ mile river = cost of 8 + 5 = 13

Other Edge Costs Danger Cost of traveling through enemy territory = 5 * normal cost Important part of tactical movement

Other Edge Costs Visibility Dark = factor of 3 Fog = factor of 2 Can also add to danger Long path now best

Character Edge Costs Different characters may have different edge costs Grass = 2 Desert = 2 Forest = 10 River = 30 Grass = 1 Desert = 3 Forest = 2 River = 10 Squad cost = max(individual costs)

Non-Symmetric Edge Costs Often harder to go one direction than another Stairs Jumping from one level to lower level Will have different costs in each direction Two directed edges instead of one directed edge No second edge in “one way” path 1 4 2

Turning Costs Some characters require time to realistically make a direction change Part of edge cost Separate edge from location to same location Align Arrive 3 5 4 Seek

Inflection Points Waypoints often near convex corners Shortest path in wide areas Better than putting waypoint in center of area Path given by floor tiles Faster path

Inflection Points Put waypoint at each convex corner Move out some safeRadius from corner Connect waypoints visible from one another safeRadius safeRadius

Inflection Points Potential problem: “jagged” areas could create too many waypoints Solution: Only add waypoints for obstacles between critical areas (such as doors) Recursively add waypoints until critical areas connected Irrelevant inflection points

Inflection Points Automatic creation of waypoints on arbitrary racing track

Path Smoothing Problem: Grid-based floor tiles with waypoints at center Jagged” paths Too many unnecessary turns Better to create path using non adjacent nodes

Path Smoothing Recursive algorithm: Draw line between start and goal Stop at obstacle Continue