Bio Industries


Provides useful buildings and items, like the Bio Farm for growing trees. Solar Farm and Large Accumulator to make your electric setup easier. Bio Fuel section to produce organic plastic and batteries. Lots of New Wood Products, like the big electric pole, wooden pipes, dart turret. Plant trees using seedlings. Change terrain from deserts to grasslands using Fertilizer - helps trees grow better. And a lot more… Please visit the homepage on the forums for more information and feedback.

Content
2 months ago
0.14 - 1.1
47.7K
Manufacturing

b [Fixed?] Error while applying migration 0.18.01

3 years ago

Jumping back into Factorio after a few months, I've updated all my mods and getting this error from Bio Industries when trying to load a save:

Error while applying migration: Bio Industries: Bio_Industries_0.18.01.lua

__Bio_Indistries__/migrations/Bio_Indistries_0.18.01.lua:38: attempt to index field 'tech' (a nil value)
stack traceback:
__Bio_Indistries__/migrations/Bio_Indistries_0.18.01.lua:38: in main chunk

I've tried commenting out lines 38 and 39 to see if the game will load without the technology being disabled, which results in Factorio using all my RAM and crashing.

Thanks for all your hard work btw, this is a great mod!

3 years ago

Quick update, I've done some more digging into the RAM issue when skipping the tech disable in that migration, it appears to be caused by the pairs(global.bi_power_rail_table) loop in the 0.18.24+0.17.55 migration. I suspect this may be because I have about 10,000 power rails placed and the migration is attempting to disconnect a pole for every single one.

Pi-C ☆
3 years ago

I never tried to migrate that many poles, but yes, I can imagine that this would put some load on the game! I'm not quite sure how to deal with this yet. But if you could provide a saved game so I could try in a real-life heavy-load scenario, it probably would help. :-)

Pi-C ☆
3 years ago
(updated 3 years ago)

Jumping back into Factorio after a few months, I've updated all my mods and getting this error from Bio Industries when trying to load a save:

```
Error while applying migration: Bio Industries: Bio_Industries_0.18.01.lua

Bio_Indistries/migrations/Bio_Indistries_0.18.01.lua:38: attempt to index field 'tech' (a nil value)
stack traceback:
Bio_Indistries/migrations/Bio_Indistries_0.18.01.lua:38: in main chunk

I've tried commenting out lines 38 and 39 to see if the game will load without the technology being disabled, which results in Factorio using all my RAM and crashing.

This is a really stupid bug:

    technologies.tech.researched = false
    technologies.tech.reload()

This is looking for a technology named "tech", which doesn't exist because 'tech' is just a variable that extends to a string. Replacing lines 38/39 with the following will fix it:

    technologies[tech].researched = false
    technologies[tech].reload()

'tech' will now be replaced with the name of a real technology. I've fixed that for the next release.

After applying the change, my computer didn't react for a while, didn't accept any keyboard input, and my audio player looped the same 2 second piece forever. However, it returned to a usable state once the migration completed. Could you try if fixing the bug above will let you continue your game -- even if it takes a while?

Pi-C ☆
3 years ago

Last night, I've already fixed the bug in the 0.18.01 migration script. After killing some processes and adding several log() commands to the migration script, I've loaded your saved game (with almost all mods -- except for two that weren't available anymore) again. It only took some seconds until it was done, and I didn't notice any slow-down. According to the log file, there were about 3200 powered rails that had to be migrated. Not sure how you got to about 10,000 powered rails, but there are several powered rails with unpowered wooden rails between them. Even so, you have only about 5700 rails in total. You can check this by entering the following line on the chat console:

/c game.print("Number of rails: " .. tostring(table_size(game.player.surface.find_entities_filtered{type = {"straight-rail", "curved-rail"}})))

BTW: My computer is about 8 years old, with 16GB RAM (total) and a GEForce GTX1050 graphics card (2GB). Currently, Factorio is using 7.7GB residential memory (10.5GB virtual). I guess that could be enough to use up all available memory and result in a crash (especially if other programs are running at the same time).

Pi-C ☆
3 years ago

Should be fixed with version 0.18.29. Can you confirm this?

New response