Page 1 of 1

Spidertron repath if stuck

Posted: Thu Sep 03, 2020 1:20 am
by NotRexButCaesar
Spidertrons can easily get stuck on water. If they repathed after failing to move where they want(reaching the edge of impassable terrain) they could reapath to their destination(hopefully taking into account the spidertrons gap breaching ability) preventing them getting stuck. This behavior could be implemented for occupied spiders only if UPS concerns are an issue

Re: Spidertron repath if stuck

Posted: Thu Sep 03, 2020 6:36 am
by Nosferatu
AmericanPatriot wrote:
Thu Sep 03, 2020 1:20 am
(hopefully taking into account the spidertrons gap breaching ability)
I guess that's the part that is the most work for the devs.
Personally I would not mind if spidertron first trys to go the direct route and if it gets stuck it paths like a normal land unit would do.

Re: Spidertron repath if stuck

Posted: Thu Sep 03, 2020 8:33 am
by Qon
It's actually really simple to make a simple "better then only straight line walking" algorithm that can walk around water with 0 planning calculations, only taking the local environment in account. It might actually improve performance because spiders that are stuck on water trying to reach with their legs for something are actually really bad for UPS, while spiders walking on flat terrain are better (in my experience testing 100+ spiders at once, Broodmother mod dev).

It's almost very fittingly called the bug path finding algorithm or bug obstacle avoidance algorithm. https://aishack.in/tutorials/obstacle-a ... algorithm/
Image

You just choose a direction (maybe always left, maybe depending on which direction is the least change from the direction to the goal) and walk around the body of water until you get an unobstructed path towards the goal again. All checked locally, which the spider must already do to find places to put down its feet.

Could be implemented as a somewhat simple mod with almost minimal UPS impact. Wouldn't be as effiecient as if it was integrated in the game itself, but still pretty good and also less UPS impact than biter path planning like some mods fit onto their automatic vehicles. It wouldn't give the shortest paths, and it might not even guarantee that it finds the goal eventually even when there is a path (was a while since I read about it), and it would probably walk in circles forever (following the shore) if you tell it to go to a far off island and no land bridge is ever built. But it could be much better than what we have.

Edit: the link and image isn't quite the algorithm I was thinking about while writing the post. It's an alternative that might give stronger guarantees but requires the spider to walk about 1 and a half lap around the body of water it encounters. Reading through it now.

Edit:
Another bug obstacle avoidance algorithm closer to what I described.
Image

Edit:
Bug-0, Bug-1 and Bug-2 described here with video examples.
Bug-0 and Bug-2 both seem reasonable.

Spidertron path finding (RC)

Posted: Sun Sep 06, 2020 3:57 pm
by TheRaph
short and easy

Currently the remote controlled spidertron has no pathfinding (as devs say). So it may stuck at big lakes.

I suggest to add kind of pathfinding to remote controlled spidertron.

Backgrounds and screenshots could find on "not-a-bug"-bug here.

Re: Spidertron path finding (RC)

Posted: Fri Oct 02, 2020 9:11 am
by Vykromod
Seriously, this is such an essential thing, I can't imagine the reasoning behind the decision to not make the Spidertron pathfind around the lakes. Having it get stuck on every body of water it comes across, it makes the remote quite useless. You've got no choice but to babysit it along the way, but then what's the point if you can just get in and drive it yourself.

Re: Spidertron repath if stuck

Posted: Fri Oct 02, 2020 10:17 am
by Koub
[Koub] Merged into older thread requesting better spidertron pathfinding.

Re: Spidertron path finding (RC)

Posted: Fri Oct 02, 2020 11:29 am
by Qon
Vykromod wrote:
Fri Oct 02, 2020 9:11 am
Seriously, this is such an essential thing, I can't imagine the reasoning behind the decision to not make the Spidertron pathfind around the lakes.
I can. Pathfinding is expensive. Since the spidertron almost doesn't collide with things it can "fly" almost anywhere and doesn't really need pathfinding for the most part, so it can be as UPS efficient as flying robots.
Vykromod wrote:
Fri Oct 02, 2020 9:11 am
Having it get stuck on every body of water it comes across, it makes the remote quite useless. You've got no choice but to babysit it along the way, but then what's the point if you can just get in and drive it yourself.
Or you can landfill lakes. You don't have to fill lakes completely, just enough that spidertron can walk over it. Something like 12 tiles space max.
And then there's mods. They probably didn't have time to make waypointing and all the other cool features that are missing but are now implemented as mods.

Re: Spidertron repath if stuck

Posted: Sat Nov 28, 2020 1:08 am
by Impatient
+1

Repeatedly I wonder 'Where is that 'tron I called back to main base earlier?' Just to find it stuck somewhere on water. Of course, once I know, that the path to a certain destination has water in the way, I set move orders accordingly. But there are unlimited possibilities for a "first time" on a map in factorio. So this problem does not really go away by learning that one route is risky. :lol: It only goes away when planing the whole route from start to finish.