Page 1 of 1

NPC Pathfinding problem during combat

Posted: Sat Apr 08, 2006 3:24 am
by Xuri
The image probably speaks for itself =) They're all standing in a line, all attempting to take the same path to reach me. (Another bug is perhaps the health bar, which all of a sudden started showing up like that when I logged in)
pathfindbug.JPG
pathfindbug.JPG (28.82 KiB) Viewed 8266 times

Posted: Sat Apr 08, 2006 3:42 am
by giwo
Taking moving objects into account with pathfinding is, well, difficult, to say the least.

Currently we just have the NPC clear its path if a character blocks its path.

Posted: Sat Apr 08, 2006 3:46 am
by Xuri
Well - none of the objects in the scene the image was taken from were actually moving ;)

Posted: Sat Apr 08, 2006 10:06 am
by Grimson
Maybe give the A* Pathfinding a try. As for getting stuck against a moving object, eighter allow NPCs to shove or detect when it get's stuck and force a recalculation of the path.

Posted: Sun Apr 09, 2006 2:06 am
by giwo
NPC's are considered moving objects, even when stationary. :)


Much like vehicles.

Posted: Sun Jan 18, 2009 10:10 pm
by Xuri
Verified in 0.98-4.0. Happens no matter if ADVANCEDPATHFINDING is set to 1 or 0 in the INI.

Re: NPC Pathfinding problem during combat

Posted: Thu Oct 25, 2012 7:11 am
by Xuri
This is fixed for AdvancedPathfinding, but not for regular pathfinding.

Re: NPC Pathfinding problem during combat

Posted: Sun Nov 08, 2020 7:25 am
by Xuri
There's a fix for this in housing_revamp branch, where the NPCs will randomize their movement direction a bit if blocked by other characters when using non-advanced pathfinding mode.

Re: NPC Pathfinding problem during combat

Posted: Sun Nov 08, 2020 6:51 pm
by Mindless Automaton
Xuri wrote: Sun Nov 08, 2020 7:25 am There's a fix for this in housing_revamp branch, where the NPCs will randomize their movement direction a bit if blocked by other characters when using non-advanced pathfinding mode.
This is related to combat but is there an way to apply it to WalkTo? (or maybe it already does)

For example in the fisherman.js npc schedule, if another npc stands in the path, the fisherman just stops since he is blocked.

I was going to mess around with checking time vs coordinates in my script and through in a sidestep or something if he was not making it to the next location on time.

Re: NPC Pathfinding problem during combat

Posted: Sun Nov 08, 2020 7:38 pm
by Xuri
I will play around with WalkTo/RunTo when I get a chance, and see if there's anything I can do to improve that situation. Post it as a feature request so it's not forgotten? :)