[FIXED] NPCWANDER 6 is bugged.

Here we stuff all the bugs we've managed to squash/squish/squelch.
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

NPCWANDER 6 is bugged.

Post by Xuri »

NPCWandermode 6, also known as the "pathfinding" wandermode (see line 1548 in movement.cpp), seems to be bugged.

I've tried using the JS event (which seem to work, couldn't see anything obviously wrong with it at least) walkTo( object, maxsteps) and walkTo( x, y, maxsteps ). If the destination location lies directly to the north, south, east, west, northwest, northeast, southwest or southeast of the NPC doing the walking - the NPC will turn towards it correctly and start walking. It will not, however, stop until it has taken all the steps specified in "maxsteps", or until it walks into another object/wall/whatever, even if it should pass it's destination location on the way.

If the destination isn't a direct "compass-direction", the NPC will turn in the general direction of the target location, and will then keep walking in that direction and not make any "pathfinding" corrections to it's heading. As with the above, it keeps walking until it bumps into another object or until "maxsteps" has been reached.
Last edited by Xuri on Wed Jul 02, 2008 1:15 am, edited 3 times in total.
-= Ho Eyo He Hum =-
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Can't be the pathfinding code which is screwed either, seeing as the standard "NPC Follow" pathfinding for pets/npcs in combat seems to work just fine. Hmz.
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

I have adjusted pathfinding a bit for 0.98-3.2h. NPC's will be a bit more logical in their movements, but note they will still make stupid pathing errors (IE walking inside a building never to find their way out). So pathing around buildings without doors isn't highly advised.
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

This one appears to have been fixed.
-= Ho Eyo He Hum =-
Post Reply