Treet TV’s Pathfinding Episode

Treet TV is an ongoing broadcast team presenting in Second Life™ and streamed on the web. Their studio is at Garden of Dreams. They present their shows there via Media on a Prim (MOAP) and on Parcel Stream. Each Monday at 2PM (SLT/PT) they have a new Designing Worlds show. At other times you can find other shows being presented. Happy Hunting has a regular show for hunters. Plus, there are drama shows and series with weekly episodes. Check out the full range at Treet.tv.

Cute Horatio Pathfinding Character

Pathfinding

Monday October 8th Designing Worlds presented their interview with the Lindens on Pathfinding, the new feature in SL that I’ve been covering for months. Sandry Logan was interviewed on Isle of Dogs, which is the home of the Virtual Kennel Club of Second Life. They have a new line of trainable companion dogs. Check out the web site for more information.

It was Lorca, Maestro, and Falcon Linden that were on the show. Lorca Linden attended the showing of the interview and stayed to answer questions afterward.

I am providing my synopsis of the video. I would include time marks, but… I watched in world where I cannot get time marks. The video is an hour and half.  As with my Metareality summaries the comments are my take on what I heard and saw. Some of the information on Pathfinding (PF) functions I’ve expanded on from my experience with the functions.

Reason for Pathfinding

Scripting None Player Characters (NPC) in Second Life without PF has been exceptionally difficult. Navigating the grid has been scripting intense requiring lots of sensor scans, a CPU intense function. Lots of script time was needed and the performance of characters using scans was poor… actually at best they sucked. Plus a few of them would pull a region to its knees. Sensor scans are very script heavy and they lag regions.

While the new llCastRay() function would improve on sensors it too is more expensive than Pathfinding functions.

Pathfinding (PF) Characters use far fewer region resources than prior AI programming did. All the navigation calculations are done on the server side in highly optimized computer code (the Havok Physics Engine), meaning it is as efficient as the process can possibly be. Far more efficient than using the LSL scripting engine.

Why Now

When the Lindens built Linden Realms they discovered how difficult it was to get Rock Monsters to chase a person and avoid obstacles.  Tossing a castle into a region made for big design problems and lots of calculations. The scripts using sensors to animate the monsters are complex scripts and very inefficient. PF was envisioned to make LSL scripts simpler and more efficient by running on the heavy math in the Havok code server side.

Example

The Virtual Kennel Club (VKC) has trainable dogs. These are not breedable dogs. The idea is they are companions. Their owner can teach them tricks. The new hound uses the PF scripting features to reduce the script load on regions.

May be some day in the future they will have a version that can herd sheep. In the show they had Horatio, a polar bear cub with a candy cane. You can usually see the cub in PathTest1, ADITI. But, today he is gone. Horatio is the most adorable little guy I’ve seen.

You can see examples of Pathfinding working in Isle of Dogs. I was not able to teleport there today. I couldn’t get to a couple of nearby regions either. I’m not sure what’s up with that. I’ll try to morrow.

Homes

The question came up of how does one set Pathfinding in their own house? Who can do it? Sandry answered the question in the show. If you can edit a prim, you can set its PF attributes. So, if your house is Modify OK, you can set its PF attributes part by part. If it is not Mod OK then you will have to set a single attribute for the whole house.

There is a gotcha, that is doors… moving doors. If doors are separate from the house, no problem. But, if they are linked in with the rest of the house it will be a problem. Doors that open and close have to be set as Pathfinding Movable Obstacles. If not, the scripts fail with an error shouted when you try to open the door.

The Video House Example

The video shows an example of dogs going through a house contrasted with an older dog scripted with a collision navigation script. The Pathfinding based scripts work much better. The critters were called from inside a house. Horatio, the polar bear cub, navigated his way through the house to answer the call. The hound dog wondered around the house to answer the call. The older version dog ended up on top of the house.

The Tech

Maestro talked about the tech side of PF pointing out some of modes one can put a PF Character into;

  • LlEvade  – Run away
  • LlFleeFrom  – Similar to Evade. Run from a fixed point.
  • LlPursue – Chase or follow an avatar or object.
  • LlWanderWithin – Picks random points in an area.
  • LlPatrolPoints – Patrols a series of points.
  • llExecCharacterCmd – Adds a stop and a jump in place ability to the PF Character.
  • llGetClosestNavPoint – This function is usable in any script without requiring PF to be enabled in the region. This is best used by an LSL script to get a PF Character started, especially on the initial rez.
  • LlGetStaticPath – This is a function that returns a list of navigation points that leads from the current location to the requested destination. Any script can use it. PF does not have to be enabled on the regions. The Lindens envision merchants using the feature to move an avatar along a path in there store, like to get one from a promo some place to the actual vendor. This function works whether PF disabled in the region or not.
  • LlNavigateTo – Navigates to a point, even in a Neighboring Region. This is the only feature in LSL that allows one to navigate across regions.

Navmesh

Think of Navmesh as a map for PF Characters. It takes time to build the map. It takes very little time for PF Characters to read the map.

One can use the map and PF Tools to create paths and roads for 4 different classes of characters.  So, one could keep automated PF cars on the roads and disgruntled PF swamp frogs in the swamp.

The Navmesh is built automatically without any action on anyone’s part. One can optimize the map for better PF performance using PF Tools. The Navmesh is a combination of terrain and objects placed on the ground. If you can edit terrain or rez prims in an area, you can edit the Navmesh.

Any changes to the Navmesh, like rezzing a prim on the ground or near the ground, cause the Rebake Region button to pop up. This is done to save calculation time. If your building in a region, you want to recalc the Navmesh as seldom as possible. The Rebake button allows you to do that.

Currently the Rebake button is way too annoying. That is going to change. But, there are some user feedback problems that need to be handled. The Lindens are not sure how they will work out those problems. So, we don’t know when the button will change or how.

One thought on “Treet TV’s Pathfinding Episode

  1. Wow! I completely missed this at the time. If only I’d known, I’d have invited you over to the Isle of Dogs to meet the animals.

    Just for info: Isle of Dogs is the VKC private workshop, it’s not usually publicly accessible. But, you can meet the dogs, puppies and cats too at our dog parks at Turing Isle.

Leave a Reply

Your email address will not be published.