Tips — Preparing for Pathfinding

posted Mar 1, 2013, 12:24 PM by Rosanna Himmel   [ updated Jun 16, 2013, 5:40 PM ]

This is intended as an entry-level guide to preparing your land for your pathfinding-enabled VKC Pet. There are already other documents available elsewhere and there will surely be more to come. Some will show more detail and more advanced tricks and thus may be more difficult to come to grips with when you’re just starting out. Consider this the bare essentials and once you’ve got the hang of it, you’ll be better equipped to go on to more advanced techniques.

Introduction to terms used

Pathfinding is an amazing Second Life feature that allows animals like the VKC Pets to move around without crashing into things. They can find their way around obstacles instead of jumping over them and can find their way in and out of the house, provided the doors are open or if you have a fence around your yard, the pets will stay inside the yard. You’ll need to keep the gate shut and make sure there are no holes in the fence, of course.

Pathfinding Characters means scripted objects that make their way around using the Second Life Pathfinding System. When your pet is in Pathfinding Mode (pf on), he is a Pathfinding Character.

There are also three other types of objects that we need to think about:

  • Obstacle — things that the pets must walk around.
  • Walkable — things that the pet may walk upon. (It doesn’t make any difference to whether we can walk on it.)
  • Phantom — things that the pet can walk right through as if they were not there (same meaning as it always has had).

(There are other types, but for now these are the most important.)

The default type for any object that is not already Phantom is called “Moveable Obstacle”. This is a very convenient type, but it’s not very efficient. It’s convenient because you can move it around at will, but it’s inefficient for the sim because it means that the sim has to check the positions of all of these objects every time your dog wants to move somewhere. In pathfinding terms, these “Moveable Obstacle” objects are known as Dynamic Content.

In order to optimize the region for Pathfinding, we need to make as many of the Moveable Obstacles as we can into either Static Obstacle or Walkable. These two types are known as “Static Content”. The region makes a map of where these types are, how big they are, and the paths between them. This map is known as the Navmesh. When your dog wants to go somewhere, he will use the Navmesh paths to plot the path to his destination while also taking into account the Moveable Obstacles. For him to be able to find this route quickly and efficiently, it is important to minimize the number of Moveable Obstacles.

Rebake — means to redraw or rebuild the navmesh.

What sort of things should be which type?

Good candidates for Walkable Objects are:

  • Paths and driveways
  • Bridges
  • Houses
  • Dog houses (and maybe pet beds)
  • Other buildings that you would like your pet to go inside

Good candidates for Static Obstacles are:

  • Fences and Walls
  • Lamp posts
  • Fountains
  • Furniture
  • Any buildings that you do not want your pet to go into

How do I change the pathfinding types for my things?

Use viewer with Pathfinding Tools

First you need a viewer with the Pathfinding Tools.

The tools to perform these tasks are in the mainstream Linden viewer, but also may choose the latest Firestorm Viewer. You can install either the Linden Viewer or Firestorm separately and independently of your regular viewer if you use Phoenix or Catsnip or something else. You can switch between the viewers freely and go back to your favorite viewer when you are not working on optimizing your land for pathfinding.

Change Pathfinding types

Now we can look at how to change the pathfinding types.

In this example, we’ll set a section of the path outside Enrico’s workshop to Walkable and set the hitching post (for the horse that he had before he bought an automobile) to Static Obstacle.

If the pictures and screen shots look a bit small, you can click on them to see a larger version.

Please note: we do our best to ensure that the screenshots, menu options, tools and controls that we illustrate and describe are accurate at the time of writing, but the viewer developers are apt to change the interface without notice and you may find that things are not quite in the same place that we describe.

Right click the object that you are going to change — choose View in Linksets. This is how it looks in the Linden viewer, Firestorm is in the pictures below.

It’s buried a bit deeper in the Firestorm viewer, you’ll need to choose More and then More again.

Followed by Pathfinding...

...and then you find Show in Linksets.

This is the Linksets window. It looks much the same in each viewer.

The current type (Moveable Obstacle) is shown in the Pathfinding Linksets window.

Use the drop down menu on the lower right of the window to choose the new type.

When you have chosen Walkable, click on the button labeled “Apply changes.”

