Creating a Nav Mesh, Cover Regions and Jump-able Obstacles

From BiaSDK
Jump to: navigation, search

Getting Started

For anyone who has mapped using the Unreal Engine before you should be familiar with path nodes and how to use them. In Hell's Highway nav mesh has replaced the path node system. Nav mesh tells the AI where they can and can't run. Any place you lay down nav mesh your squad and the Germans will be able to access. Don't place nav mesh through or under static mehses or the AI will have trouble navigating that area and will likely try and run straight through the static mesh ( Only place nav mesh under other static meshes if its a half height wall or object you want them to be able to jump over).

Getting Started

For anyone who has mapped using the Unreal Engine before you should be familiar with path nodes and how to use them. In Hell's Highway nav mesh has replaced the path node system. Nav mesh tells the AI where they can and can't run. Any place you lay down nav mesh your squad and the Germans will be able to access. Don't place nav mesh through or under static mehses or the AI will have trouble navigating that area and will likely try and run straight through the static mesh ( Only place nav mesh under other static meshes if its a half height wall or object you want them to be able to jump over).

Creating a Nav Mesh

The Nav mesh tool can be found in the tool bar to the left.
109 Tool.JPG

Terrain Trace Only - If you are placing nav mesh over top anything but a terrain you will probably want this option unchecked or it may place your nav mesh well below your mesh or BSP your trying to place it upon.

Several times in this tutorial I will talk about nav mesh polys, and vertices. Just to make things clear, the nav mesh vertex\vertices will be the little red squares with the plus in them. The nav mesh poly is the big pink object that appears when you connect all the vertices. Nav mesh edges are the light blue lines that connect the vertices.


Tools:

110 Tool2.JPG

1. Use this tool to move the nav mesh vertices around.

2. Use this tool to create your nav mesh. Hold Control and using the left mouse button will place the nav mesh vertices. Place 3 nav mesh vertices then hold control and press the right mouse button on top of the first vertex you placed. If you did it correctly you should get a pink box. Below are two pictures of how a good shape is made and how a bad ones is made. You can't criss cross the verts or it will show up like the bad one.

Good: 111 NavPolyGood.JPG

Bad: 112 NavPolyBad.JPG

When creating several poly's there is a possibility that you can create a poly just by linking one new vertex to several other vertices that are already part of another poly. You can do this by simply creating the new vertex (ctrl+left click), and then ctrl+RIGHT clicking the existing vertex you wish to link. You will see a yellow line appear that goes from the freshly made vertex to the existing one. Add more vertices (new or existing) to the chain and eventually ctrl+Right click the first vertex you created.

You can create a new poly using nothing but existing vertices using this method also. Note that if you ctrl+right click in voice space, the editor will automatically select the existing vertex nearest to the current position of your mouse cursor. Knowing this, you can expand this feature to work faster; if you create a new poly using existing vertices, know that you don't have to ctrl+right click on top of it at all, just make sure the wanted vertex is nearest to your mouse when ctrl+right clicking.

3. This tool can be used to merge two Nav Mesh vertices or to split the edge of the nav mesh poly. To merge two nav mesh vertices click one vertex, hold control and left click another vertex. It will join your two vertices into one. To split a nav mesh poly hold control and right click anywhere on the blue line that connects your nav mesh vertices and it will add a new vertex there.

4. This tool is useful for splitting one nav mesh poly into two or joining two nav mesh polys into one. To combine two nav mesh polys into one hold control and left click the nav mesh edge that seperates the two navmesh polys and they will be joined into one.

113 NavPolyCombine.JPG

Now if you want to seperate it again you can hold control and right click each vertex that was at the end of the blue lines and it should make them two seperate polys again.

114 NavPolySeperate.JPG

5. Not entirely sure what this tool is used for as I never actually had to use it at any point. My guess is that it has something to do with linking the nav mesh in one level with the nav mesh to another sublevel. Although there are other methods to do this.

6. This tool is only really useful for if you are placing nav mesh above nav mesh in another part of your world. For example if you had a two story building and the bottom floor was nav meshed and youd want to have the top floor nav meshed as well you would make a new layer and have the top floor layer 1 while the bottom floor was layer 0.

Setting up Cover

Place an object into your level that you'd like your squad or the Germans to take cover on. For my demonstration I used the side of a building. First thing you need to do is set the nav mesh up to fit the mesh your wanting to take cover at. To do so place one nav mesh vertex at each end of the mesh so that the nav mesh edge goes along the edge of the mesh.

115 CoverWall.JPG

Next check to see if the normal is facing the right direction. The normal is a little light blue flag like object that is sticking out all the nav mesh edges. If you want to take cover on an object you have to make sure that this little flag is facing towards the mesh.

