370 likes | 449 Views
Probabilistic Smart Terrain. Dr. John R. Sullins Youngstown State University. Outline. What is Smart Terrain? Why do we need to add probabilities? Estimating expected distances to objects that meet character needs Plausibility benchmarks and experimental results
E N D
Probabilistic Smart Terrain Dr. John R. Sullins Youngstown State University
Outline What is Smart Terrain? Why do we need to add probabilities? Estimating expected distances to objects that meet character needs Plausibility benchmarks and experimental results Adding knowledge learned during exploration Hierarchical application to games Probabilistic Smart Terrain ICTAI 2009
Smart Terrain Probabilistic Smart Terrain ICTAI 2009
Smart Terrain Characters have “needs” Example: hunger Objects in world meet needs Example: refrigerator with food inside Characters move to objects that meet needs Probabilistic Smart Terrain ICTAI 2009
Smart Terrain Objects meets needs transmits “signal” Signal weakens with distance Signal moves around objects Probabilistic Smart Terrain ICTAI 2009
Smart Terrain Characters follow signal to objects Move in direction of increasing signal No need for complex navigation Probabilistic Smart Terrain ICTAI 2009
Outline What is Smart Terrain? Why do we need to add probabilities? Estimating expected distances to objects that meet character needs Plausibility benchmarks and experimental results Adding knowledge learned during exploration Hierarchical application to games Probabilistic Smart Terrain ICTAI 2009
Need for Probabilities Smart terrain can result in implausibleactions Room character has never visited Contains empty refrigerator Does not transmit signal Character ignores it Not plausible behavior! Probabilistic Smart Terrain ICTAI 2009
Probabilistic Smart Terrain Objects broadcast signal of form“I meet need n” “I may meet need n with probability P ” Probability = uncertainty that object meets need Character exploreuncertain objects along path Probabilistic Smart Terrain ICTAI 2009
Probabilistic Smart Terrain Character should: Move to closest object with highest probability Problem: Optimizing two separate criteria Realistic Goal: Plausible behavior Meets “hunger” need with P = 0.6 At distance 6 Meets “hunger” need with P = 0.7 At distance 8 Probabilistic Smart Terrain ICTAI 2009
Outline What is Smart Terrain? Why do we need to add probabilities? Estimating expected distances to objects that meet character needs Plausibility benchmarks and experimental results Adding knowledge learned during exploration Hierarchical application to games Probabilistic Smart Terrain ICTAI 2009
Expected Distances Expected number of tiles character must travel From current tile To object that fulfills need Based on: di: distances to each object i pi: probabilities each object i meets need Probabilistic Smart Terrain ICTAI 2009
Expected Distances P(t): probability no objects within t tiles meet need P(t) = (1 – pi ) (Equation 1) where di< t Based on assumption of conditional independence Probabilistic Smart Terrain ICTAI 2009
Expected Distances t < 6: P(t) = 1 6 ≤ t < 8: P(t) = (1 – 0.6) = 0.4 t≥ 8: P(t) = (1 – 0.6)(1 – 0.7) = 0.12 Distance: 6Prob: 0.6 Distance: 8Prob: 0.7 Probabilistic Smart Terrain ICTAI 2009
Expected Distances Expected distance from tile T to tile that meets needE(T) = ΣP(t)(Equation 2)t t < 6: P(t) = 1 6 ≤ t < 8: P(t) = 0.4 t ≥ 8: P(t) =0.12 Probabilistic Smart Terrain ICTAI 2009
Expected Distances Problem: Sum could be infinite Solution: Limit t to some tmaxtmax > dii tmax E(T) = ΣP(t) (Equation 3)t Probabilistic Smart Terrain ICTAI 2009
Compute expected distance E(T) for all tiles T Character moves to adjacent tile with lowestE(T) Expected Distances Probabilistic Smart Terrain ICTAI 2009
Outline What is Smart Terrain? Why do we need to add probabilities? Estimating expected distances to objects that meet character needs Plausibility benchmarks and experimental results Adding knowledge learned during exploration Hierarchical application to games Probabilistic Smart Terrain ICTAI 2009
Plausibility Benchmarks Goal for games:Non-player characters should behave plausibly Move in direction that “makes sense” to player Benchmarks for plausible behavior: Objects similar in either distance or probability Group of objects in same direction Objects that meet need with complete certainty Probabilistic Smart Terrain ICTAI 2009
Plausibility Benchmarks Objects at same distance move to higher probability Objects with same probability move to closer one Probabilistic Smart Terrain ICTAI 2009
Plausibility Benchmarks Nearly same distance move to much higher probability Nearly same probability move to much closer object Probabilistic Smart Terrain ICTAI 2009
Plausibility Benchmarks Aggregate probabilities benchmark: • Multiple objects > single object with higher probability • Assumption of conditional independence Probabilistic Smart Terrain ICTAI 2009
Plausibility Benchmarks Complete Certainty benchmark: • Single object with probability = 1 > multiple objects with probability < 1 Probabilistic Smart Terrain ICTAI 2009
Outline What is Smart Terrain? Why do we need to add probabilities? Estimating expected distances to objects that meet character needs Plausibility benchmarks and experimental results Adding knowledge learned during exploration Hierarchical application to games Probabilistic Smart Terrain ICTAI 2009
Learned Knowledge Refrigerator empty Move towards another goal • Probabilities changed when object reached • Object meets need probability becomes 1 • Does not meet need probability becomes 0 • Should affect future actions Probabilistic Smart Terrain ICTAI 2009
Learned Knowledge New character enters room Also ignores empty refrigerator • Changing global map affects all characters • Will also appear to have learned this knowledge Probabilistic Smart Terrain ICTAI 2009
Learned Knowledge 0% • Each character stores own world model • Belief object meets needs • Initially based on probabilities • Modified when objects explored Probabilistic Smart Terrain ICTAI 2009
Learned Knowledge • Each object propagates raw data to tiles • Probability it meets need • Distance to that tile Probabilistic Smart Terrain ICTAI 2009
Learned Knowledge • Character examines surrounding tiles • Modify probabilities using world model • Compute expected distances for each Probabilistic Smart Terrain ICTAI 2009
Outline What is Smart Terrain? Why do we need to add probabilities? Estimating expected distances to objects that meet character needs Plausibility benchmarks and experimental results Adding knowledge learned during exploration Hierarchical application to games Probabilistic Smart Terrain ICTAI 2009
Hierarchical Smart Terrain • Go to entrance of most likely area • If object not present, move to another area • If object present, move to it • More realistic scenario: • Know whether objects meet needs • Don’t know if object is present in given area Probabilistic Smart Terrain ICTAI 2009
Hierarchical Smart Terrain • “Area attractors” at entrances to rooms • Broadcast to entire level • Probability object that meets need is in room • Probability set to 0 when reached by character • Objects in room • Signal range = size of room • Probability = 1 if present in room Probabilistic Smart Terrain ICTAI 2009
Hierarchical Smart Terrain Compute expected distances from area attractors Move to “best” room Probabilistic Smart Terrain ICTAI 2009
Hierarchical Smart Terrain • Object is present in area: • Now in range of object, probability meets need = 1 • Character will move directly to object Probabilistic Smart Terrain ICTAI 2009
Hierarchical Smart Terrain • Object is not present in area: • Set probability of area attractor = 0 • Character will move to next plausible attractor Probabilistic Smart Terrain ICTAI 2009
Conclusions Probabilities added to Smart Terrain algorithm Characters move to adjacent tile with shortest expected distance to a tile that meets need Algorithm produces plausible behavior for benchmarks Probabilities overridden by learned knowledge Hierarchical algorithm for realistic play Probabilistic Smart Terrain ICTAI 2009
Ongoing Work Characters with multiple needs at different levels Low-probability object that meets critical need High-probability object that meets less critical need Which to move towards? Objects that change over time Empty refrigerator now may be restocked in future Searching for other characters who move from place to place Probabilistic Smart Terrain ICTAI 2009