Generating NavMesh in SDK

Automatic NavMesh generation is a feature of the SDK available in the SceneExplorer. The NavMesh, as its name implies, is a mesh in which pathfinding can be applied to have AIs navigate through the game world. The generator takes a set of input values and, based on these, will create a mesh that stretches around obstacles. It can be seen as painted lines that the AI can use to know where it's safe to walk.

Generating NavMesh in SDK

NavMesh on top of the terrain

Getting ready

The feature is available through a plugin, which we have to download first. Refer to the Downloading the plugins section in Appendix, Information Fragments.

How to do it...

  1. Once the plugin has been downloaded, we can open any scene in the SceneComposer window, as shown in the following screenshot:
    How to do it...
  2. In the SceneExplorer window, right-click on the top node, and navigate to Add Spatial.. | NavMesh.. to bring up the options window.
  3. The simplest procedure from here is to click on Finish and see what happens.
  4. A geometry called NavMesh will shortly appear in the list, and selecting it will display its reach. Blue lines indicate navigable paths.
  5. If we're happy with it (which might be difficult to say if it's the first time we see one), we save the scene.

How it works...

The method by which the generator works is controllable by the large number of settings available. It can be difficult to know how they all affect the result, and what kind of result we're after, anyway. The best way is simply to test different parameters until a desired result is achieved. Each line is a path the pathfinder can follow, and there should be no isolated islands. The less lines there are in the mesh, the more restricted the AI will be. Remember, that different settings are optimal for different scenes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.116.51