Influence map

10,634 views

Published on

a good introduction to influence map

a good introduction to influence map

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
10,634
On SlideShare
0
From Embeds
0
Number of Embeds
74
Actions
Shares
0
Downloads
194
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Influence map

    1. 1. Maurice Bergsma and Peter Meij Student Lecture GAI, May 3, 2006 Influence Maps
    2. 2. Contents <ul><li>Influence Maps </li></ul><ul><li>Reasoning with Influence Maps </li></ul><ul><li>Sample Applications </li></ul><ul><ul><li>Recognizing Strategic Dispositions </li></ul></ul><ul><ul><li>Environmental Awareness in Game Agents </li></ul></ul><ul><li>Issues with Influence Maps </li></ul><ul><li>Conclusions </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    3. 3. Influence Maps <ul><li>Method for (runtime) spatial analysis </li></ul><ul><li>Matrix representing the game world </li></ul><ul><li>Each cell stores data for one aspect of that part of the world. </li></ul><ul><li>Values propagate to nearby cells </li></ul><ul><li>This shows the influence of certain objects on each part of the world </li></ul><ul><li>Useful for many types of games </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    4. 4. Influence Maps (2) <ul><li>Different types of propagation are possible </li></ul><ul><ul><li>Linear </li></ul></ul><ul><ul><li>Exponential </li></ul></ul><ul><ul><li>Gaussian </li></ul></ul><ul><ul><li>Etc. </li></ul></ul><ul><li>Game-specific, must be tuned </li></ul><ul><li>Influences of similar objects can be added together </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    5. 5. Influence Maps (3) <ul><li>Occupancy </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions 0,0 0,0 0,2 0,4 0,2 0,0 0,0 0,2 0,4 0,6 0,4 0,2 0,2 0,4 0,6 0,8 0,6 0,4 0,4 0,6 0,8 1,0 0,8 0,6 0,2 0,4 0,6 0,8 0,6 0,4 0,0 0,2 0,4 0,6 0,4 0,2
    6. 6. Influence Maps (3) <ul><li>Occupancy </li></ul><ul><li>Passability </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions 0,00 0,25 0,50 0,75 1,00 0,75 0,00 0,25 0,50 0,75 1,00 0,75 0,00 0,25 0,50 0,75 1,00 0,75 0,25 0,50 0,75 0,75 1,00 0,75 0,50 0,75 1,00 1,00 1,00 0,75 0,50 0,75 1,00 0,75 0,75 0,50
    7. 7. Influence Maps (4) <ul><li>Other possible types of influence maps: </li></ul><ul><li>Vulnerable assets </li></ul><ul><li>Resources </li></ul><ul><li>Exploration </li></ul><ul><li>Line of fire </li></ul><ul><li>Light level </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions 0,0 0,0 0,2 0,4 0,2 0,0 0,0 0,2 0,4 0,6 0,4 0,2 0,2 0,4 0,6 0,8 0,6 0,4 0,4 0,6 0,8 1,0 0,8 0,6 0,2 0,4 0,6 0,8 0,6 0,4 0,0 0,2 0,4 0,6 0,4 0,2
    8. 8. Reasoning with Influence Maps <ul><li>Multiple influence maps are stored in a spatial database </li></ul><ul><li>These maps can be combined to create a desirability layer for a certain task </li></ul><ul><li>A desirability layer contains the desirability to move to each cell </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    9. 9. Reasoning with Influence Maps (2) <ul><li>Methods of computing desirability: </li></ul><ul><ul><li>Weighted Sum </li></ul></ul><ul><ul><ul><li>Simple and efficient </li></ul></ul></ul><ul><ul><ul><li>Must be hand-tuned </li></ul></ul></ul><ul><ul><ul><li>Opposing influences cancel each other out </li></ul></ul></ul><ul><ul><li>Product of normalized values </li></ul></ul><ul><ul><li>Neural Networks </li></ul></ul><ul><ul><ul><li>Separate weights for each task </li></ul></ul></ul><ul><ul><ul><li>Number of inputs is large for non-trivial tasks </li></ul></ul></ul><ul><ul><ul><ul><li>(#layers x #cells) </li></ul></ul></ul></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    10. 10. Applications <ul><li>2 Example applications: </li></ul><ul><ul><li>Recognizing Strategic Dispositions </li></ul></ul><ul><ul><li>Environmental Awareness in Game Agents </li></ul></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    11. 11. Recognizing Strategic Dispositions (image shamelessly copied from Nyree & Viktor) Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    12. 12. Recognizing Strategic Dispositions Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -1 0 0 0 0 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -1 0 0 0 0 -8 -8 -8 -8 -6 -4 -4 -4 -2 -2 -2 -1 0 0 0 0 -8 -8 -8 -6 -6 -6 -5 -2 -1 -1 0 0 0 0 0 -8 -8 -8 -8 -8 -8 -8 -8 -4 -2 0 0 1 1 1 1 -2 -4 -8 -8 -10 -10 -8 -3 0 1 1 2 2 2 2 -2 -4 -8 -8 -10 -10 -8 -4 0 1 2 2 3 3 3 -2 -4 -8 -10 -10 -8 -4 -2 0 2 2 2 3 3 -2 -4 -6 -8 -8 -5 -5 -4 0 2 2 4 3 3 3 3 -1 -2 -4 -4 -3 -3 -5 -4 2 2 4 6 6 4 2 1 -2 -4 -4 -4 -2 -1 0 4 4 6 6 8 6 4 2 -2 -4 -4 -2 0 1 4 6 6 8 8 8 6 4 -2 -4 -4 -4 -2 0 1 3 6 8 8 8 6 4 -2 -4 -4 -2 0 1 2 4 8 8 8 8 6 4 -2 -4 -4 -4 -2 -1 0 2 4 6 8 8 8 8 6 4
    13. 13. Recognizing Strategic Dispositions Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 -2 -2 -2 -2 -2 -2 -2 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4 -4 -3 -3 -5 -4 2 2 4 6 6 4 2 1 -2 -4 -4 -4 -2 -1 0 4 4 6 6 8 6 4 2 -2 -4 -4 -2 0 1 4 6 6 8 8 8 6 4 -2 -4 -4 -4 -2 0 1 3 6 8 8 8 6 4 -2 -4 -4 -2 0 1 2 4 8 8 8 8 6 4 -2 -4 -4 -4 -2 -1 0 2 4 6 8 8 8 8 6 4
    15. 15. Recognizing Strategic Dispositions Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -1 0 0 0 0 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -1 0 0 0 0 -8 -8 -8 -8 -6 -4 -4 -4 -2 -2 -2 -1 0 0 0 0 -8 -8 -8 -6 -6 -6 -5 -2 -1 -1 0 0 0 0 0 -8 -8 -8 -8 -8 -8 -8 -8 -4 -2 0 0 1 1 1 1 -2 -4 -8 -8 -10 -10 -8 -3 0 1 1 2 2 2 2 -2 -4 -8 -8 -10 -10 -8 -4 0 1 2 2 3 3 3 -2 -4 -8 -10 -10 -8 -4 -2 0 2 2 2 3 3 -2 -4 -6 -8 -8 -5 -5 -4 0 2 2 4 3 3 3 3 -1 -2 -4 -4 -3 -3 -5 -4 2 2 4 6 6 4 2 1 -2 -4 -4 -4 -2 -1 0 4 4 6 6 8 6 4 2 -2 -4 -4 -2 0 1 4 6 6 8 8 8 6 4 -2 -4 -4 -4 -2 0 1 3 6 8 8 8 6 4 -2 -4 -4 -2 0 1 2 4 8 8 8 8 6 4 -2 -4 -4 -4 -2 -1 0 2 4 6 8 8 8 8 6 4
    16. 16. Recognizing Strategic Dispositions Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -1 0 0 0 0 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6 6 4 2 1 -2 -4 -4 -4 -2 -1 0 4 4 6 6 8 6 4 2 -2 -4 -4 -2 0 1 4 6 6 8 8 8 6 4 -2 -4 -4 -4 -2 0 1 3 6 8 8 8 6 4 -2 -4 -4 -2 0 1 2 4 8 8 8 8 6 4 -2 -4 -4 -4 -2 -1 0 2 4 6 8 8 8 8 6 4
    18. 18. Recognizing Strategic Dispositions Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -1 0 0 0 0 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -1 0 0 0 0 -8 -8 -8 -8 -6 -4 -4 -4 -2 -2 -2 -1 0 0 0 0 -8 -8 -8 -6 -6 -6 -5 -2 -1 -1 0 0 0 0 0 -8 -8 -8 -8 -8 -8 -8 -8 -4 -2 0 0 1 1 1 1 -2 -4 -8 -8 -10 -10 -8 -3 0 1 1 2 2 2 2 -2 -4 -8 -8 -10 -10 -8 -4 0 1 2 2 3 3 3 -2 -4 -8 -10 -10 -8 -4 -2 0 2 2 2 3 3 -2 -4 -6 -8 -8 -5 -5 -4 0 2 2 4 3 3 3 3 -1 -2 -4 -4 -3 -3 -5 -4 2 2 4 6 6 4 2 1 -2 -4 -4 -4 -2 -1 0 4 4 6 6 8 6 4 2 -2 -4 -4 -2 0 1 4 6 6 8 8 8 6 4 -2 -4 -4 -4 -2 0 1 3 6 8 8 8 6 4 -2 -4 -4 -2 0 1 2 4 8 8 8 8 6 4 -2 -4 -4 -4 -2 -1 0 2 4 6 8 8 8 8 6 4
    19. 19. Environmental Awareness in Game Agents <ul><li>Agents in games need situational awareness to give them a sense of: </li></ul><ul><ul><li>What is happening in the environment </li></ul></ul><ul><ul><li>What could happen next </li></ul></ul><ul><ul><li>What options there are for action </li></ul></ul><ul><ul><li>Possible outcomes of those actions </li></ul></ul><ul><li>Environment in the form of a grid </li></ul><ul><li>Cells track important (threatening) events and conditions, such as rain, fire, other agents </li></ul><ul><li>This can be done using cellular automata </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    20. 20. Environmental Awareness in Game Agents <ul><li>Cellular automata can be used in games to model simplified environmental processes, e.g. air, fluid flow </li></ul><ul><li>Set of rules represent allowable physics of the model, and are used to update cell values </li></ul><ul><li>New state of a cell is a function of previous state and state of neighboring cells </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    21. 21. Environmental Awareness in Game Agents <ul><li>Example automata </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    22. 22. Environmental Awareness in Game Agents <ul><li>Cellular automata in games: </li></ul><ul><ul><li>Cells can include data for all kinds of game variables and are represented by continuous rather than finite values </li></ul></ul><ul><ul><li>The rules and variables the cellular automaton requires depends on what is being modeled in the game environment </li></ul></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    23. 23. Environmental Awareness in Game Agents <ul><li>Reacting sensibly to the environment requires: </li></ul><ul><ul><li>Way to sense the environment </li></ul></ul><ul><ul><li>Way to choose suitable reaction based on sensed data </li></ul></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    24. 24. Environmental Awareness in Game Agents <ul><li>Role of influence maps: </li></ul><ul><ul><li>Influence maps divide game map into a grid of cells, with multiple layers of cells containing information about the game world </li></ul></ul><ul><ul><li>To include environmental decision-making one of these layers should consist of the data from the cellular automaton </li></ul></ul><ul><ul><li>Also possible to use influence maps for tactical, low-level decision-making </li></ul></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    25. 25. Environmental Awareness in Game Agents <ul><li>The reactive agents using the combination of influence maps and cellular automata can do this in three steps: </li></ul><ul><ul><li>Compute “danger” function to determine each cell’s utility </li></ul></ul><ul><ul><li>Use its return value to asses the level of reaction </li></ul></ul><ul><ul><li>Let the agent choose the destination cell based on this </li></ul></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    26. 26. Environmental Awareness in Game Agents <ul><li>Danger function </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    27. 27. Environmental Awareness in Game Agents <ul><li>Level of reaction </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    28. 28. Environmental Awareness in Game Agents <ul><li>Choosing a destination </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    29. 29. Environmental Awareness in Game Agents <ul><li>Agents are likely to have greater goals or desires they need </li></ul><ul><li>This can be done through desirability values, provided through a desirability layer </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    30. 30. Environmental Awareness in Game Agents <ul><li>Propagation of desirability of a goal in an influence map: </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    31. 31. Environmental Awareness in Game Agents <ul><li>Choosing a destination, also including desirability of the goal: </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    32. 32. Environmental Awareness in Game Agents <ul><li>Algorithm for the agents </li></ul><ul><li>Propagate desirability of the goal </li></ul><ul><li>Each cycle, calculate the danger value for each cell in its local neighborhood </li></ul><ul><li>Find the optimal cell in the local neighborhood of the agent </li></ul><ul><li>Find the optimal cell in the immediate neighborhood </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    33. 33. Environmental Awareness in Game Agents <ul><li>Step 1: desirability propagation </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    34. 34. Environmental Awareness in Game Agents <ul><li>Step 2: Calculate danger value </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    35. 35. Environmental Awareness in Game Agents <ul><li>Step 3: Find optimal cell in local neighborhood </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    36. 36. Environmental Awareness in Game Agents <ul><li>Step 4: Find optimal cell in immediate neighborhood </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    37. 37. Issues with Influence Maps <ul><li>Time/space complexity </li></ul><ul><ul><li>Resolution of the grid </li></ul></ul><ul><ul><li>Update frequency </li></ul></ul><ul><li>Tuning </li></ul><ul><ul><li>Parameter values </li></ul></ul><ul><ul><li>Agent Design </li></ul></ul><ul><li>Overlapping influences </li></ul><ul><li>3D environments </li></ul><ul><li>Suboptimal solutions </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    38. 38. Conclusions <ul><li>Influence maps provide an intuitive approach to (runtime) spatial analysis </li></ul><ul><li>Influence maps are fairly easy and straightforward to implement </li></ul><ul><li>Influence maps need quite a lot of tuning to deliver optimal solutions </li></ul><ul><li>Influence maps are therefore not always guaranteed to be useful </li></ul><ul><li>Influence maps can be applied effectively for strategic decision-making and reactive path finding </li></ul>Introduction / Influence Maps / Reasoning / App 1 / App 2 / Issues / Conclusions
    39. 39. References <ul><li>Sweetser, Penny. (2004) “Strategic Decision-Making with Neural Networks and Influence Maps”. AI Programming Wisdom 2 , Charles River Media </li></ul><ul><li>Sweetser, Penny. (2006) “Environmental Awareness in Game Agents”. AI Programming Wisdom 3 , Charles River Media </li></ul><ul><li>Tozour, Paul. (2001) “Influence Mapping”. Game Programming Gems 2 , Charles River Media </li></ul><ul><li>Tozour, Paul. (2004) “Using a Spatial Database for Runtime Spatial Analysis”. AI Programming Wisdom 2 , Charles River Media </li></ul><ul><li>Woodcock, Steven. (2002) “Recognizing Strategic Dispositions: Engaging the Enemy”. AI Programming Wisdom , Charles River Media </li></ul>
    40. 40. Questions?

    ×