Reverse Factory

by Kryzeth

Reverse Factory machine will recycle (uncraft) nearly any item placed inside. Supports the recycling of most, if not all, modded items. Fully featured integration with Bobs Mods, Industrial Revolution, and Fantario (independently, not simultaneously)

Content
27 days ago
0.13 - 1.1
56.3K
Manufacturing

b [Unfixable?] circular dependency when used with bio-industires and transportation drones

1 year, 5 months ago

Hi,

Unfortunately this mod causes issues when used with bio-industries and transport drones. The save this is happening on also is using krastorio and space exploration.

The issue reported is a circular dependency for bio industries. Curious how this would happen only when all three mods are enabled.

The mod manager ends up requiring the disabling of:
- bio-industries
- space-exploration (post-process)
- transportation drones
- recycle anything

Workaround so far:
- Remove Bio Industries (rather not)
- Remove Reverse Factory (easiest least destructive)
- Remove transport drones (rather not)

Is this an issue with reverse factory or bio industries? I see reverse factory listing bio-industries as optional. Curious if this causes the loop.
Thoughts?

Submitted a similar bug here: https://mods.factorio.com/mod/Bio_Industries/discussion/636ebba5d96ea78a41e43a2e

1 year, 5 months ago
(updated 1 year, 5 months ago)

Hmm.. this looks like there are a lot of moving parts here.. Krastorio 2, SpaceExploration, BioIndustries, and Revese Factory each have a loong list of dependencies that are needed to make sure the right things are copied, modified, etc when they need to be. After loading up a minimal modlist with each of these mods, and their required dependencies, I looked into each of their optional dependencies, and yeah, there's pretty clear issue there.

The circular dependency just means that one mod lists another mod as required, which lists a third mod as required, which lists the first mod as required, and thus the game can't figure out which mod to load "first", since they all depend on another being loaded beforehand. This is exactly what's happening here, far as I can tell:

As you say, Reverse Factory has an optional dependency to Bio Industries; Bio Industries has an optional dependency to Krastorio2; Krastorio2 has an optional dependency to Space Exploration (main); Space Exploration (main) has a required dependency to Space Exploration (post-process); and Space Exploration (post-process) has an optional dependency to Reverse Factory.

In other words: RF > BI > K2 > SpaceEx > SpaceEx (post-process) > RF

As to what can be done to fix this... well, each of those mods thinks that another mod should load in first, to ensure that their own changes are performed afterwards. No way to tell which, if any of these dependencies are actually required. I remember an issue similar to this, that required SpaceEx (post-process) to list Reverse Factory as a dependency, but I completely don't remember what the specific issue was, or if it still applies.

On the other hand, what I could personally change, is removing Bio Industries as an optional dependency to Reverse Factory, which may fix your issue, but might also cause issues for other people, related to why I made the dependency in the first place. I can imagine that there were issue with Bio loading in after my mod, that prevented it from being recycled (that's the usual reason why this mod has ANY dependencies)

As for what Bio Industries could change; same thing, they could remove their optional dependency to Krastorio 2, but I have no idea why they need that dependency in the first place, or if they still need it now.

So yeah.. all that is to say; the issue cannot be easily resolved. I would say to look into the other Recycling Machines mod by DRY411S, which doesn't work quite as fluidly as mine (it's an assembling machine, so you have to pick each recipe, and manually change it to recycle something else), but might not cause this dependency loop. Otherwise, I suppose that, as you say, you'll have to forego using Reverse Factory, as the least disruptive change to your modlist.

1 year, 5 months ago

Okay, quick follow-up, but looking through the Bio Industries changelog, it seems that BI makes a lot of changes, depending on whether or not Krastorio 2 is loaded up, which appears to be the reason for the optional dependency.

I've already mentioned my reasoning; need to make sure that BI loads first, so that Reverse Factory is able to create the reverse recipes properly. This leaves the other two mods to attempt to resolve the issues.. which is unlikely, considering that both are much larger than either this mod or Bio Industries. And it seems that they have their own reasoning for the dependencies (Kras2 seems to make a lot of changes based on SpaceExploration; and I guess SpaceExploration Post-Processing must have some need to run after even my own Reverse Factory mod)

So unfortunately, there appears to be even less possibility of directly resolving this issue. Although... I have an upcoming mod in the works which may solve your issue, with some slight modification. It's a Space-Exploration (post-process) focused mod that would enable my Reverse Factory recipes to run after even the post-process mod. Then, you could remove this mod's requirement to Bio Industries, since its load position wouldn't matter anymore, as my other mod would still be able to run after everything else is done.

Of course, this would only fix your specific instance of the issue, since I can't remove the BI dependency for everyone.

New response