More Quality Scaling

by sh4dow

Extends quality scaling to locomotives, wagons, storage tanks, rocket silos, roboports and more.

Content
4 days ago
2.0
9.07K
Transportation Logistics Trains Mining Fluids Logistic network Power Storage

i Support for Multiple Unit Train Control?

29 days ago

If using both this mod and Multiple Unit Train Control, it appears that the quality locomotives get replaced by this mod and not MUTC. From my understanding, the ideal situation would be that the combination of the mods would result in the locomotive first getting replaced by this mod, to leverage the quality scaling, and then further replaced by MUTC to tie the locomotives together.

But it appears that the 2nd replacement does not occur. I'm unsure which mod causes this, as from my understanding, MUTC should be compatible with any modded locomotive. The Quality locomotives from this mod should effectively just be a modded locomotive entity that just replaces the regular quality locomotive. So I think the replacement effect from MUTC is somehow getting cancelled or just not happening for some reason.

I made a post on the other mod's page, but have not seen a response so far. I figured I would also post here in case a resolution can be found.

17 days ago

Fixing this from my side would be cumbersome - to set up its entity maps, MUTC uses hidden recipes for each original/mu-clone pair. This requires each "original" to have an item with the same name, otherwise the recipe would be invalid.
While it seems to me to be possible to create all the required recipes and items (and add them to the list inside the hidden technology), I'm not sure if this would cause some side effects with MUTC or other mods.

I wouldn't want to implement this in the MQS mod natively (code bloat, risk of later incompatibilities, ...), though perhaps a "MQS/MUTC compat mod" could attempt to create the compatibility between the mods this way...

The easiest option would probably still be if MUTC a) added a final-fixes script which, if MQS is installed, adds the hidden items/recipes it requires for all the quality variants (requires optional or hidden dependency on MQS to be sure to run afterwards, when the variants actually exist) OR b) changed the replacement logic to be aware of the added quality suffix (I'd be happy to add a mod data entry for that - eg. a map from qualitized variants to the "normal" one, list of used suffixes, maybe even a collaborative suffix priority and decongestion system if necessary).

A variant of option b) would be to generally replace the "hidden technology effects, recipes and items" construct with a MUTC-specific mod data entry, where I could add entries without risk of side effects (or I added my own mod data for MUTC to look at - there are many ways to organize compatibility with mod data entries).

16 days ago

Ahh, I see. I went ahead and added your response to my post on MUTC's page. I still haven't gotten a response there yet, but perhaps with your input, I might.

In the meantime though, maybe we could look into some of the options on this side (or in a compat mod you mentioned)? If you were to add the required recipes and items to satisfy MUTC's current logic, would it still be possible to keep them hidden to the player? Or must they be visible? If they can exist while hidden, then I am not sure I see what side effects this might cause.

15 days ago

I threw together something that might or might not work: https://mods.factorio.com/mod/mqs-compat

One possible side effect I have to worry about is that some future change in MUTC might create a hard incompatibility with the items I would add, and crashing on startup (possibly with an error message that doesn't even mention MUTC) would be worse than just having some missing functionality at the intersection of two mods.
Another possible issue would be other mods adding items with those names (either before or after I do), which could also result in hard to debug crashes - and finally some mods might assume those items belong to the entities with the same name (eg. entity "locomotive-legendary" -> item "locomotive-legendary"), even though all quality entities of MQS are still linked to the original vanilla item ("locomotive") - this could result in script crashes, loss of items, or generally undefined behavior.

Even without these issues, I don't want to include complicated compatibility logic specific to some other mod in MQS to keep the mod maintainable.

12 days ago

Please report back whether everything works as expected, when you get the chance.

10 days ago

Hey, sorry I've been a bit busy recently and so haven't had a chance to play and check it out yet. But I'll definitely let you know how it goes when I do.

20 hours ago
(updated 20 hours ago)

Hey sorry for the much delayed response. I finally got around to trying the mqs-compat mod you created, but it doesn't appear to like being loaded alongside Multiple Unit Train Control.

I can have More Quality Scaling + mqs-compat or More Quality Scaling + Multiple Unit Train Control. But I cannot have More Quality Scaling + mqs-compat + Multiple Unit Train Control.

Get the following error while loading mods:

Failed to load mods: __mqs-compat__/data-final-fixes.lua:24: attempt to index field '?' (a nil value)
stack traceback:
    __mqs-compat__/data-final-fixes.lua:24: in main chunk
20 hours ago

It seems this initial issue was relatively straightforward to fix. It looked like there were some zero-indexed arrays that just need to be changed to a 1. And then towards the bottom, it looked like we were assigning newR rather than just rec inside the loop. That allowed the mods to at least load together.

But it still didn't fully function, as if you tried to start a new game or load an existing save, you would get the following error:

The mod Multiple Unit Train Control (1.0.5) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event MultipleUnitTrainControl::on_init()
__MultipleUnitTrainControl__/control.lua:106: attempt to index field '?' (a nil value)
stack traceback:
    __MultipleUnitTrainControl__/control.lua:106: in function 'InitEntityMaps'
    __MultipleUnitTrainControl__/control.lua:745: in function <__MultipleUnitTrainControl__/control.lua:739>

It looks like MUTC expects a valid entity prototype that is missing?

New response