Positioning and Spatial Evaluation Influence Maps Positioning and Spatial Evaluation Damián Isla, Director of Tech. Moonshot Games
Where do I stand right now? Spatial Evaluation Spreading influence is just one form of spatial function. Spatial decisions can be made on second-to-second timescales Use spatial functions to answer fundamental question: Where do I stand right now?
Spatial Evaluation Algorithm: Score each [accessible] position with F(x) Pick the best one Go there
Spatial Evaluation F(x) 42 Breakfast Threat Line of sight Distance Range F(x) 42 The Apples-to-Oranges problem.
Apples and Oranges Crops up in a host of AI problems. Best strategies Perception Attention / target selection Behavior-selection etc. Best strategies visualization iteration How do you take 2 completely different factors and weight them relative to each other?
Spatial Function Inputs A(x) = range from x to target B(x) = path distance from AI to x C(x) = line of sight (1.0 = 100% clear) ...
Spatial Function Layer Simplest form F(x) = k1A(x) + k2B(x) + k3C(x) + ... With user functions: F(x) = f1(A) + f2(B) + f3(C) + ... Our own idiosyncratic form: F(x) = (((f1(A) + f2(B)) + f3(C)) * f4(D)) + f5(E) ... Layer
Implementation Engine-specified (code) Designer-specified (data) Layers Input source range los path-distance etc. Combination method Additive Multiplicative User-Function output = F(input) Global modifications Blur factor Normalization Engine-specified (code) Designer-specified (data)
Demo
Spreading Influence “Gather phase” Distance maps create list of evaluatable locations assumes we’re interested in moving to that spot Uses A* Distance maps Each pixel contains distance to an occupied cell Pre-computed
Line of Sight By far the greatest perf cost. Solution: Batch batch batch. pre-search for los-blocking objects build optimized structure at runtime evaluate on the GPU In this case: rasterization O(n) (n is # of pixels)
Interference Destructive interference is a [the] big problem Pre-combine inputs Range
Grid Resolution Grid resolution < body radius Solutions: Good: high res decision-making Bad: rounding corners Bad: rubbing against walls Solutions: Distance map can influence steering A* in “configuration space” Distance-map layers in position selection Penalty function in A* In some sense, the penalty function helps us create a body-radius-agnostic “configuration space”
All Behavior is Spatial Spatial functions can be used for more than just position evaluation A* penalty path speed aim on/off target bias weapon choice ... Remember: Input sources are expensive, but recombining them is cheap (share inputs across layers, functions and AIs)
Spatial Behavior Target bias A* Penalty Weapon choice Position selection
Spatial Behavior Aiming Shooting Positioning Speed Targeting
Conclusions Apples-to-oranges is defeated through great visualization and iteration tools Respect the code/data boundary Distance maps are sweet Batch yer rays Pre-combine yer inputs Spatial functions for many aspects of behavior
Thanks!