Jumping, Climbing, and Tactical Reasoning Section 2.5 Tom Schaible CSE 497 – AI & Game Programming
Jumping, Climbing, and Tactical Reasoning Christopher Reed Benjamic Geisler Raven Software/Activison Soldier of Fortune II: Double Helix
Standard Navigation System Recap Graph Theory Point – A location Edge – A route to get from location to location Use A* to efficiently navigate through the graph in game This can be extended to Climbing Jumping Throwing Grenades
Finding Cover using Teams Embed appropriate cover information in points Teammate waits, Leader chooses cover and advances Leader waits, Leader chooses cover and advances Repeat
Finding Cover Using Teams
Additional Information Needed at Edges Obstacle Information Visibility Information More on this later
Throwing Grenades Choice of scripting behavior or encoding data into decision system Compute edges to points in grenade throwing radius If it is possible to throw a grenade (encode trajectory) add a grenade throwing edge
Throwing Grenades
Things to keep in mind Is throwing a grenade feasible? Uncommon situation, grenades are scarce Reserved more as a last resort, when obstacles prohibit attacking What position is best to throw a grenade from? It may be impossible to use a grenade effectively What trajectory is necessary? (through windows, around corners) .05 to.1 seconds per trajectory to calculate Store in memory instead (store only attacker and trajectory pair)
How to Bias Edges Data you are adding to points needs to show up in the edges ParentPoint = OpenList.GetFromOpenList() For each edge from ParentPoint Switch edge.type() Case GRENADE_EDGE: If ( point.trajectoryGood() ) edge.cost = actor.GrenadeBiasCost() Case FLY_EDGE: If ( actor.CanFly() ) edge.cost = actor.FlyBiasCost()
Non-Standard Movement Edges Instead of scripting behavior, embed type of behavior in edge Engine will automatically perform movement including animation and set up Can be used for Jumping Flying Opening Doors
How to Embed Information in Points Store point size information for each point Use a sphere to define the size Can Detect obstacles and obstacle features Obstacle Visibility – Vertical Obstacle Visibility – Side to Side
Obstacle Visibility - Point
Object Visibility – Side to Side
Other Embedded Information Safe Size Use collision detection to determine how big of an actor can use the path Jumping Embed invisible geometry in game (preferred) or use extensive collision detection Vaulting Same as jumping but geometry is not invisible Requires specific constraints for animation Movable Objects and Doors Collision detection will find tagged object Retry collision detection after object is moved to test validity of edge (store movement info in the edge) Stairs, Slopes, Ladders, and Ropes Checking angle between points vertically can cause edges to be labeled with certain actions
Putting it all together Flying Edge Door Edge Vault Edge Jump Edge Rappelling Edge
Soldier of Fortune II
Hunting Down the Player in a Convincing Manner Section 2.6
Hunting Down the Player in a Convincing Manner Alex McLean Pivotal Game Ltd. Conflict : Desert Storm
Hunting Down a Player in a Convincing Manner Intelligent hunting is a good thing The game needs to be somewhat challenging Allows for strategy Perfect hunting is a bad thing Takes away from gameplay Really isn’t realistic It should be apparent that the hunter is exploring and cannot see the target when it is not visible
Parameterizing the Process A parameter based process will work best Controls the hunter to do different thigns at different times Two major parameters we want control over Speed – How quickly you are found Directness – How direct is the path from hunter to target
Destination Path finding will be used to direct the hunter A destination is needed Simplest solution is to move directly to the destination where the hunter is This makes the AI too good Destination must be more variable and robust
States Break the decision of destination up into different states The player is visible The player was recently seen The player has never been seen Allows for more realistic destinations Results in more realistic behaviors
The Player is Visible Simplest Case Start the attacking behavior May be a direct route May look for cover
The Player Was Recently Seen Another simple case Move to the last point where the character was seen Provides for much more interesting game play to the player
The Player Was Recently Seen
The Player Was Not Recently Seen Must start searching “intelligently” Must generate a location Direction – within an angle θ of the player Distance – Some multiple of the exact direction to the target in an interval [Smin,Smax] (i.e. [.5,1.5]) Smin Smax θ x
Algorithm Detail Smin, Smax, and θ control the parameters of hunting Closeness of Smin, Smax to 1.0 and decreasing θ Increase Speed Increase Directness Making θ > 180 can make the NPC somewhat dumb
How it Works
Extensions Three-Dimensions Simply use a 3-D cone to pick destination Moving Players Need to update player destination along the way In case NPC and player run into each other Make sure you are moving towards the player and not to where the player was Sounds Hearing sounds can act as a new location that the player has been “seen” Target Priority If a more interesting target is seen, go after it Team based Tactics
Team Based Tactics
Conflict: Dessert Storm
Conclusion A* and similar path finding algorithms can be used to provide dynamic motion Edges in graphs can be used to encode motion- specific information Edges can be biased to modify the search algorithm Realistic hunting is an important part of an AI The hunting AI should react intelligently to a player It should be smart but not too smart