ID:786995
 
Keywords: mobs, stuck
Resolved
Using built-in pathfinding failed for objects that were considered too far away. Using step_to() or walk_to() will now try to simply path nearer to the target (still accounting for nearby obstacles) until it's in range for an ideal solution.
BYOND Version:494
Operating System:Windows XP Home
Web Browser:Firefox 12.0
Applies to:Dream Daemon
Status: Resolved (495)

This issue has been resolved.
Backwards compatibility bug

Descriptive Problem Summary: When playing Omnipotence, mobs (villagers) will sometimes become stuck (Unresponsive) when trying to find a resource (wood, food) not immediately available within view (See below for detailed instructions).

Numbered Steps to Reproduce Problem:
1) Download and "Play by yourself" Omnipotence (Dream seeker required, Using Dream Daemon won't grant you the powers to begin the game).
2) Click Join on the bottom left of the screen.
3) Go to Host Commands > Starting Followers > Set to 20.
3) Host Commands > Starting Food > Set to 1000.
4) Host Commands > Starting Wood > Set to 500.
5) Host Commands > Start Game.
6) You will now spawn on the map, you will most-likely spawn on Water, so it may take a moment to find land. Once you locate land, Head to This location .
7) Once you are located at the position in the screen-shot (This bug occurs everywhere, its just fairly quick and easy to replicate from this spot) Click the button in the upper-most left hand corner of the map.
8) Click the wood icon in the upper-most left hand corner of the map to open the build menu.
9)Click the Lumber Mill icon ( Two buttons down and two buttons to the right in the build menu).
10) Click on an open location on the map. Sample image .
11) Wait for the villagers to become adults and Double Click one villager to select them all (A yellow ring will appear around each one. It takes about 60 seconds for a villager to become an adult).
12) Click the Lumber Mill once it has been constructed (Takes about 40 seconds to construct).
13) You villagers will now begin to chop trees.
14) After about 5-9 minutes, all the trees in the immediate view will be chopped, and the villagers will be "locked up" and become unresponsive (In this case, most of them should be holding logs when "Locked up").
15) To "Free up" villagers, you have to build a building that can command villagers to move, within the view of the villagers (such as the Lumber Mill, among most others).

Expected Results: That villagers are able to gather resources without becoming locked up, or otherwise unresponsive.

Actual Results:Villagers will become unresponsive to both automatic commands, and manual commands when the target is out of view.

Does the problem occur:
Every time? Or how often? Everytime.
In other games? Not as my tests have shown, but possibly.
In other user accounts? Untested.
On other computers? Yes.

When does the problem NOT occur? The problem doesn't occur in previous versions of BYOND (See below).

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.) BYOND 489.1099

Workarounds: Host in 489.1099 or build buildings that will give a movement command in view of the "stuck" villagers.

You should probably post this on the game's hub page rather than here.
Surprisingly I was able to find the problem. Pathfinding changed slightly in 490 to accommodate pixel movement, and the range of pathfinding for simple objects ended up being unintentionally reduced (partly because there has to be an upper limit on the algorithm). I was able to compromise for these cases when the destination is out of range by simply pretending that the goal is a further distance away from the target. In other words, the algorithm will try to find an appropriate path that leads in the direction of the target, but won't actually try to path around obstacles near the target till it gets closer. (This is similar to the DIY approach I took in SotS II, where NPCs will trend toward a destination as far as their memory or sight can take them.) This could lead to some situations where the pathfinding will simply fail to find a path even if one is available via a very circuitous route, but that should pretty much never come up.
Lummox JR resolved issue with message:
Using built-in pathfinding failed for objects that were considered too far away. Using step_to() or walk_to() will now try to simply path nearer to the target (still accounting for nearby obstacles) until it's in range for an ideal solution.
Cool, Thanks for looking into this and finding the culprit. Awesome job!