Difference between revisions of "Visual Guide to Pathfinding"
Jump to navigation
Jump to search
Hyper Mole (talk | contribs) |
m (removed trees from the list of things that should be at static... trees need to be phantom) |
||
(29 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
* A new Pathfinding region has | ==Setup Pathfinding== | ||
* Movable | |||
* A new [[Pathfinding]] region has three types of objects. The terrain is set to [[Pathfinding_Tools_in_the_Second_Life_Viewer#Example_use_3|Walkable]] (by default and cannot be changed), existing objects are set to [[Pathfinding_Tools_in_the_Second_Life_Viewer#Example_use_3|Movable Obstacle]], and existing phantom objects are set to Movable Phantom. | |||
<pre style="color:red">Begin by naming every object in your region! It's difficult to know what to set objects to if they are all named "Object".</pre> | |||
* Movable Obstacle and Movable Phantom objects will not show up in your [[Pathfinding_NavMesh|navigation mesh]] view, so your initial view of your region will be the smooth green mesh of the terrain. Be sure to check the Walkable box in the Pathfinding Debug window (formerly the Edit/Test window). | |||
* Begin by making obstacles Static in the Linksets window. Many of these will be obvious, such as fences and walls. | |||
* Another obvious set of objects are your Walkables like floors, roads, and docks. | |||
* Objects that need to move yet need to be solid should be left as Movable Obstacles. An example would be scripted doors. | |||
* Objects that don't need to be obstacles at all, should be set to Movable Phantom. | |||
* Objects that avatars can navigate but Pathfinding characters cannot should be set to Exclusion Volume. | |||
<gallery> | |||
File:Pathfinding_002.png|Initial Pathfinding view | |||
File:Pathfinding_003.png|Adding Static Obstacles and Walkables | |||
File:Pathfinding_004.png|Adding more of each type | |||
</gallery> | |||
* Many linksets will need to be changed to work properly with Pathfinding. For instance, if your building is all one object or linkset and you wish to make the floor Walkable, you will need to unlink the floor so you can set the building to Static Obstacle and the floor to Walkable. Alternatively, you can place an exclusion volume around the walls/roof. Just be sure it doesn't include any areas that should be walkable! | |||
<gallery> | |||
File:Pathfinding_2_003.png|Floor linked to building, set to Static Obstacle | |||
File:Pathfinding_2_002.png|Floor and building not linked, floor set to Walkable, building set to Static Obstacle | |||
</gallery> | |||
* This linkset needs the railings set to Static Obstacle, and the stairs themselves set to Walkable. Originally it was all one linkset and set to Static Obstacle. | |||
<gallery> | |||
File:Pathfinding_2_004.png|Stair and railing linkset, set to Static Obstacle | |||
File:Pathfinding_2_005.png|Stairs and railing unlinked, stairs set to Walkable | |||
File:Pathfinding_2_006.png|Walkable ramp added for better navigation of pathfinding characters | |||
</gallery> | |||
* If you have a lot of trees, shrubs and other greenery, it's best to give it one simple physics shape for pathfinding characters to navigate around. Not to mention it lowers the load on the physics engine. | |||
<gallery> | |||
File:Sculptedlamp_005.png|Thick undergrowth for a pathway area | |||
File:Sculptedlamp_006.png|As seen by the navmesh and physics engine | |||
File:Sculptedlamp_007.png|Adding simple physics | |||
File:Sculptedlamp_2_002.png|Final linkset as seen by the physics engine | |||
</gallery> | |||
* Exclusion Volumes are handy for areas where you need avatar interaction but where pathfinding characters will likely get stuck. | |||
<gallery> | |||
File:Sculptedlamp_2_006.png|Excluded rock area | |||
File:Sculptedlamp_2_007.png|Excluded rock area | |||
File:Exclusion_use_001.png|Exclusion Volumes used to keep characters on the dock, yet avatars can fall off | |||
</gallery> | |||
==Optimize for Pathfinding== | |||
* Sculpted prims can easily be optimized for Pathfinding. Because sculpted prims have a messy physics shape, pathfinding characters will have difficulty navigating around or under them. Create the simplest [[Physics_Optimization|physics shape]] necessary for these objects. | |||
* Note that setting the sculpted prim to phantom and creating a separate physics shape will work, but the sculpted object will still be seen by the physics engine. The method below is more efficient. | |||
<gallery> | |||
File:Pathfinding_3_002.png|Sculpted bench with bad physics shape | |||
File:Pathfinding_3_003.png|Prim added for clean physics, bench set to Physics type NONE | |||
</gallery> | |||
---- | |||
Return to [[Good_Building_Practices]] | |||
__FORCETOC__ |
Latest revision as of 08:17, 14 August 2012
Setup Pathfinding
- A new Pathfinding region has three types of objects. The terrain is set to Walkable (by default and cannot be changed), existing objects are set to Movable Obstacle, and existing phantom objects are set to Movable Phantom.
Begin by naming every object in your region! It's difficult to know what to set objects to if they are all named "Object".
- Movable Obstacle and Movable Phantom objects will not show up in your navigation mesh view, so your initial view of your region will be the smooth green mesh of the terrain. Be sure to check the Walkable box in the Pathfinding Debug window (formerly the Edit/Test window).
- Begin by making obstacles Static in the Linksets window. Many of these will be obvious, such as fences and walls.
- Another obvious set of objects are your Walkables like floors, roads, and docks.
- Objects that need to move yet need to be solid should be left as Movable Obstacles. An example would be scripted doors.
- Objects that don't need to be obstacles at all, should be set to Movable Phantom.
- Objects that avatars can navigate but Pathfinding characters cannot should be set to Exclusion Volume.
- Many linksets will need to be changed to work properly with Pathfinding. For instance, if your building is all one object or linkset and you wish to make the floor Walkable, you will need to unlink the floor so you can set the building to Static Obstacle and the floor to Walkable. Alternatively, you can place an exclusion volume around the walls/roof. Just be sure it doesn't include any areas that should be walkable!
- This linkset needs the railings set to Static Obstacle, and the stairs themselves set to Walkable. Originally it was all one linkset and set to Static Obstacle.
- If you have a lot of trees, shrubs and other greenery, it's best to give it one simple physics shape for pathfinding characters to navigate around. Not to mention it lowers the load on the physics engine.
- Exclusion Volumes are handy for areas where you need avatar interaction but where pathfinding characters will likely get stuck.
Optimize for Pathfinding
- Sculpted prims can easily be optimized for Pathfinding. Because sculpted prims have a messy physics shape, pathfinding characters will have difficulty navigating around or under them. Create the simplest physics shape necessary for these objects.
- Note that setting the sculpted prim to phantom and creating a separate physics shape will work, but the sculpted object will still be seen by the physics engine. The method below is more efficient.
Return to Good_Building_Practices