116 NormalFlag.JPG

If its not then you can change it in the properties by putting a check next to flip normal (Under GameComponent). If you don't have this flag facing the right way you will get some pretty odd things happen when trying to use this wall for cover. Once the properties are opened for your nav mesh edge put a check next to bIsCover. Once you check this your nav mesh edge will turn purple indicating that it is used for cover.

117 IsCover.JPG

Setting up destructible cover and wall jumps

For destructible cover you can't use normal static meshes, you need to place prefabs. To find some good ones open the package P_Fence go under Prefabs and use dc_rural_fence. Place that in your level. Just like with the wall cover I set up before make sure that the nav mesh is lined up correctly with the fence, but this time make sure that it is lined up on both sides and that there is a nav mesh poly under the fence like in the picture. Also make sure that there is a poly on the other side of the fence as well. As before make sure that the normal flags on both sides are facing inwards towards the fence.

118 WallJump.JPG

Now open the properties to the two nav mesh edges on both sides of the fence and check bCanHopOver, bIsCover, and bIsDestructible. If set up correctly you should be able to jump over the fence, destroy the fence, and take cover on the fence. You should also check bAutoSplitCover when using destructible fences. If you tick this option it will split your nav mesh edge into several smaller ones when you rebuild the navigation.

119 WallJump2.JPG

Other properties:

There are a few other properties for the nav mesh edges I didn't explain. I'll only explain a few of them here.

bAutoSplitCover: When creating a destructible cover you can check this option to have the build process cut the poly underneath it into sections that can contain exactly one person. This helps the game to determine where cover is still available when only a part of the cover has been destroyed. Note that the nav mesh edges on either side of the poly need to be the same length approximately, so both sides of the destructible cover can contain the same amount of soldiers. A trapezium shape is an example of how not to do this. This is not a required option, but makes creating cover areas for straight destroyable cover pieces (like the stacked boxes or the rural fence) alot easier. If you create one cover area for the entire cover piece and only part of it gets destroyed, the game will disable the entire cover area so you will need to consider this option or create the split up cover regions yourself.

bCanHopOver: Kind of self-explaining, check if you wish the player to be able to jump over this cover

bCommandModeDisabled: This option is used on all nav mesh edges inside buildings or under roofs accross Hell's Highway. It disables command mode and is useful for indoor areas to keep the players camera from going through the ceilings. Will only be used when the player is taking cover at a nav mesh edge with this option ticked.

bFlipNormal: The normal is the little flag that determines the 'direction' where the navmesh edge is facing. If you create a nav mesh poly that has an edge against cover but it is facing the wrong direction, you can check this option to flip it to the other side.

bFlipSingleCoverSlotSide: No idea what this does.

bForceFullHeight: This option is useful when you want to force the player to take cover standing up

bForceHalfHeight: This option is useful for forcing the player to take cover in a kneeling position.

bForcePlayerDigInLeft\Right: These two options usually shouldn't be touched. Good example of a time to use it. You have a doorway where you want the player to take cover at the edge of it and you want to force the player to take cover and face towards the door way you can tick these options to make him face the way you want when he takes cover there.

IsAmmoDepot: No idea what this does.

bIsCover: Kind of self-explaining, check if you wish the edge to act as a cover region.

bIsDestructible: Kind of self-explaining, check if you wish the cover edge to act as a cover region for a destructible cover piece.

bIsNoRollOutLeft/Right: As far as I can determine, checking this will prevent the player from 'peeking' around the corner when at the edge of the cover region.

bIsNoStageTwoLeft/Over/Right: As far as I can determine, checking this will prevent the player from 'peeking' around the corner when at the edge of the cover region.

bIsPlayersOnly: This option makes the nav mesh edge only usable by the player. Your squad as well as the Germans will ignore any nav mesh edge you put this option on.

BlockingFlags: need to sort this out still. Offers the possibility to make sure that a certain ai squad does not cross a specific line in the game.

DestructibleCoverDef: When the edge is near a destructible cover, the definition of the cover piece needs to be filled out here.

EdgeWeight: No idea what this does.

LinkedEdges: list of the linked edges to this edge. Not really of importance for mapping.

Cover Occupied

Enabling the view of Cover Occupied is useful for when you need to know how many AI can fit on a piece of cover. Once you have this option ticked to show cover slots a bunch of green boxes will appear along cover areas. If there are 8 boxes along side your cover that means 8 AI will be able to take cover on that object. Look at picture to see how to enable it.

120 CoverOccupied.JPG

Original tutorial Witten by Ben Burkart http://www.evilmrfrank.com/NavMesh.html additional information by Pooky


back to Mapping tutorials
Back to Getting German Squads to Move