Mod-Bugfix for Mylon's Peppermint Mining
Posted: Thu Mar 16, 2023 3:15 pm
Hey @Mylon, I don't know how to contact you so I just create this forum post and cross link it together with https://mods.factorio.com/mod/Peppermin ... 180a72e82d. One day you'll find one or the other ^^
Here at least I can upload an attachment with the mod fixes.
I have fixed my most pressing issues with the mod:
1) Parallelism through chunks. Instead of one list of coordinates, those are now grouped by chunk. And every peppermint.stretch() now takes one coordinate for every chunk in the same tick. One disadvantage though, chunks don't check neighboring chunks, so you could have a multiple amount of mine() commands on the same logistic network, leaving you with too many ores to pickup for bots. I'll have to look into it and reconsider the loop, but at least you have a state as of now. Maybe I better do one chunk at a time with a separate chunkpicker and lower the ntick of stretch().
2) Cleanup of invalid coordinates. Once the ore is not valid anymore for the coordinate I now correctly remove it (after the already existing rechecking for ore changes). Additional cleanup because of chunks: If there is no valid coordinates anymore in a chunk, the chunk is also removed.
Please do a diff between yours and my control.lua, some places had also small bugs (e.g. the separator you chose was " " space instead of ",")
IMPORTANT
If you use my changes as-is, you need to write a migration, as the format of global.peppermint and global.picker have changed to include the chunk-key.
Feel free to use my changes in any form.
Here at least I can upload an attachment with the mod fixes.
I have fixed my most pressing issues with the mod:
1) Parallelism through chunks. Instead of one list of coordinates, those are now grouped by chunk. And every peppermint.stretch() now takes one coordinate for every chunk in the same tick. One disadvantage though, chunks don't check neighboring chunks, so you could have a multiple amount of mine() commands on the same logistic network, leaving you with too many ores to pickup for bots. I'll have to look into it and reconsider the loop, but at least you have a state as of now. Maybe I better do one chunk at a time with a separate chunkpicker and lower the ntick of stretch().
2) Cleanup of invalid coordinates. Once the ore is not valid anymore for the coordinate I now correctly remove it (after the already existing rechecking for ore changes). Additional cleanup because of chunks: If there is no valid coordinates anymore in a chunk, the chunk is also removed.
Please do a diff between yours and my control.lua, some places had also small bugs (e.g. the separator you chose was " " space instead of ",")
IMPORTANT
If you use my changes as-is, you need to write a migration, as the format of global.peppermint and global.picker have changed to include the chunk-key.
Feel free to use my changes in any form.