soldier of fortune 2: double helix paris york cis 588
Post on 20-Dec-2015
221 views
TRANSCRIPT
Soldier of Fortune 2:Double Helix
Paris YorkCIS 588
Jumping, Climbing, and Tactical Reasoning: How to
Get More Out of a Navigation System
• Christopher Reed and Benjamin GeislerRaven Software/Activision
“using navigation to give AI more than just routes from one place to another.”
Image Sources: https://zerowing.idsoftware.com/svn/radiant/Sof2Pack/trunk/docs/Nav%20Point%20System.htm
• Navigation system is graph-based– Points - represent locations– Edges - represent safe routes
Enhanced Navigation Data
• Points and edges have static attributes attached to them, these are available to the AI in a look up table
• The data allows the appearance of more intelligent NPCs, and allows the system to be less resource intensive
• The path is selected by at a higher level, traversing points and edges is handled separately
Example: Bounding Overwatch– NPCs act in tandem, one covers while the
other advances; roles then switch until the goal is reached
– Points are marked as safe cover, the path selection is then biased towards these safe points.
• Example: Throwing Grenades– Problem -- How do we get the AI to know the best
place to throw a grenade?– Answer -- Compute all possible grenade throws in
advance and encode results in navigation system
Obstacle
Closest Point to Player
Closest Point to Agent
Standard Edge
Throw Edge over Obstacle
Agent
Player
• Biasing Edge Cost– Bias edge cost to prevent NPCs from
taking undesirable routes simply by increasing edge cost.
– Edges can also be biased for unique behaviour, such as flying
ParentPoint = OpenList.GetFromOpenList()
For each edge from ParentPoint
Switch Edge.type()
Case FLY_EDGE:
If (actor.CanFly() )
Edge.cost = actor.FlyBiasCost()
OpenList.AddToOpenList(Edge)
• Dynamic Movement: Opening a Door– The path is already generated, so
encountering a door is a simple matter.– The edge has the door attribute, the AI
automatically selects the appropriate animation, then continues on the path
– This also applies to using ladders, special doors, etc.
The Navigation Point
• Points provide discrete locations in space where agents can move to and from
• Can be any shape, sphere is easier to store -- point, radius
• Shape covers navigable area around point -- no obstacles, holes, etc
• Obstacle Visibility -- Side to Side and Vertical – If an obstacle is detected close to a
navigation point, information about this obstacle, such as height and width, can be pre-computed and stored in the nav system
• A low wall is good cover, so is the side of a building
The Navigation Edge
• Edges connect points to tell the nav system how to safely move between points
• Certain characters may not be able to traverse an edge, or may require a special action to do so
Examples of Edge Data
• Size– Sometimes characters are big, really big
and can’t fit down some paths.– Using collision detection, the maximum
size of a character that could travel a path can be determined and encoded in the nav system
• Jumping or Flying– If points in the air and the ground are
connected, they need to be encoded so that only flying characters attempt to follow
– If points connect over a hole, the edge can be encoded as a jump edge, restricted by game animation and physics
• Through Moveable Obstacles– Actions necessary to remove the obstacle
are encoded into the edge• Opening a door• Destroying a crate