Inventory Size Research


Adds research to increase the player's inventory size

Utilities
5 years ago
0.16
11

i Customizable increase?

5 years ago

Very nice mod! Will download and use NOW! I think you should give the option to decide how much increase (like from 1 to 10 slot if possible, i am not sure if it's possible to add less than one line at a time). 10 x each upgrade with infinite research available seems a little too much to me.

5 years ago

I looked into to doing this. It is trickier than you’d think, and certainly more than I’d like. The mod, as-written, is extraordinarily simple, but adding the ability to tweak the size bonus means adding a startup setting. No big deal, right? Well, not at first… until you start to consider what it should do when you change the setting on an existing map. Presumably, it should recalculate each player’s inventory size bonus based on the new threshold, but the problem is that some other mod might also add inventory size bonuses, so this mod can’t just erase the bonus and reset it by recalculating from scratch. That means the mod needs to keep track of some state to “remember” how big of a bonus each player has received, then revert that and reapply the bonus when the save is reloaded, except that this can get out of sync if a mod unresearches the research (like, for example, pressing Reset Technologies in the Creative Mode mod UI) because there is no event that is triggered when research is undone, only when it is done.

I don’t think it’s possible to handle every case perfectly given what the Factorio mod API provides (at least not in a reasonable/performant way), but I do think it’s possible to get something that’s probably good enough. But it is more subtle than I initially anticipated. I’ll see if I can find the time to do it soonish, but I don’t make any guarantees.

New response