Mining Drones

by Klonan

Adds mining drones and mining depots

Content
11 days ago
0.17 - 2.0
104K
Mining

g How can I remove drones' corpses?

4 months ago

:)

4 months ago

Same question. Thought they would disappear after 15 mins at least, same as player's corpse, but they don't. Are they stuck there forever?

4 months ago

They will lie forever, as a reproach to cruelty :))

3 months ago

okay but... Ive got too many corpses now and they are affecting my ups. down 20 frames.

a month ago

The miners are getting confused and don't know where to go. I remove all miners from the depot, and I get them all back in my inventory, but there are still many miners moving around. Then I delete the depot, and the remaining miners die.

I think this is something that started with Factorio 2. Usually only seems to happen when I add belts and boxes near the mining depot after the miners are placed in the depot. If the miners are only placed after everything near the depots, this usually does not happen. I think the code that decides where the miners go to the ores, and back to the mining depots is broken.

a month ago
(updated a month ago)

Found out how to remove the corpses. In file Mining_Drones_2.0.0\data\entities\mining_drone\mining_drone_entity.lua
Add the following around line 180:

corpse.name = bot_name.."-corpse" -- existing code
-- Add the following line here.
corpse.time_to_live = 6000 -- Milli-seconds I guess. Increase value to make corpses stay around longer. (0=forever)

The default value for this is 0 as derived from character-corpse in the Base mod.
There must be other code which sets the timeout (changes value from 0) elsewhere in the Factorio code for the character-corpse.

Edit: Mining_Drones_Remastered is based on this mod so the same changes probably needs to be done there as well.

a month ago

Found out how to remove the corpses. In file Mining_Drones_2.0.0\data\entities\mining_drone\mining_drone_entity.lua
Add the following around line 180:

corpse.name = bot_name.."-corpse" -- existing code
-- Add the following line here.
corpse.time_to_live = 6000 -- Milli-seconds I guess. Increase value to make corpses stay around longer. (0=forever)

The default value for this is 0 as derived from character-corpse in the Base mod.
There must be other code which sets the timeout (changes value from 0) elsewhere in the Factorio code for the character-corpse.

Edit: Mining_Drones_Remastered is based on this mod so the same changes probably needs to be done there as well.

Wow! super!! thanks

a month ago

This is the answer. Pure magic with a single line of code. Awesome work, jamiech1.

For those looking, do this:

Locate your MODS folder containing the zip file of Mining_Drones_2.0.0 (typically C:\Users\ YOUR USER NAME \AppData\Roaming\Factorio\mods.

Open the zip using most Zip programs, go to data\entities\mining_drone\mining_drone_entity.lua , then open it.

Towards the end of the file, you will see
corpse.name = bot_name.."-corpse"

add this just below it. Making sure the indentation is the same:
corpse.time_to_live = 6000

This adds an expiration for the drone corpses of 6 seconds (the number is based on milliseconds). Adjust as you see fit. Now instead of Factorio tracking each unfortunate deceased drone, they will be eliminated from existence, no longer tracked, and freeing up precious factory compute power. My own experience took me back to 60/60 FPS/UPS when it had slowly been sinking to 30/50.

Server setup note: both the server and the client MUST have the same modified file in place. I experienced issues when I did not properly indent the file, as well as using different Zip programs. I resolved this by just editing on one machine and copying that to the other. Specifically, edited on the server (Debian) and copied to my Windows computers.

I'll be suggesting this on Github for future versions as well. Thanks again!

a month ago

There is already a value for them: corpse.time_to_live = 60 * 60 * 5

New response