soldier of fortune 2: double helix paris york cis 588

14
Soldier of Fortune 2: Double Helix Paris York CIS 588

Post on 20-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Soldier of Fortune 2: Double Helix Paris York CIS 588

Soldier of Fortune 2:Double Helix

Paris YorkCIS 588

Page 2: Soldier of Fortune 2: Double Helix Paris York CIS 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

Page 3: Soldier of Fortune 2: Double Helix Paris York CIS 588

• Navigation system is graph-based– Points - represent locations– Edges - represent safe routes

Page 4: Soldier of Fortune 2: Double Helix Paris York CIS 588

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

Page 5: Soldier of Fortune 2: Double Helix Paris York CIS 588

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.

Page 6: Soldier of Fortune 2: Double Helix Paris York CIS 588

• 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

Page 7: Soldier of Fortune 2: Double Helix Paris York CIS 588

• 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)

Page 8: Soldier of Fortune 2: Double Helix Paris York CIS 588

• 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.

Page 9: Soldier of Fortune 2: Double Helix Paris York CIS 588

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

Page 10: Soldier of Fortune 2: Double Helix Paris York CIS 588

• 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

Page 11: Soldier of Fortune 2: Double Helix Paris York CIS 588

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

Page 12: Soldier of Fortune 2: Double Helix Paris York CIS 588

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

Page 13: Soldier of Fortune 2: Double Helix Paris York CIS 588

• 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

Page 14: Soldier of Fortune 2: Double Helix Paris York CIS 588

• Through Moveable Obstacles– Actions necessary to remove the obstacle

are encoded into the edge• Opening a door• Destroying a crate