FactorioScenarioMultiplayerSpawn icon indicating copy to clipboard operation
FactorioScenarioMultiplayerSpawn copied to clipboard

Construction robot self destruction

Open bplein opened this issue 3 years ago • 11 comments

I am seeing construction robots self destruct if they are very busy traveling over long distances.

I have grepped through this code and haven't seen anything specific to robots.

I have a few other mods in place, but none of them mention robots in their code either.

Is there a way to turn on some LUA that would log entity destruction and maybe point to the code line and file that did it?

bplein avatar Jul 08 '21 19:07 bplein

I encountered this also and mentioned it in the Discord server, but didn't look into it too far. I'm currently seeing similar bizarre behavior where long electric poles are getting deleted/destroyed out of the blue. I'm going to turn off regrowth setting (chunk deletion) and see if that fixes the issue image

lewisandrew avatar Jul 20 '21 02:07 lewisandrew

Turning that setting off didn't fix this related issue. I don't have bots traveling very far distances over water much anymore, but I think this maybe the same root cause image

lewisandrew avatar Jul 20 '21 02:07 lewisandrew

I've had construction bots in my personal roboport self destruct too, but I can't swear if they were in or outside my direct "vision", i.e. mass deconstruct of a forest, I run in and run away and next thing you know, bots are dying.

Then again, I've had individual small groups of bots fly across a great map distance to catch up with me if I took a train and forgot to wait for them.

For bots, it only seems to occur if there's a lot of them flying in one area.

bplein avatar Jul 20 '21 17:07 bplein

Yeah this is definitely an odd one... We discussed on discord but I have no idea what I could be doing in my scenario. This might be worth reporting on the official factorio forum for help. This might be something obscure where my chunk deletion caused robot pathing to fail and subsequently to self destruct or some weird unknown side effect like that... I don't have time to look into this myself and haven't been touching the scenario or the game for quite awhile now, please let me know if you find something that I can do to help fix this.

Oarcinae avatar Jul 22 '21 00:07 Oarcinae

I've reported it there and basically they want me to test removing every mod one at a time.

I actually find it sort of cool.

Tired bots trudge on. But if you overexcite a bunch of them to the point of exhaustion, they expire and die.

Sort of like working animals and humans.

Not a big deal actually. But if you had some way to log items destroyed by your map reclamation or some other hints at LUA I could add to log things, id be happy to try it.

Cheers.

bplein avatar Jul 22 '21 03:07 bplein

I commented out all the regrowth related code being called outside of the regrowth_map.lua. Couple hours of playing and I haven't seen the issue again yet. Will update again in the future if I see it happen

lewisandrew avatar Jul 23 '21 04:07 lewisandrew

Any update on this ? I'm working on a mod that removes the player - merging "Brave New World" with Oarc. This means you MUST use bots, you start with 100 construction, and 50 logistic. Since power is the first thing to get the bots need to work pretty hard at the start, and it is likely you will run out of power. I've had 88 of the starting 100 construction bots self destruct going on low power to remove trees on the perimeter. The base is increased from normal 32 CHUNK_SIZE to 48. This will be the thing that keeps me from proceeding with this Factorio bots dieing .

vfinn avatar Jan 24 '22 03:01 vfinn

I noticed this in config: -- Cleans up unused chunks periodically. Helps keep map size down. ENABLE_REGROWTH = true

I'll set this to false and see what happens... I played for four hours on Brave New Oarc, all bots remain. I may selectively destroy chunks. Possibly clean up manually after people log off, to speed up the map.

I also found a race condition where chunks were not deleted, on next tick, since the tick was set, next tick occurred that would have triggered destruction of a tagged area, but it didn't until I added +1 to the current tick, tagging it in the next loop to perform the clean up. I test this by resetting a player. I can post specifics to this, once I get on the other PC.

vfinn avatar Jan 24 '22 03:01 vfinn

A fix for this was submitted today into vfinn/FactorioScenarioMultiplayerSpawn branch. If anyone would like to test merge: oarc_utils.lua and regrowth_map.lua into your game save or mod for a new game. Run the bots across a large span away from main base to build - say a long wall, or defenses. When the bots run out of energy they should just slow to 20% speed. If a regrowth occurred while they are travelling long distance they would previously explode in groups. This fix keeps them from exploding.

JustGoFly

vfinn avatar Jan 09 '23 17:01 vfinn

A fix for this was submitted today into vfinn/FactorioScenarioMultiplayerSpawn branch. If anyone would like to test merge: oarc_utils.lua and regrowth_map.lua into your game save or mod for a new game. Run the bots across a large span away from main base to build - say a long wall, or defenses. When the bots run out of energy they should just slow to 20% speed. If a regrowth occurred while they are travelling long distance they would previously explode in groups. This fix keeps them from exploding.

JustGoFly

If you've confirmed this fixes it you should probably make a pull request so @Oarcinae sees it. Would be awesome to see this old bug finally squashed.

William0216 avatar Mar 18 '24 22:03 William0216

Oarcinae did merge this into FactorioScenarioMultiplayerSpawn last year

Oarc code

JustGoFly

vfinn avatar Mar 20 '24 03:03 vfinn

Going to close this since it seems to have been fixed :) Thanks JustGoFly!

Oarcinae avatar Aug 07 '24 19:08 Oarcinae