Jump to content
Sign in to follow this  
rhonin Nissondorf

Zombies using pathfinding

Recommended Posts

i started out with just a prim  using llpursue , with no  PURSUIT_OFFSET or fuzz factor and with , to try and get a prim using pathfinding to collide with my avatar and incur a collision event. i tried using  a  path update event with  pu_goal_reached  but it takes way to long to kick in to make a usefull zombie.  the Prim just keeps acting as if there is a offset constantly. even though i followed the character creation guidlines from the wiki. i dont want to make a zombie with a small timer using navigate to . thats my next step in trying to make this work.

Share this post


Link to post
Share on other sites

Both llPursue and llNavigateTo tend to stop short of their goal by 1-2 meters. Pathfinding characters usually will not get close enough to collide with the target. That may be a deliberate feature.

Both calls also just quit fairly often, for no visible reason. Sometimes you get a path_update event, and sometimes you don't. With a few hundred lines of workaround code, you can sort of make this work.  See JIRA.

It's not that hard to get zombie-quality movement out of pathfinding. What's hard is getting human avatar quality movement. I sometimes say that my characters display about n00b user level movement.

  • Like 2

Share this post


Link to post
Share on other sites

Are you set on using path finding?.. or have you tried a sensor repeat with MoveToTarget?

 

Share this post


Link to post
Share on other sites
2 hours ago, rhonin Nissondorf said:

move to target might not work to well with walls.

Right. I have a whole maze solver written in LSL. It's slow, but it works. Maybe I'll cache solutions in notecards to improve performance.

Share this post


Link to post
Share on other sites
On 7/6/2019 at 6:24 AM, animats said:

It's not that hard to get zombie-quality movement out of pathfinding. What's hard is getting human avatar quality movement. I sometimes say that my characters display about n00b user level movement. 

This is not really the aim of the forum but now you made me curious: Where can I find your sim and/or product? I think it would be cool to experience what is or is not possible when creating games with LSL tools.

Share this post


Link to post
Share on other sites
7 hours ago, Estelle Pienaar said:

This is not really the aim of the forum but now you made me curious: Where can I find your sim and/or product? I think it would be cool to experience what is or is not possible when creating games with LSL tools.

I'm not selling NPCs at this time. But I usually have some pathfinding characters running around Animats's Advanced Vehicle Development in Vallone. I also usually leave one running at Animesh 1 on the beta grid. If you go there, they'll find you, approach, say "Hello", wait a bit, and walk off.

Now that overloaded sims are the new normal, it's tough getting pathfinding to work reliably. My characters have extensive recovery code, yet they still get stuck occasionally. Pathfinding sets a heading and speed for each character, and updates that course when it gets around to it. On an overloaded sim, characters continue too far, blind, because the pathfinding system is responding slowly. They get stuck in objects or even go off the parcel.

Share this post


Link to post
Share on other sites
On 7/29/2019 at 2:14 PM, animats said:

I'm not selling NPCs at this time. But I usually have some pathfinding characters running around Animats's Advanced Vehicle Development in Vallone. I also usually leave one running at Animesh 1 on the beta grid. If you go there, they'll find you, approach, say "Hello", wait a bit, and walk off.

Now that overloaded sims are the new normal, it's tough getting pathfinding to work reliably. My characters have extensive recovery code, yet they still get stuck occasionally. Pathfinding sets a heading and speed for each character, and updates that course when it gets around to it. On an overloaded sim, characters continue too far, blind, because the pathfinding system is responding slowly. They get stuck in objects or even go off the parcel.

How do you implement the pause in the list of coordinates?

Share this post


Link to post
Share on other sites
20 minutes ago, Tech Robonaught said:

How do you implement the pause in the list of coordinates?

Timer events and a state machine.

At the top, there's a "behavior" script, which decides what to do. My current test script checks for new avatars entering the parcel, and goes to greet them. If no one needs to be greeted, it picks a patrol point randomly from a list on a notecard and goes there, then waits for the time listed on the notecard. This keeps my NPCs looking busy.

Movement is set up as a library.The user interface is much like system pathfinding - there's Pursue and NavigateTo. You call one of them, and the character tries to go there.  You get a link message back on completion or failure.

I won't link to it on Github so as not to be accused of advertising. But you can IM me. It's not a product yet, anyway, or ready for use by others; R&D and demos for now.

