Pathfinding: playing inside buildings

Optimising a build: the main structure is set to Static Obstacle, and a walkable floor is being dropped-in (show set to Walkable for clarity). Note the absence of any front doors: these are moveable objects and have been unlinked from the main structure to continue working

How far you can go with this, depends on whether the build is modifiable or not, and in the case of NO MOD builds, whether it contains things like doors or not. However, options for optimising builds include:

  • Setting the attribute for the entire building to Static Obstacle (with the caveats around scripted elements such as doors) and then dropping a Walkable floor in place
    • This will work for NO MOD builds that do not include any scripted moving elements such as doors as well as for modifiable buildings where the scripted moving elements have been unlinked
  • Create independent linskets for floor areas to be set to Walkable (as described in the previous set of  bullet points) and set the main structure to Static Obstacle (again, with the caveat related to doors and similar)
  • Setting the entire house to Walkable (door, etc., caveat again noted) and then use Exclusion Volumes to define walls, etc.

Exclusion Volumes and Material Volumes

Exclusion Volumes can also be used within building to confine / control character movement. For example, in the image below, I’ve set a room where Charlie can roam around, but I don’t want him wandering through into the hallway, so I added an Exclusion Volume prim to prevent him from doing so. Without it, he would occasionally wander into the non-walkable hall and stall.

The Walkable floor prim in place, and an Exclusion Volume to prevent Charlie wandering off into the non-walkable hallway (prims shown semi-translucent for effect).

Material Volumes are useful in slowing a character down where required – such as in a confined space where you don’t want it bouncing madly off walls and furnishings. Simply drop in a transparent prim, set the pathfinding attribute to material volume and reduce the walk rate to a suitable value prior to applying and performing a region rebake.

Moving In and Out of Buildings

Pathfinding characters cannot open / close doors. So if you want to have a character to be capable of walking out onto a patio, there are a few things you’ll need to do:

  • Make sure the walkable areas are contiguous between “indoors” and “outdoors”
  • Make sure the doorway is unimpeded. The door should be open and any auto-close functionality turned off / disabled
  • Make sure any “outdoor” areas are suitably bounded by Static Obstacles (walls, railings, etc.), to prevent your character wandering away or becoming stuck somewhere it shouldn’t be
  • Make sure hazards such as swimming pools are suitably safeguarded to prevent characters falling in.
Charlie comes out to play: the floor and patio of this partial mesh build are Walkable. I’ve set the front door to remain open until manually closed. Charlie will roam the lounge and patio. An Exclusion Volume over the pool theoretically prevents him falling in

Things Noted During Tests

The following are issues I noted when setting-up buildings on my own build platform, within my home region and working at Sandbox Artifex. I’m not stating any of them are “faults” with pathfinding; they may simply be down to my failure to set elements up correctly, or as a result of issues that are entirely separate from pathfinding. They’re simply issues I came across (generally with some frequency) during my fiddling around.

  • There appears to be a minimum space size for setting a character randomly roaming (although this could be an issue with the script I am using): Charlie refused to start roaming in any area of 10x10m or smaller; however, once in motion, he would happily roam in and out of confined spaces
  • As noted earlier, setting the entire structure of a building to Walkable resulted in Charlie occasionally “falling out” of the building (a drop of around 0.75m) and then roaming around outside, unable to get back in
  • Sharp drops between Walkable areas caused Charlie to stall. For example, in the image above, if Charlie fell off the left side of the patio area (a distance of 1.75m), he’d stall, despite the build platform below the house being Walkable
  • Shallow steps don’t present an obstacle. In the image above, Charlie could negotiate the step up into the house from the patio and could descend / climb the steps leading to the build platform
  • Exclusion Volumes do not appear to be efficient at halting a character; in the image above, Charlie repeatedly fell into the pool despite the Exclusion Volume surrounding and overlapping it. This occurred even after setting a Material Volume in place on the patio to slow Charlie down.

Pathfinding Q&A Thread

I missed this while playing with pathfinding at home and at Sandbox Artifex, but there is a Pathfinding Q&A thread on the forums wherein Falcon Linden addresses a number of questions, including making buildings walkable, and addresses some issues around mesh and pathfinding elements.

Related Links

3 thoughts on “Pathfinding: playing inside buildings

  1. As an aside, it probably wouldn’t be too hard to rig doors with a listen script for a pathfinding character to broadcast to when they want it to open; it’s just not *automatic*. (Or, alternatively, the door object waits for something to bump into it.)

    Like

    1. I didn’t get that far in fiddling around, but one of the things on my “to do” list is to see how a character interacts with a local collision volume for a door.

      Like

  2. The Land Impact seems pretty fair to me. It was very obvious that the old-style methods, used for Zombies and Breedables, could put a heavy load on a sim. (It didn’t help that, in one Zombie-maze, the owner insisted that everyone use a rather antique freebie shotgun, which didn’t take advantage of half-a-decade of weapons scripting experience, and suffered badly from bullet-warping[*] when the physics frame rate plummeted).

    A minimum LI of 15 suggests that Pathfinding is hugely less load on the sim. (It won’t make the guns any better.)

    [*] All moving objects jump from point to point, frame by frame. Small objects moving quickly can go through objects because their collision boxes never intersect. Physical bullets can easily move a couple of metres per frame, so they have to be long rods to reliably hit anything, and not go through walls. This shotgun fired small spheres…

    Like

Comments are closed.