Jump to content

Pathfinding - open testing


Medhue Simoni
 Share

You are about to reply to a thread that has been inactive for 4413 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Sorry, I have no idea where to place this topic, and here seems to be the closest thing to logical, lol.

I have not tested much yet, but I want to start this thread so that we have a place to talk about what we are seeing and experiencing with this shiny new toy. I'm still creating the NavMesh, and it's gonna take me awhile as I have stuff all over my sim.

 

Here is the Wiki on pathfinding:

http://wiki.secondlife.com/wiki/Pathfinding

Link to comment
Share on other sites

I tested some of the free scripts used at the Pathfinding sand box, to see how they effect LI  there's seams to be a minimum LI of 15 for using the scripts. I tested placing them in a single box and got a LI of 15 so kept adding boxes and got a LI of 15 until I added a 16th box which had a LI 16 I tried changes the boxes to torus and that had no effect on the LI.  I haven't been able to find any documentation on this yet.

 

Link to comment
Share on other sites

Interesting, I never heard this, and didn't even look. I'm testing it all with a mesh npc boxing guy I made with the defualt avatar, and got the same results even though the npc is only 10 prims. This is not good at all, although it's not terribly high. It does make me wonder why tho. Plus, it makes me questions more if using pathfinding is even worth it. Right now, I already have npcs that roam around and can attack people, and it is very low lag. Why would I change them over to pathfinding only to cost more prims. Is not pathfinding supposed to be more efficient than coding it? If it is not, then why did we even do this? If the pathfinding adds lag, then why would I take a system we spent months on and throw that out the window for something that is more laggy, and cost us more prims, and relies on a navmesh that has to be properly optimized?

Another problem tho, is doing the navmesh. If implemented as is, we have all kinds of regions that won't ever be optimize, cause the people owning those sims won't understand how to even set it up. The community would passionately hate pathfinding. I had to change every single object on the sim before I could get the sim to above .900 diliation. On top of that, i do have a few people that rent from me, and I sent them messages asking them to check their items to make sure they still work. So, unless a Linden is going to go around to every sim in SL and magically optimize every region, I don't see pathfinding even viable in this state. Heck, now I don't even know If I'll keep testing on it. I might just ask to change my region back.

What is the deal with LL constantly trying to force prim counts up? I mean, they make something new, and then shoot themselves in the foot just for a few prims. We have mesh now, we don't need to keep screwing around and making everything more complicated than it already is.

Link to comment
Share on other sites

Here's the script I was testing, I be curious to see how it performs against yours.  The path finding  scripts look simple but if it's not saving resources then I'd rather take the time to do it the hard way.   And for 15 LI  all this script does is chase you around.  All so see if you get the same LI for adding the script, the sand box may be running under different LI rules.

string title ="llPursue"; //name of function being tested here
string body = ""; //construct body in code that compiles options used ti function call, target etc
key target = NULL_KEY;
default
{
    state_entry()
    {
        llSetText("I am an llPursue cube.\nClick me to relentlessly pursue you!", <1.0, 1.0, 1.0>, 1.0);
        llCreateCharacter([CHARACTER_DESIRED_SPEED, 5.0]);
    }
    
    on_rez(integer start_param)
    {
        llDeleteCharacter();
        llResetScript();
    }

    touch_start(integer total_number)
    {
        llSetText("Pusuig " + llDetectedName(0), <1.0, 1.0, 1.0>, 1.0);
        llPursue(llDetectedKey(0), [PURSUIT_OFFSET, <0, 0.5, 0>, REQUIRE_LINE_OF_SIGHT, FALSE]);
    }
}


I haven't had a chance to play with the nav mesh yet, is the owner of the land the only one who can edit it? 

Link to comment
Share on other sites


Medhue Simoni wrote:

We have mesh now, we don't need to keep screwing around and making everything more complicated than it already is.

Hehe, I've posted before that I've got totally lost with all the changes to land-impact.  Hell, it's even had more name-changes than I could keep track of.  As far as I can tell from the very limited information LL have given us the 'benefit' of pathfinding is being able to set things like 'flee' and let the object work it out for itself.  That is an awful lot easier than coding similar behaviour in LSL.