Right after you click on “Apply Changes”, you may see a Notification about needing to Rebake the region. For now, just click on OK. We’re going to make another change before we Rebake. (Don't worry if you don't see this notice, it is not displayed in all viewers.)

What you will see though, it this little indicator is up in the address bar near the “No Pushing” icon. (You can see this in the Linden Viewer as well.) This may look insignificant, but remember where it is. If you are using Firestorm, it will be a useful shortcut.

We now right-click on the Hitching Rail and find our way back to the Linksets window.

Choose the Linkset Type Static Obstacle this time.

Click on "Apply Changes."

Rebake the region

Go to the Build menu at the top of the viewer window.

Click on the Pathfinding option and then on Rebake Region.


You won't see any confirmation message and you won't see anything happening while the region is rebaking. But, after a short period, the little yellow indicator in the address bar will disappear.

(If you're using Firestorm, you can click on the little yellow indicator instead of using the Build => Pathfinding menu. You will see a message pop up in the middle of the screen like the one below. Click on "Rebake.")

Rebaking is the name of the process that makes a new Navmesh.

When you are changing the different objects on your land, you can use the Rebake button every time or only once in a while. It doesn’t really matter. I normally change quite a few different things between rebakes.

If you click on the little yellow indicator while using the Linden Viewer, it will tell you: "The region has pending pathfinding changes.  If you have build rights, you may rebake the region by clicking on the “Rebake region” button." But there is no "Rebake Region" button. You have to use the Build => Pathfinding menus instead. We've filed a JIRA about it and the developers are aware of it, we hope that they'll fix the message, or return the Rebake button soon.

Gotchas

Doors. If you set your house to walkable and the doors are linked to the house, you will see a script error every time you open or close the doors. This is because the house (being walkable) is Static Content and cannot move without changing the Navmesh, thus the doors are not meant to be able to move. There are several things you can do about this:

  • Open the doors and turn off/remove the scripts. (Easy)
  • Unlink the doors and link them to their own “hinge” prim. (Not difficult, but more advanced.)
  • Set the doors to “physics shape none” (Easy)

Stairs. In some builds with sculpted stairs, the stairs seem to turn into a solid box that you can no longer walk up. The explanation for this is a bit long for this article. The usual cure is to set the “Physics Shape” to “None” using the Edit tool.

Megaprims. These old-fashioned, oversized prims cause problems with pathfinding. And now that LL allows us to size regular prims so they are larger than 10 x 10 x 10, these megaprims are no longer needed. If you have megaprims in your builds, consider swapping them for regular prims of the same size.

Sculpted prims. Usually, these are fine, but occasionally you will find sculpties that have a really big bounding box. While this bounding box may be invisible to you, it is quite solid to a pathfinding pet. The usual cure, again, is to set the "Physics Shape" to "None" using the edit tool. This will allow anyone to pass through these prims unimpeded. If you do not want people and pets to be able to walk through these objects, then place an invisible box of an appropriate size over or in the object and set this invisible prim to "Static Obstacle."

Tips and Tricks

Use the drop down menu at the top of the Linksets window to filter objects by their pathfinding type. You can use this to find all the Moveable Obstacles quickly.

Use the headings in the Linksets window to sort the objects by owner name to find your things more quickly.

You can hold down the Shift or Control keys and click on more items in the Linksets list to select more than one thing at a time. You can set all these things to the same type at once.

If you right click on an object in-world and choose Edit, you can (as I am sure you know) hold down the Shift key and click on other objects to select more than one at once. When you have several selected you can right click again and choose “Show in Linksets” to open the Linksets window with them all selected at once. (They might not all be side by side in the list, but at the bottom of the list, the display will tell you how many you have selected.

Further Reading

Pathfinding Tools in the Second Life Viewer — This article on the Linden Wiki covers what we covered in this article with a lot more information and discussion thrown in.

Pathfinding Quick Start Guide — There is a lot more information in this Linden Wiki article, but it’s not as easy to understand to begin with. But stick with it and refer back. It’ll make more sense as you become more familiar with Pathfinding.

Pathfinding Overview by Inara Pey.

If you have written or know of a useful article that we should include here, please let us know.