Artificial Intelligence in Game Design Influence Maps and Decision Making.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

The general Game AI concept
Artificial Intelligence in Game Design
Wall Building for RTS Games Patrick Schmid. Age of Empires.
Heuristic Search techniques
Problem solving with graph search
AI Pathfinding Representing the Search Space
Tetris – Genetic Algorithm Presented by, Jeethan & Jun.
Greed is good. (Some of the time)
Pathfinding Basic Methods.
CSE 380 – Computer Game Programming Pathfinding AI
Artificial Intelligence in Game Design Heuristics and Other Ideas in Board Games.
Artificial Intelligence in Game Design
Multiagent Probabilistic Smart Terrain Dr. John R. Sullins Youngstown State University.
Artificial Intelligence in Game Design Intelligent Decision Making and Decision Trees.
Artificial Intelligence in Game Design Introduction to Learning.
Ant Colony Optimization. Brief introduction to ACO Ant colony optimization = ACO. Ants are capable of remarkably efficient discovery of short paths during.
1 AI for Computer Game Developers Finite state machines Path finding and waypoints A-Star path finding.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Games Programming III (TGP2281) – T1, 2010/2011 Tactical & Strategic AI John See 10 Jan 2011.
ASC Program Example Part 3 of Associative Computing Examining the MST code in ASC Primer.
Tactical and Strategic Reasoning  Covers…  Deducing tactical situations from sketchy (limited) information  Using tactical situations to make decisions.
State-Space Searches.
Heuristic Search Heuristic - a “rule of thumb” used to help guide search often, something learned experientially and recalled when needed Heuristic Function.
The Greedy Wall Building algorithm Rami Khouri. Ideal definition of Wall Either keeps valuable assets in, or enemies out…mostly keep enemies out Impassable,
Dijkstra’s Algorithm and Heuristic Graph Search David Johnson.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Artificial Intelligence in Game Design Problems and Goals.
Artificial Intelligence in Game Design
© Peter Andreae CS4HS Algorithms Searching for an item in a list Sorting a list Searching for a word in text Analysing Networks.
Game Playing.
Artificial Intelligence in Game Design Lecture 22: Heuristics and Other Ideas in Board Games.
WAES 3308 Numerical Methods for AI
DATA MINING LECTURE 13 Absorbing Random walks Coverage.
Artificial Intelligence in Game Design
Representing and Using Graphs
© 2015 JW Ryder CSCI 203 Data Structures1. © 2015 JW Ryder CSCI 203 Data Structures2.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
Design of a real time strategy game with a genetic AI By Bharat Ponnaluri.
GRASP: A Sampling Meta-Heuristic
Ch 7.2: Performing Qualitative Terrain Analysis in MoO3.
Artificial Intelligence in Game Design Lecture 6: Fuzzy Logic and Fuzzy State Machines.
Game Playing. Towards Intelligence? Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. Many researchers.
Artificial Intelligence in Game Design
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Online Algorithms By: Sean Keith. An online algorithm is an algorithm that receives its input over time, where knowledge of the entire input is not available.
Exploration Strategies for Learned Probabilities in Smart Terrain Dr. John R. Sullins Youngstown State University.
Artificial Intelligence in Game Design Cooperative Movement.
Artificial Intelligence in Game Design N-Grams and Decision Tree Learning.
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.
Artificial Intelligence in Game Design Complex Steering Behaviors and Combining Behaviors.
Random Map Generation and Transport Unit AI for Strategy Games By Russell Kuchar.
Topics in Algorithms 2007 Ramesh Hariharan. Tree Embeddings.
REFERENCE: “ARTIFICIAL INTELLIGENCE FOR GAMES”, IAN MILLINGTON. A* (A-STAR)
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
Probabilistic Smart Terrain Dr. John R. Sullins Youngstown State University.
Design of a real time strategy game with a genetic AI By Bharat Ponnaluri.
Artificial Intelligence in Game Design Lecture 20: Hill Climbing and N-Grams.
Qualitative Spatial Analysis Part 2 Chris Mansley.
Finite State Machines Logical and Artificial Intelligence in Games Lecture 3a.
Artificial Intelligence in Game Design Board Games and the MinMax Algorithm.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
A* Reference: “Artificial Intelligence for Games”, Ian Millington.
Chapter 5.4 Artificial Intelligence: Pathfinding
Movement in a full and dynamic environment using a limited influence map Paulo Lafeta Ferreira Artificial Intelligence for Games – CS 580 Professor: Steve.
Enemy and Friendly AIs Richard Gesick.
Study Guide for ES205 Yu-Chi Ho Jonathan T. Lee Nov. 7, 2000
Presentation transcript:

Artificial Intelligence in Game Design Influence Maps and Decision Making

Decision Making How can influences determine path character follows? How can influences determine high level decisions made by character? How can goals of player affect influences?

Simple Tile-Based Movement Use influence map directly to determine next tile –Treasure has positive influence –Snakes have negative influence Move to adjacent tile with highest measure

Simple Tile-Based Movement Vulnerable to local maxima if influences interact in complex ways –Locations on map where each possible move is worse than current position –Will become “stuck” and cycle forever in area Requires careful design or heuristics to avoid –Don’t return to previous location, etc

Influence: 1 Edge Costs Use influence map to estimate edge costs in graph –Based on influences instead of computed from graph Other units Terrain costs –Positive number  low cost to move through –Negative number  high cost to move through Average influences of start, end point to get path costs –Assumption: “half” of path is through each area Influence: 5 Average influence = 3

