Jump to content

Please improve duplicant pathfinding


Recommended Posts

There are some things on duplicant pathfinding that make them spend unnecessary time while traveling to their destinations. Here are a few examples:

WivohSn.png

A duplicant can jump over single tile gap but if there's a ladder there, it jumps on the ladder and then jumps off.

b76rNc1.png

When the ladder ends one tile lower, the duplicant jumps down that tile, then clibs back up.

R3BMARL.png

When the ladder ends two tiles lower, the duplicant jumps down, then climbs up - this takes considerably longer than just jumping over that gap.

6BCW1gY.pngDeKLd8k.png

Last two are when there is a ledge just two tiles above the bottom of a ladder - instead of taking the ladder, the duplicant uses the ledge, both up and down.

The pathfinding should go the least travel time way, i.e. it should avoid unnecessary maneuvers if there's a faster path.

 

Link to comment
Share on other sites

i had a problem where my dupes ran to a piece of ladder, jumped for no reason and then returned , i had to block off the area so my dupes wouldnt waste time jumping for no reason. I eventually discovered that it was because of a water source below the ladder. So the AI sent  4 dupes to get water but only 1 dupe collected the water the rest simply went to the ladder leading down to the water source and jumped without doing anything.

Link to comment
Share on other sites

I've met some even worse case, here is an example:20170404224704_1.jpg

If I don't build the two marked titles, the duplicant will be trapped on that place, that one will move left then move right because of pathfinding problems. (maybe it's difficult to choose one path?)

So I have to make one path unavailable to fix this problem.

Link to comment
Share on other sites

Optimal pathfinding is not practical in a real-time game, especially when the move speed depends on the local environment and the user can change the environment. All such games need to use heuristics to get approximately-optimal paths, which sometimes aren't even approximately optimal. Otherwise the performance quickly suffers.

 

That said, usually these problems arise with much longer paths. Short paths, like in several of the examples in this thread, should really work properly.

Link to comment
Share on other sites

Its really annoying when it comes to Dupes opening airlocks. Replace a lower tiles with a horizontal airlock and they'll hop down onto the airlock causing it to open followed by the Dupe hoping out.

I even had a weird one with a regular airlock. I was experimenting with having the doors being on top of 2 tiles to rooms with a ladder 1 square away. The Dupes would climb up the ladder, go to the airlock and then go back to the ladder.

Link to comment
Share on other sites

On 2017-04-06 at 0:03 AM, Ciderblock said:

Optimal pathfinding is not practical in a real-time game, especially when the move speed depends on the local environment and the user can change the environment. All such games need to use heuristics to get approximately-optimal paths, which sometimes aren't even approximately optimal. Otherwise the performance quickly suffers.

That shouldn't really be a problem though, you'd only need to recalculate every time your destination changes and when something in your path changes (path blocked, ladder broken etc) Plus, not being able to handle different speeds on different surfaces is one thing, but I can't imagine what kind of pathfinder would be used to get results where a path that's clearly longer than another is preferred (not just in terms of distance, but if the pathfinder works like the above images suggest number of nodes as well) 

Link to comment
Share on other sites

1 hour ago, Cyberboy2000 said:

That shouldn't really be a problem though, you'd only need to recalculate every time your destination changes and when something in your path changes (path blocked, ladder broken etc) Plus, not being able to handle different speeds on different surfaces is one thing, but I can't imagine what kind of pathfinder would be used to get results where a path that's clearly longer than another is preferred (not just in terms of distance, but if the pathfinder works like the above images suggest number of nodes as well) 

Again, it's really hard to do real-time pathfinding when your movement speed is environment-dependent. Hopping off the ladder and then back on it is not optimal, but with a faulty heuristic, it may look good to try to get your move speed up when possible. Altering the heuristic to fix that problem typically creates another one when dealing with more complicated paths.

That said, ONI's pathfinding does indeed need some serious work, but I would say the first issue is not bad path choices but rather infinite indecision issues (where the pathfinder finds two paths that it thinks are equally good and the dupe oscillates back and forth between them). Also, some of the pictures in the OP *really* make no sense, especially the third one.

Link to comment
Share on other sites

12 minutes ago, Ciderblock said:

infinite indecision issues

Yeah that's more severe problem than suboptimal path choices but at cycle 600+ with my colony I only ran into that bug maybe once while my dupes have already wasted tons of time on those suboptimal paths. Especially with athletics skills on levels 70+ where my dupes are lightning fast on ladders or floors it's a pain to watch them "take the stairs" instead.

Link to comment
Share on other sites

"Where the pathfinder finds two paths that it thinks are equally good and the dupe oscillates back and forth between them" I have had tons of seriously aggravating deaths where they will sit there and spin in circles until they suffocate or drown instead of simply going left/right or up/down 1 or 2 tiles. Maybe a limiter on how many times it will calculate the path? It might mess up the responsiveness to change, but considering how often dupes will choose to strand or drown themselves while digging, I don't think the game would suffer.

Link to comment
Share on other sites

On 5/3/2017 at 8:02 PM, n37runn3r said:

I have had tons of seriously aggravating deaths where they will sit there and spin in circles until they suffocate or drown instead of simply going left/right or up/down 1 or 2 tiles

This happens to me a lot too and I really don't understand why. The path will be completely gree and clear but they'll just keep going back and forth till they die, or i notice and manually direct them out

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...