Classic Battlefield Modding Wikia
Advertisement

Navmesh a Long Wooden Bridge

by [TLB]stickman

LB image18.png

Image File: LB_image18.png


Now you have to ask yourself one question. Are you going to navmesh this bridge? Well, are you, Punk. I have learned through experience that this “nice-looking” bridge won’t navmesh worth a dam. We have to move some bridge sections vertically (just a little bit) to have a “step” effect. Let me show you what I mean.

LB image19.png

Image File: LB_image19.png


We want to start with wooden_bridge_head1. First things first though. Make sure that it is Snapped to Ground. Zoom your camera underneath the bridge head and make certain that the terrain underneath the bridge “ramp” does not touch the bridge object. If it does, use the Level tool in the Terrain Editor to lower the terrain.

LB image20.png

Image File: LB_image20.png


Hints: If you double-click the first bridge segment and write down the Y/Pitch value, then subtract the Y/Pitch value of the bridge head, you will see a difference of 2.11378. You can use this number if you want to build your bridges in place one piece at a time instead of building the complete bridge first as we did in the first part of this tutorial. Just snap your bridge_head1 to ground, and then double-click the bridge head. Then add 2.11378 to the Y/Pitch value shown and use that value for all of your bridge segments. This will be your starting position. The Stamp-Align buttons in the General tab of your editor do not work properly for the wooden bridge. It aligns the wrong end of the bridge heads to the bridge segments! It won’t align two segments either; it just stacks them on top of each other at the same elevation.

If that much looks good, then we’ll continue. Double-click the bridge segment closet to bridge head 1. In the Absolute Transformation box that pops up, decrease the value in the Position – Y/Pitch window by 0.01. For example, if the original value displayed was 30.85400, you will change it to 30.84400 for this segment. Now go to the next bridge segment and reduce it by 0.02 less than the previous segment. So using the previous example, this segment will be changed to 30.82400 now. Do this for the remaining segments, reducing the Y/Pitch value by 0.02 from the previous segment as before. Now select bridge_head2 and nudge it down a little (using the keyboard) so that it is just a small step lower than the last segment. If the terrain under this bridge head touches the object, you will need to lower the terrain as we did with the first bridge head.

LB image21.png

Image File: LB_image21.png


I would recommend that you test your bridge’s navmesh prior to navmeshing your entire map, particularly if you have a large map. You can easily do this by creating a small Combat Area around your bridge, making sure to select the “Used by Path Finding” box after closing the Combat Area. Then run the navmesh program. It will only take a short while (a couple hours perhaps) and can save you many hours later on when you are ready to run the final navmesh. Make sure the Combat Area is on the Single Player layer of your level!

LB image22.png

Image File: LB_image22.png


After you run the Navmesh program, open your level to verify that the bridge did navmesh properly. Be sure to select “Toggle Draw AI” from the Render Menu, and also “Toggle Draw Vehicle Navmesh”. If the Vehicle mesh is good, the Infantry mesh should also be good.

LB image23.png

Image File: LB_image23.png


Although I did not actually run navmesh on this sample bridge for this tutorial, I want to show you an example of a completed bridge navmesh.

LB image9.png

Image File: LB_image9.png


From the looks of this, the navmesh did not make it to the right-hand side of the bridge, but looks can be deceiving! If you turn off the “toggle draw static meshes” from the Render Menu,

LB image12.png

Image File: LB_image12.png


You’ll see that the navmesh did indeed go all the way across. So be sure to turn off the static meshes when verifying that your navmesh is good or bad. You wouldn’t want to run navmesh again would you? Well, would you?

LB image14.png

Image File: LB_image14.png


After your navmesh is finished, be sure to raise your bridge segments back up to the original height before you run your lightmaps. Well, that’s about it. I hope this is of some help to the mapping community. I am new at it myself, and have found a wealth of info and tutorials in the BFEditor forums. It has been a great help to me and I wanted to share what I have learned with the rest of you.

Advertisement