Call of Duty: World at War

Call of Duty: World at War

Not enough ratings
[Mapping Tutorial] A.I. Navigation
By SparkyMcSparks
Overview of the pathing, traversal, and cover systems used for AI in Call of Duty.
The pathfinding in Call of Duty is done by Designers who place waypoints (or Nodes as they're called) in the level. Post-processing after the level compiles then connects all these nodes and makes a path graph out of it.

When an AI needs to climb over or fall down from one path graph location to another, a traversal is placed in between the two to have an AI play a traversal animation from one path graph to another.

When placing any node, they cannot be touching solid geo / models otherwise they will be marked as a Bad Node.

Note: You can download the supplemental files[] used in this tutorial.

Path Nodes
Path nodes are the waypoints that generate the path graph of where AI can navigate without any obstacles. Path nodes connect to each other and to other node types such as cover and negotiation (which will be discussed later).

Path nodes must be within 128 units from one another and within a height difference of about 45 degrees to make a connection.

Cover Nodes
Cover nodes let AI know where they can entrench themselves. They will pop out and take shots, depending on the cover type.

Generally you'll want to place them flush against a wall if possible and angled in the direction you want the cover animation to play.

Note: Ensure cover nodes aren't touching window / wall trims otherwise it'll be marked as a Bad Node.

Traverals consist of a Negotiation Begin Node connected to a Negotiation End Node. They are used to overcome obstacles on the path graph.

You can create and place them by hand, but many of them are included as prefabs in .../map_source/_prefabs/traverse/

Note: If a traverse isn't in the common scripts FastFile, you'll have to include the rawfile GSC for that traversal in your level Zone Source.

The prefabs come with a traverse brush that gets ignored during compile, you use this as a visual reference to line it up with geo to make sure the animation plays in the proper location (such as an AI putting his hand on an edge to mantle over).

The Begin node has Key Value Pair (KVP) information on what animation will be played.

Overlapping Nodes
For the most part, you don't want to overlap path nodes and cover nodes in any sort of way, you'll get an error and they'll be marked as Bad Nodes.

That said, you can overlap a negotiation node with either a path or cover node. This would be for a scenario when you want an AI to vault a wall and take cover on the other side. You'll get warnings during compile, but it'll be fine to ignore.

This example below would have the AI run from the left side, vault over the window, and take cover on the right side facing the way he came from.

AI Stances At Nodes
Now that you've placed your nodes, you'll notice the AI running around taking cover and traversing. There may be certain locations where you always want an AI to crouch, or to never stand.

You can do this by selecting that path or cover node boes which will automatically update the spawnflag KVP.

When you compile to generate path connections, look out for any node warnings or errors and address them as soon as possible. Now that you've done that and have your path graph generated and in-game, you'll want to make sure everything is working as intended.

Boot up the game in Developer mode using +set developer 1 +set thereisacow "1337" +devmap <mapname>

Toggle the following dvars to bring up some navigation debug information:


Depending on what you see you can diagnose what is wrong, here are a couple common ones you'll see:

Good Two-Way Path Connections
Light blue lines between nodes.

This is what you hope to see, it means everything is good.
Good One-Way Path Connections
Red lines with an arrow between nodes.

This means for some reason, typically an obstruction or height difference, the AI can only path one way. You should try to fix this, but it wouldn't be the worst thing in the world to leave if it fits your needs.
Good One-Way Traversal Connections
Red lines with an arrow between nodes.

Traversals are one way so it's ok that this case has a red arrow connection.
No Connection
Node outline in it's normal color with a red X in the middle.

This means your node has no nearby nodes to make a connection with, it's isolated by itself.
Bad Node
Node outline in red with a red X in the middle.

This means your node was touching geo / clip / model. You'll want to address this.
< >
Agent99 Aug 3, 2015 @ 5:40am 
Though I already know all that stuff, they are nicely explained for beginners.
[ALM]Rambo42088 Feb 28, 2015 @ 2:47pm 
good work thanks for the info. would you know if and what is the node limit to a map? or is the node limit just based on the max disconnected from the spawn?