-
Notifications
You must be signed in to change notification settings - Fork 54
Home
This plugin provides full 3D navigation capabilities to your AI pawns in UnrealEngine. Alternatively, you could use the octree data structure for other purposes such as sensory occlusion etc. Contributors welcome.
The plugin is in alpha state. It is working and you can use it now, but there may be some bugs. If you find any, please create an Issue.
Some code needs cleaning up, and a profiling/optimization pass. While in alpha state, I may break the API. If you stick to using the gameplay/BT tasks you shouldn't have any problems though.
- Install the plugin (either in your project or engine Plugins/ folder)
- Add an SVONVolume to your level (this is the navigable bounds)
- Add a SVONNavigationComponent to your AI Controller or Pawn
- Call the task AITask_SVONMoveTo, easiest by using the SVON Move To behaviour tree node
The SVONVolume is the navigable volume, your AI will only be able to navigate within it. It contains the octree data that is used for navigation, and is the main thing you'll need to tweak the settings of. Settings are contained in the 'SVO Navigation' section of the details panel.
The number of layers in the octree (well, the number is actually this + 1, but whatever). The higher this value, the higher the resolution of the octree voxels.
I suggest starting with a value of 4 or 5, and experimenting. You may want to work with lower values during development and debugging, and increase the value for production.
The collision channel used for testing the blocking of each voxel. Note that the plugin currently just uses the built-in function OverlapBlockingTestByChannel. Setting this to 'Pawn' is probably a good starting point if you aren't sure.
The amount of clearance (in extents) required around a leaf voxel.
If your pawn collision is larger than a leaf voxel, and the clearance is 0, then the pathfinder will find paths that the pawn is physically unable to fit through. If your pawn is getting 'stuck' while navigating, try increasing this.
Either generate the octree on BeginPlay, or use the saved octree that you generated while in the editor.
This should always be 'Use Baked', unless you really, really want to have your game freeze during loading.
The number of layers in the current octree for this volume
The number of bytes consumed by the current octree for this volume
This is where the magic happens. Clicking this will generate the octree.
Note that this is not currently a multi-threaded operation. The editor will freeze while the process runs. This may be for a fraction of a second, or minutes, depending on the number of layers and complexity of your scene.
This settings limits the distance at which the following debug visualizations will be rendered. Trying to render the whole octree for a large scene will not be fun.
Note that these debug settings are only rendered up generating the octree.
Renders wireframe boxes for the 'above leaf' level voxels.
Renders wireframe boxes (red) for the leaf voxels
Renders the morton codes for all voxels (only works in-game, not the editor, as it requires a HUD).
Renders lines representing the neighbour links between 'above leaf' voxels
Renders lines representing the links between parent and child voxels