I usually leave some NPCs running around my place in Vallone. Having busy NPCs around makes me work on their social skills. At normal walking speed and faster, this becomes important. At creeping zombie speed, people will tolerate worse behavior, because you have plenty of time to get out of their way, even if they're too stupid to get our of your way.  We need to give NPCs behaviors people can live with. Otherwise, users will hate the things. Come over, check them out, and comment, please.

  • Like 1

Share this post


Link to post
Share on other sites
On 9/2/2019 at 3:15 PM, animats said:

Timer events and a state machine.

At the top, there's a "behavior" script, which decides what to do. My current test script checks for new avatars entering the parcel, and goes to greet them. If no one needs to be greeted, it picks a patrol point randomly from a list on a notecard and goes there, then waits for the time listed on the notecard. This keeps my NPCs looking busy.

Movement is set up as a library.The user interface is much like system pathfinding - there's Pursue and NavigateTo. You call one of them, and the character tries to go there.  You get a link message back on completion or failure.

I won't link to it on Github so as not to be accused of advertising. But you can IM me. It's not a product yet, anyway, or ready for use by others; R&D and demos for now.

I usually leave some NPCs running around my place in Vallone. Having busy NPCs around makes me work on their social skills. At normal walking speed and faster, this becomes important. At creeping zombie speed, people will tolerate worse behavior, because you have plenty of time to get out of their way, even if they're too stupid to get our of your way.  We need to give NPCs behaviors people can live with. Otherwise, users will hate the things. Come over, check them out, and comment, please.

Any hard and fast way to eliminate the pause I have noticed when a Character moves between co-ordinates?

Share this post


Link to post
Share on other sites
2 hours ago, Tech Robonaught said:

Any hard and fast way to eliminate the pause I have noticed when a Character moves between co-ordinates?

How are you moving them? KFM is smooth and pause-free for the chain of moves in one call to llSetKeyframedMotion. SL pathfinding is smooth in open space, but gets weird in tight spots. Making repeated calls to llSetPos tends to be jerky.

Share this post


Link to post
Share on other sites
9 hours ago, animats said:

How are you moving them? KFM is smooth and pause-free for the chain of moves in one call to llSetKeyframedMotion. SL pathfinding is smooth in open space, but gets weird in tight spots. Making repeated calls to llSetPos tends to be jerky.

pathfinding  - list of coordinates in globals - simple character stuff, just seems to be a 1 second pause between 1 coord to the next coord cant seem to get rid of it.

Share this post


Link to post
Share on other sites
3 hours ago, Tech Robonaught said:

pathfinding  - list of coordinates in globals - simple character stuff, just seems to be a 1 second pause between 1 coord to the next coord cant seem to get rid of it.

Using llPatrolPoints? I've never tried that, but it has a "pause at each point" option, which might be on.

If you're in a sim with no idle time, pathfinding will be jerky. Pathfinding seems to have lower priority than almost everything else that uses server CPU time. At each patrol point, it has to plan the next move, which takes some resources.

SL pathfinding just doesn't work very well if you have specific destinations. "Wander" works OK, because if it's doing the the wrong thing, you can't tell. Motion to a goal, not so much. That's why I had to write my own system.

Share this post


Link to post
Share on other sites
On 11/20/2019 at 1:36 PM, animats said:

Using llPatrolPoints? I've never tried that, but it has a "pause at each point" option, which might be on.

If you're in a sim with no idle time, pathfinding will be jerky. Pathfinding seems to have lower priority than almost everything else that uses server CPU time. At each patrol point, it has to plan the next move, which takes some resources.

SL pathfinding just doesn't work very well if you have specific destinations. "Wander" works OK, because if it's doing the the wrong thing, you can't tell. Motion to a goal, not so much. That's why I had to write my own system.

 llNavigateTo(llList2Vector(points, i),[FORCE_DIRECT_PATH, TRUE]);
            moving = TRUE;

It works pretty flawlessly on the sim, my only complaint with it is the pauses ...

Share this post


Link to post
Share on other sites
6 hours ago, Tech Robonaught said:

 llNavigateTo(llList2Vector(points, i),[FORCE_DIRECT_PATH, TRUE]);

Oh, you're running the pathfinding system with pathfinding turned off, with FORCE_DIRECT_PATH. I guess it can't screw up in that mode.

There's a pause because pathfinding tries to slow to a stop before reaching the destination. You can try llPatrolPoints. In open space at slow speed, pathfinding can be useful. Tight spaces or high speed, it gets confused.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...