(And I have no idea how to create a navmesh, but since I'm not rich enough to upload meshes it's probably immaterial (pun))

Link to comment
Share on other sites


PeterCanessa Oh wrote:


Medhue Simoni wrote:

We have mesh now, we don't need to keep screwing around and making everything more complicated than it already is.

Hehe, I've posted before that I've got totally lost with all the changes to land-impact.  Hell, it's even had more name-changes than I could keep track of.  As far as I can tell from the very limited information LL have given us the 'benefit' of pathfinding is being able to set things like 'flee' and let the object work it out for itself.  That is an awful lot easier than coding similar behaviour in LSL.

(And I have no idea how to create a navmesh, but since I'm not rich enough to upload meshes it's probably immaterial (pun))

I think the current name is for land impact is "Land-Impact Resident" :-)

Link to comment
Share on other sites

I was using a similar script but I will try yours the next time I do some tests.

After I wrote my last post in this thread, I went directly to LL's "Wilderness" regions to look at the prim counts (I hate referring to LI, it's confusing for every1) on the pathfinding objects there. Those counts were all over the place, which doesn't make alot of sense. It is almost like those sims didn't really care about optimizing. The rats were like 16. The piranna were like 30. The Yaks were 36. This little insect was 32. But...... the unicycle was only 3. Don't quote me on all of those, but the unicycles had me totally perplexed. Obviously, it is mesh. Why all those others were so High, I didn't look very hard, but just assumed they were all non-mesh, cause you could easily make all of those other items with mesh for under 6 prims each.

So, after seeing all that, I have alot more testing to do, lol. I know for sure that the unicycles are all using pathfinding.

Link to comment
Share on other sites


PeterCanessa Oh wrote:

 As far as I can tell from the very limited information LL have given us the 'benefit' of pathfinding is being able to set things like 'flee' and let the object work it out for itself.  That is an awful lot easier than coding similar behaviour in LSL.


Well, alot more than just flee, but yes the benefits would seem to make everything easier for npcs and such. Before i found SL in 2007, I was playing around making MODs using the Cry-Engine platform. Their WayPoint system would blow people's mind. I even created 1 level were I had shipping containers all around a dock area, and when the player got close enough to the docks, all the shipping containers opened and like 30 of Far Cry's craziest monsters would go running out of the containers thru a maze of docks and fenced in areas after the player. The only safe spot was in a tower. If you didn't make it to the tower, you were pretty much dead. The npcs also had different levels of alertness. The only more complex npc system I've ever seen was in the Hitman series.

When I saw what LL did, I was a bit impressed, but until now, all I could really test was the simple script commands. Dealing with the navmesh is a WHOLE other issue. It really does make the process quite a chore, and I don't see how some1 buying a pathfinding NPC is going to have an easy time when they have little knowledge of or access to the Navmesh. As brilliant as the pathfinding system may seem, I'm quite weary of the overall affect of this system, especially if you are limited to the amount of npcs you can use. LL advised not to use more than 10 in the testing areas, which is a piddly amount for npcs on a whole sim.

Now, I can barely code, so don't think I did the coding for my current npcs. Roberto Salubrius did all the coding for my npcs. Currently, I have about 20 npcs of various type on my region, and it's basically a commercial sim with my big store, Roberto's store (which has hundreds of script running), and another large merchant that sells furniture and uses more scripting resources than even Roberto's parcel. My region is still extremely lag free. Roberto coded the npcs to chase you when you got in range, but stop when you got outside of that range. And the npcs all work with our combat system.

Here is a demo video with some of the npcs in action as they are now. With just a bit more coding, we'd be able to mimic what the pathfinding is doing in many ways. But.. to make it very much like the pathfinding, we'd need to create our own WayPoint system, by rezzing invisible prims for the npcs to navigate to, which would cost lots of prims, on top of the prims we are already using for the npcs. That said, it would still be alot less prims than what LL did at the Wilderness sims, lol.

 

 

Link to comment
Share on other sites

Probably because I don't play games in SL I'm stunningly uninterested in the pathfinding tools for NPCs, etc.  I'm just coming at them from the other side of things and wondering how they'd do for vehicles.  Specifically, the 'patrol' option could be good for a city-bus or similar.  The same could/should be true for flying tours of sims, which have always been popular.  I notice though that the patrol-point heights apparenly have to be close to ground level.  How high does all this pathfinding work, I hope they haven't made it 2d in a 3d world?

