Construction bot pathing

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
User avatar
DingoPD
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Thu Jun 13, 2013 1:22 am
Contact:

Construction bot pathing

Post by DingoPD »

I like railroads quite a bit, so i tend not to use logistic bots very much, but i usually end up having 10x as many construction bots. I've been running into construction bots getting stuck in a endless loop trying to get across empty expanses of land where there are no roboports. They get so far, run out of power, and slowly creep back to the same roboport where they came from in the first place. At one point I've had around 1100 construction bots stuck in endless loop before i noticed what was happening. It looks like the bots tend to return where they came from, even if there is roboport ahead that is closer than the one they charged at last time.

One possible solution could be to plot the path of the bot only as far as the battery onboard can get it, if the destination is further than the maximum powered flight distance, find a roboport that is closest to the original direction and fly there instead, recharge and figure next leg of the path. If the bot can't find a path, make it hover next to the last roboport out in the open and send warning message to the player to get their attention. So the player can take care of it.

The advantage would be that there wouldn't be long expensive CPU path calculations, and when things change (roboports get destroyed/removed), there wouldn't be long list of paths what have to be recalculated.
The disadvantage would be that it would be possible for the bots to paint themselves in a corner somewhere.

You could potentially cache the shortest/fastest paths between parts of the map, as the bots discover them, and use them as "flight corridors" to further lessen the amount of paths that need to be calculated fresh for every bot.

I've included save of my small base and a screenshot with the path the bots take indicated by a red arrow. the rail rectangle in southeast corner is where the bots tend to loop.

thanks :)
Attachments
Vanilla 0.16.zip
Save game (0.16)
(43.62 MiB) Downloaded 180 times
Screenshot
Screenshot
factorio_bot_path.png (733.13 KiB) Viewed 4813 times
Efficiency is just highly developed form of laziness.

dood
Filter Inserter
Filter Inserter
Posts: 360
Joined: Wed Mar 21, 2018 8:36 am
Contact:

Re: Construction bot pathing

Post by dood »

That's why you keep your logistics networks rectangular and as small as needed.
Image
2 bots and 100 repair packs is all that wall needs for maintenance.

User avatar
DingoPD
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Thu Jun 13, 2013 1:22 am
Contact:

Re: Construction bot pathing

Post by DingoPD »

@dood: so you just build all that by using stuff from your inventory?

I usually just drop the rails, power supply, and laser turrets and let the construction bots from the base build the rest, that way i can move ahead quicker and don't have to come back for supplies as often. I do ride around in personal supply/building train to make things more convenient. If i break up the logistic areas, then i'm stuck waiting for everything in the blueprint to be built. And how do you resupply destroyed bots and repair kits? I guess train could do it, though i don't see resupply stop in your screenshot.

I mean, of course there are workarounds, i could break up the logistic networks, use train and cookie cutter resupply stations to keep them well supplied. That's lot of fun to be had. :)

My thing is that construction bots should be able to reach one side of the base from the other on their own, regardless of the shape of the base or logistic network within. Right now they are getting stuck in endless recharging loops - because they are going where they shouldn't. I thought about it quite a bit - if that should have been reported as a bug, in the end i went with the idea.

Now when i think about it, slightly modified train pathfinding could be used for the bots. the only difference is that rails are constant width and you can't pass 2 trains on single rail in opposite directions, bots don't have those restrictions.
Efficiency is just highly developed form of laziness.

dood
Filter Inserter
Filter Inserter
Posts: 360
Joined: Wed Mar 21, 2018 8:36 am
Contact:

Re: Construction bot pathing

Post by dood »

DingoPD wrote:@dood: so you just build all that by using stuff from your inventory?

I usually just drop the rails, power supply, and laser turrets and let the construction bots from the base build the rest, that way i can move ahead quicker and don't have to come back for supplies as often. I do ride around in personal supply/building train to make things more convenient. If i break up the logistic areas, then i'm stuck waiting for everything in the blueprint to be built. And how do you resupply destroyed bots and repair kits? I guess train could do it, though i don't see resupply stop in your screenshot.
Yeah, personal roboport and buildtrain.
Rails are built quickly enough and so are the wall segments.
If you're going out into the wild, you have to fight through biters moving forward so you can't exactly build faster than you can move anyway and if I need to resupply, I just plop down a station on the rails and call the train that I previously sent back to base to refill.

As for broken turrets, that hasn't happened yet. Only scratch damage.
Bots didn't get targeted too. I like to expand beyond my pollution cloud tho so attacks aren't that big but if your stuff breaks, just stuff 100 construction bot in a roboport and put a chest with 1000 walls and 100 turrets down. Should last until the end of time and if it ever runs out, you'll get a warning.

User avatar
DingoPD
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Thu Jun 13, 2013 1:22 am
Contact:

Re: Construction bot pathing

Post by DingoPD »

I pull around couple of artillery cars on my build train, when i move the train, i stomp out blueprint with extra laser turrets around the train to protect it from the biters that run up when arty wipes out all the biter nests that could mess with me.
Then I go off building the chunk of tracks on foot, when i come back to the train, i deconstruct the extra turrets, move up maybe quarter to half mile, and repeat the process. The further away from the center of the base the longer rails spans i have to build, the more stuff i need, the longer the supply chain, and eventually everything slows down to a crawl. That is why tend to build the minimum and have the base construction bots take care of the rest, once the basic rail and defenses are up, there is not many (if any) biters left to worry about, and if it takes couple of hours to build everything else, no big deal. By then, I'll be miles away building something else.

