[Mod 1.1] Inventory Trim

Topics and discussion about specific mods
Post Reply
stagdancer
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Jan 31, 2021 3:07 pm
Contact:

[Mod 1.1] Inventory Trim

Post by stagdancer »

New mod: Inventory Trim

I've just been working on this mod to improve Quality of Life. From the README:

This mod enables inventory trimming: your main inventory is scanned periodically to see if there are slots that are being used inefficiently, and throws their contents into the logistics trash. Hurrah, no more clicky-clicky to get rid of the rubbish!
Inefficient inventory slots.png
Inefficient inventory slots.png (36.83 KiB) Viewed 608 times

I keep finding, from around mid-game, that my inventory is always sort of full, and that many slots are occupied with low value items. I can set logistics maximums to get rid of things, but they feel like a heavy-handed and broad-brush solution. I don't mind having 50 Inserters (1 stack) or 100 (2 stacks) but I do mind having 53 - also 2 stacks - and then finding I'm out of space. This mod aims to fix that, whilst being more sensitive to circumstances.

Trimming is only meaningful in a world where you have logistics and auto-trash, so it is assumed that you are at a point in the game where carrying small items of stuff isn't so critical. Much of your inventory content is likely to be under automated configuration anyway. The aim of trimming should be to deal with the annoyance of never having much space and having to prune the junk.


I'm interested in feedback. There's a bit of balancing involved: remove not-enough junk and it's a bit pointless; remove too much and you start to fight it. I've made it get more assertive when your inventory is more full, and added some settings to give some configurability. There are more details on the workings on the GitHub source page.

stagdancer
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Jan 31, 2021 3:07 pm
Contact:

Re: [Mod 1.1] Inventory Trim

Post by stagdancer »

And ... I just played through a proper game with it, and it a) didn't irritate me, and b) seemed to do a good job. :-) I think the balance is about right?

Qon
Smart Inserter
Smart Inserter
Posts: 2120
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [Mod 1.1] Inventory Trim

Post by Qon »

I made HandyHands - Automatic. My mod does the opposite, it fills your inventory from requests. I was considering if I should make a mod that automatically throws stuff from your inventory into nearby chest and assemblers if you have too much stuff. Kind of like pre-bot personal logistics for trash. It would pick things up as well. Well, it has similarities to your mod, but it would automate the execution of the request/trash orders while your mod automates the configuration. Maybe I should make it?

Anyways, my question about your mod is how do you determine what is junk? How often does it go through the inventory? Are there cooldowns for items that change in quantity so that it doesn't throw stuff you are actively using or crafting? Does it modify logistics request settings? Does it alter the configured min/max numbers of already set requested/auto trashed items?

stagdancer
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Jan 31, 2021 3:07 pm
Contact:

Re: [Mod 1.1] Inventory Trim

Post by stagdancer »

Qon wrote:
Tue Jan 02, 2024 6:38 pm
I made HandyHands - Automatic. My mod does the opposite, it fills your inventory from requests. I was considering if I should make a mod that automatically throws stuff from your inventory into nearby chest and assemblers if you have too much stuff. Kind of like pre-bot personal logistics for trash. It would pick things up as well. Well, it has similarities to your mod, but it would automate the execution of the request/trash orders while your mod automates the configuration. Maybe I should make it?

Anyways, my question about your mod is how do you determine what is junk? How often does it go through the inventory? Are there cooldowns for items that change in quantity so that it doesn't throw stuff you are actively using or crafting? Does it modify logistics request settings? Does it alter the configured min/max numbers of already set requested/auto trashed items?
Ok, interesting! I wondered if I could do a pre-logistics thing with chests, but I thought I'd get this going first and then take a view. I'm playing some games from scratch at the mo' to see what works and what I wish I had :)

And, determining junk: to start with, take a look at the Github page, I sort of wrote up how Trim works: https://github.com/susanw1/Factorio-Inventory-Trim

In short, on a per-item basis, it checks each slot and assigns an eligibility score ("importance", where unimportant stacks may be trimmed) to create a candidate list. Then it sorts the list in ascending order of importance, and starts trimming in that order up to a threshold. The fewer slots you have free, the higher the threshold, so it becomes more willing to do desperate things when space pressure is high. And it rescans every 10s (configurable).

It doesn't change your logistics request settings at all, but it does look at your minimums to make sure it doesn't go too low.

The importance score is based on my vague intuition about things I want... obviously more-full stacks are better than less-full, but also I like to keep red/green wire but not copper wire, I'd prefer iron plate to iron ore, etc. One advantage of being post-bots is that you've probably got enough stuff generally that the odd mistake isn't a tragedy, construction bots are doing the heavy lifting, and if you had strong feelings on what you carry, you could impose your will with the request settings.

It doesn't have a cool-down mechanism yet. I thought about it, like, having a min period after an item's count-change stabilized to become eligible... but figured I'd play with it first and see if it was required. Thinking about it, I bet manually crafting a nuclear reactor or mk2 armor will be a pain - I normally make them by collecting the ingredients in an assembler, but I forgot to try it manually. I feel an experiment coming on!

Post Reply

Return to “Mods”