Influence: 1 Edge Costs Must normalize to get actual edge costs –Reverse sign High influence = low edge cost Low influence = high edge cost –Must avoid negative edge costs! Dijkstra, A* will not work if edge costs negative –Can factor in other costs Multiply by distance, etc. Simple example: edgeCost(i, j) = maximumInfluence – averageInfluence(i, j) Influence: 5 maximumInfluence = 7 edgeCost = 4

Edge Cost Example maximumInfluence = 7

Edge Cost Example “Shortest” path from A to B: A B A B

Edge Costs Only works for adjacent areas –Edges between non-adjacent areas might go through other areas with very different influences Safe waypoint Path between them not safe

Edge Costs Terrain analysis –Determine total terrain influence at each tile –Determine which tiles an edge passes through –If influence level at a tile significantly different than at vertices, add a new waypoint Medium influence Low measure due to influence of other tile Path between them not safe Should have a waypoint here! Medium influence New waypoint

Group Movement Edge cost of group of characters based on individual costs Hand to Hand Weaponry Hand to Hand Weaponry Long Distance Weaponry Hand to Hand Weaponry Long Distance Weaponry Heavy Weaponry What is cost of this edge for unit as a whole?

Group Movement Possible solutions Edge cost of group = maximum(individual costs) –Must do this if cost based on speed over some terrain Edge cost of group = average(individual costs) –May do if willing to lose team members to reach goal quickly Edge cost of group = cost of most critical unit –Group fails if this unit is lost –Particularly important if that unit has high cost = = = 5

Decision Making Higher-level character actions may be based on terrain influences See player? yesno Wander Cover nearby? yes no Attack Run towards cover Is there a tile within distance d that has significant influence over player position? Move to tile in range d with highest influence

Example: Master of Orion AI selects planets to colonize based on: –Economic value of planets –Proximity to current borders –Proximity to borders of other players Star in current territory  all edges from star connected to colony/another star in territory

Master of Orion Decision Tree Already have colony at this star? yesno Another has colony at this star? yesno Multiplier *= 1.5Multiplier *= 0.8 Another has colony at this star? yes no Multiplier *= 0.3 Star inside our borders? yesno Multiplier *= 0.9 no Star inside borders of another? yesno Multiplier *= 0.3 CONTINUE Goal: Giver each star a multiplier proportional to influences of our and other player territories

Master of Orion Terrain Analysis Give other stars multiplier based on how adding it would change territory –Multiplier = 1 –For each new unclaimed star now inside border add 0.25 –For each colony now inside border add 1 –If homeworld now inside border add 1 Colonizing Lupi would put Volans colony inside border  multiplier = 2

Master of Orion Decision Making Probabilistic decision on planet to colonize –For each star, generate multiplier and square –Multiply by economic value of planet to get weight –Eliminate any with < 50% of best candidate (avoid stupid moves) –Choose randomly with probabilities proportional to weight Example: A: 0.5 B: 1.5 C: 1.0 D: 2.0 E: % 48% 26%

Fuzzy Decision Making Terrain influences often not binary Different objects may have degree of membership in type of terrain Example: “Move to nearby high ground” –What if have several choices? Mountain 1 Height = 400 Distance = 80 Mountain 2 Height = 200 Distance = 50 Mountain 3 Height = 500 Distance = 100

Fuzzy Decision Making “Nearby” and “high” can be fuzzy measures distance Nearby High

Fuzzy Decision Making “Nearby and high” = min(µ nearby (mountain), µ high (mountain)) Choose mountain with highest value –Mountain 1 = min(0.4, 0.9) = 0.4 –Mountain 2 = min(0.9, 0.3) = 0.3 –Mountain 3 = min(0.2, 1.0) = 0.2 Many rules include “nearby” component –Cover nearby?  depends on how near and degree of cover –Attack nearby cities which are no well defended  depends on how near and degree of positive/negative influence Best choice

Goal-based Terrain Understand goals of player –Areas that player would consider valuable Give higher values to areas with influence over those areas –NPC will try to secure areas of value to the player –Looks like “anticipating” player actions –Prevents players from accomplishing goals –Looks like “trap” if NPC units can be hidden Can use to manipulate the terrain –NPC could try to plant goal items (such as treasure) in areas NPC has control over! –Level design could automatically place goal items in areas that other areas have influence over

Goal-based Terrain Example: Treasure (with value 4 to player) next to forest Forest has influence over open areas next to it Areas with influence over the treasure increased by value of treasure Best places to be!

Goal-based Terrain Areas with influence over good terrain Areas with influence over other high influence areas Path with low terrain cost = high value to player Forest area with influence over neighbors Highest influence areas B Height = 50 C Height = 20 D Height = 30 Area of value to player Influence over that area more valuable

Exploration Goals Exploring new areas should be a goal of NPC –More accurate maps, more accurate influences –Usually have scouting units for that purpose Areas at edge of map should have strong positive influence Might be combined with other factors: –Proximity (explore areas already near to) –Safety (explore areas not under player control) –Terrain (explore areas can move quickly through) –Visibility (go to areas where can see much from) Mountains, etc. Visibility area on ground Visibility area on mountain

Exploration Goals Unknown territory Scout’s visibility = 2 tiles away Views maximum unknown territory