Link to comment
Share on other sites

Ok,where to start!

 

The unicycle is using pathfinding(just like the goat). In fact the only KFM script in those sims is in the boat tour.

I'm not certain about pathing critters costing 15LI, I'll have to look into that. I think the odd counts you're seeing in the wilderness are due to it being built as LL developed the code. So not the best place for consistency, especially related to prim count.

 

Yes, pathfinding is great for tour vehicles. The goat and unicycle use a list of points and one llNavigateTo call to do the entire route. Yes one call, rolls thru the whole list, can cross boarders(script still runs in first sim, so no need for grid coords). I may trim the code and paste an example here, if there is any interest.

 

As far as maximum critters per sim goes, each wilderness sim has over 200 critters at any time. And that's being conservative. (the rezzers and critters there have some smartness built in. The critters watch their CPU usage and self delete if over a certain amount, and the rezzers throttle if the sims td drops too much.)

 

That said, ultimately the sims geometry will determine max critter numbers. Too many movable objects, or many physically unoptomized builds will limit things. If we can clean up that über complex jungle to an efficient level then rest of SL should be pretty easy.

 

A couple of us are putting together more info for the wiki. Big subject though, and crosses into physics optimization.

  • Like 1
Link to comment
Share on other sites

Alisha, thanks for the info.  When you said that the critters watch their CPU usage and self delete, is that a built in function of pathfinding or is that extra code that needs to be added.

Im seeing the 15 minimum prim count in sand boxes on both Aditi and the main grid, looks like the sand box is running on a newer server version then the wilderness areas.

 Sanck Sandbox 1:  RC PF 12.05.02.25554

The River, Leech:  Second Life RC Wilderness 12.03

 

 

 

Link to comment
Share on other sites

What we have now is 2d pathfinding. Volumetric 3d pathfinding may be on the map, but I'm not in the loop and from what I hear, it's not an easy thing to add to SL.  We can still pathfind up in the sky and underwater.  For now we'll just have to fake it by baking platforms into the navmesh.

Link to comment
Share on other sites

I found the quickest way to establish a list of *useful* points was to use another new function.

llGetClosestNavPoint

This avoids using waypoints that could be unnavigable.

Also, when creating or updating a character, you can define the "capsule" radius and length(along with a lot of other behaviors). If you define the character as very tall, you can make it appear to float.  This can get laggy in a complex environment, as you're pathing a tall pole around. But it does seem to work efficiently if the area its pathing on is very simple.

Link to comment
Share on other sites

Ha! That's great! Congrats on wrestling the navmesh into shape.

 

The video spurred a fun idea. How about wearable tiger training whip that messages the kitteh. Pushing it into Flee state? Gosh, with some alpha toggling of posed models, the same whip make the tiger to tricks too.

 

Pathfinding is gunna be do much fun.

Link to comment
Share on other sites

Thanks! My sim is basically a big testing ground with stores on it. I purposely created areas for specific testing of movements, but all this was done when we created our own movement system, to test it. So, when I first opened and looked at the navmesh, all I could think was OMG, where do I start and what does all this mean.

The tiger finding me so easily in the maze, kind of shocked me. I even have 2 mountains with a bridge linking them. The tiger easily followed me up the mountains designated pathways and across the bridge. Depending on the slope of the terrain, the tiger moved slower, but i think I can easily fix that by adding a push when the speed gets low. This could also seem like a jumping type of motion, so climbing the terrain will be faster and might even look more natural, depending on the animal.

For custom themed sims, I do see pathfinding as a super awesome tool for all kinds of different interactive items. I still question whether pathfinding can be a merchant's tool tho. Setting up the NavMesh takes some planning of how you want things to move about and where, technical knowledge of how items are affected by the pathfinding system, and setting it all up will definetely change items in ways you won't expect. I know I have items that aren't working right now, and I'm gonna need to basically check everything. And, freezing the navmesh essentially locks all the permanent items, and everytime you change something on your land, you will need to unfreeze and basically create a new Navmesh by freezing it again.

We'll see how this all works out in the end.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4413 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...