Honestly i could do away with 80% of my rail paths and laser turrets and still have functioning and defensible factory, but where's the fun in that. :) In the end i try to automatize as much as possible, and have the factory take care of itself.
Efficiency is just highly developed form of laziness.

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Construction bot pathing

Post by Zavian »

The bots aren't supposed to be smart. They are supposed to have simple behaviours the player can figure out. It's up to the player to use them in smart ways. This is consistent with the rest of the game. Factorio gameplay consists of building increasing large and potentially complicated setups from simple components.

The simple and dumb behaviour also makes bots very performant. There is no "long expensive CPU path calculations", and there isn't a "long list of paths what have to be recalculated". The bots simple move towards their destination. If they run low on power they move towards a roboport to recharge.

bobucles
Smart Inserter
Smart Inserter
Posts: 1669
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Construction bot pathing

Post by bobucles »

Code: Select all

Robots experience extreme difficulty when leaving the robot network.
Should this really be a surprise to anyone? If you want a large network, build a full network. Don't build a network full of holes.

McDuff
Fast Inserter
Fast Inserter
Posts: 236
Joined: Sun Jan 11, 2015 11:09 am
Contact:

Re: Construction bot pathing

Post by McDuff »

I'm very against this idea. If anything I think any changes should be for robots to be more limited in distance. They really should not be a long-distance transport solution.

Aeternus
Filter Inserter
Filter Inserter
Posts: 835
Joined: Wed Mar 29, 2017 2:10 am
Contact:

Re: Construction bot pathing

Post by Aeternus »

McDuff wrote:They really should not be a long-distance transport solution.
This. Bots aren't for long distance. Once you transition towards megabase, you will need supply trains. My own base uses something very similar to Dood's screenshot - rectangular zones following the outer wall sections. Each section also has a supply station that provides repair packs, construction bots (inserted into the station's extra roboport if the construction bot count falls below a treshold), extra turrets, extra walls, roboports and some minor misc supplies. All these stations have the same name and are deactivated when they don't need supplies. These stations are also handy when moving up the walls or local deforestation - the construction bots can handle it over time, just plop a few storage chests down at the supply station.

User avatar
dog80
Filter Inserter
Filter Inserter
Posts: 278
Joined: Thu Dec 08, 2016 11:57 pm
Contact:

Re: Construction bot pathing

Post by dog80 »

just build roboports everywhere and dont leave large gaps

LukeM
Inserter
Inserter
Posts: 26
Joined: Sun Mar 20, 2016 8:32 pm
Contact:

Re: Construction bot pathing

Post by LukeM »

tl;dr; You shouldn't be limited by game mechanics you can't control, and robots wouldn't need to be that smart, just smart enough to get them where they want to go, probably removing the problems with processing power required.

I agree that this isn't a very efficient way to do robot networks, but that doesn't mean that it shouldn't be possible... The great thing about Factorio to me is that you can decide how you want to do things, if you want to have a giant robot network you should be able to. It might not be the most efficient way to do things, but you shouldn't be limited by a game mechanic that's out of your control.

Anyway, how hard can it be to get the robots to avoid gaps like this? They wouldn't even need to pathfind most of the time, it could just be a fallback if they wouldn't be able to cross a gap. And even then, a simple algorithm like A* would easily find paths through most networks in a very small number of iterations, and that path could easily be broken into robot range sized steps. You wouldn't need to keep track of these paths for when roboports are removed either because robots could just repath when they get to the missing port.

Selvek
Fast Inserter
Fast Inserter
Posts: 238
Joined: Fri May 06, 2016 4:04 am
Contact:

Re: Construction bot pathing

Post by Selvek »

The weird inconsistency is, what does the roboport "range" actually mean? In my mind, robots should never try to path outside of the roboport allowed area. That gives you the ability to actually affect how the network behaves.

On the subject of "networks", the entire point of a network is that a series of shorter hops are combined to create longer paths. There is no logical reason right now for two disconnected robo networks to behave any differently than one U-shaped robo network, because it's obvious that bots are able and willing to venture into terrain that isn't covered by roboports. If we're going to call it a network, it should behave like one, with bots following lines of connected roboports and avoiding uncovered terrain.

Hedning1390
Fast Inserter
Fast Inserter
Posts: 231
Joined: Fri Jan 05, 2018 8:47 pm
Contact:

Re: Construction bot pathing

Post by Hedning1390 »

Selvek wrote:The weird inconsistency is, what does the roboport "range" actually mean?
There's nothing inconsistent about it. Roboports create a chain for signals to travel wirelessly. For a work order to be created and sent to a worker a demand signal has to meet a supply signal. The workers themselves can leave the range in order to execute the work order. Where's the inconsistency?

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Construction bot pathing

Post by Zavian »

You can already control where bots can path by how you layout your roboports and logistic networks. As I already said, it is up to you as the factory designer to design a layout that works.

The ability to build separate bot networks, (and the reason bots can only path to destinations in the same bot network) is so that an isolated outpost can run without its bots deciding that "Hey there is this job available on the other side of the map, I should go do that next, even though it will take me 5 minutes to get there".

dood
Filter Inserter
Filter Inserter
Posts: 360
Joined: Wed Mar 21, 2018 8:36 am
Contact:

Re: Construction bot pathing

Post by dood »

Selvek wrote:The weird inconsistency is, what does the roboport "range" actually mean? In my mind, robots should never try to path outside of the roboport allowed area. That gives you the ability to actually affect how the network behaves.
They are drones with the simple AI of always taking the shortest route, which they calculate once they depart and if they're low on energy they once again calculate the shortest path to a free roboport in the same netowrk.
Anything more would bog down game performance and this is easy to work with anyway.

Post Reply

Return to “Ideas and Suggestions”