RimWorld
587 valoraciones
Storage Refill Hysteresis
16
12
2
7
2
2
3
3
   
Premio
Favoritos
Favorito
Quitar
Mod, 1.5, 1.6
Tamaño
Publicado el
Actualizado el
551.468 KB
22 JUN 2024 a las 9:00 p. m.
15 JUL a las 1:26 p. m.
10 notas sobre cambios ( ver )

Suscríbete para descargar
Storage Refill Hysteresis

En 1 colección creada por pureMJ
Common Sense +
5 artículos
Descripción
Storage now has Smart Refill (hysteresis) function.
Refill if below configurable level. Stop if above another configurable level.

It avoids "single meal hauling" and maintains the balanced storage, making hauling adaptive.

Supports Stockpile Zones, Shelf, Fridges and all other storage buildings, as well as linked Storage groups.
Supports nutrient paste dispenser hoppers!

Has both automatic controlling and a manual toggle button (flickable control).



Background
In Rimworld we have storage units, such as a stockpile zone, shelf, fridges (from mods) and etc. Colonists will haul stuff into them automatically.

One common strategy most veteran players use: have some high priority shelf or fridge (or smaller stock pile zones), placed near dining table/crafting table/kitchen, so colonist can quickly grab what they need, rather than walking a long way into the messy general storage area for a single piece of material/meal.

This is a very good strategy, until another colonist walks across the map, into the messy general storage area, then walks a long way to the shelf next to the dining table, just to delivery a single meal.

Yes, this is beyond stupidity and I can't bear to see it happen all the time in my game play.

This Mod Adds
Hysteresis, a mysterious word that comes to rescue!

TL;DR: Install this mod and turn on the "Smart Refill" function on the storage of your choice, problem solved.

Details
We set a target range of storage usages.
Colonist consumes the material/items on the shelf gradually, and it will eventuall become relatively empty (the usage is below the target min usage), at which point the hauler can come to haul a whole stack (and in case you use Pickup and Haul, tens of stacks) and deliver all at once.
The refill will make the shelf almost full (the usage reaches the target max usage), then refill is paused (turned off).
Then again, next time when the shelf is below the target min usage, the refill is unpaused (turned on again).
... prepeat...

This process is called hysteresis. It is the same mechanism as the "do until" bill option with "pause until" checked.
We call the [min, max) target range the [b]hysteresis[/b] range.

Common Usage Cases
Different settings of the Smart Refill function will allow the storage to work on different logical "Mode".
Below are some examples.

6-9 Smart Refill Mode
A typical hysteresis range of [60%, 95%). (This is the default of the "default range" mod setting)
In this mode your storage will be filled up to 95%-ish, then refill after it's used up to below 60%.
This is the sweet point for small storages such as fridge (or linked fridges) near dining table. No more single meal delivery.

One Fill Mode
Hysteresis range of [0%, x%).
This storage will be filled to x% once and then stop, until you manually click the toggle button to tell it to refill again.

No Hysteresis Mode
Hysteresis range of [x%, x%).
This storage will refill if it's below x% but immediately stop when it's above.
This mode will be similar to how SatisfiedStorage works except this mod counts all cells of a storage and supports linked storages.

Monitor Mode
Hysteresis range of [100%, 100%).
Even if you do not want the Smart Refill function, it is still beneficial to turn it on.
At this mode the storage functions as if this mod does not exist, except your large storages will no long tank your performance when it's full.
And you get to have a nice monitor UI of how much your storage is filled up.

More smart ways to use this mod are waiting for you to explore.

Performance
This mod has no observable negative impact on performance. It is tested in late game scenarios with tens of thousands of storage cells.

In fact, thanks to the usage of cache this mod improves performance, by telling the game that "this big, almost full storage is paused for refill", so that vanilla game does not need to check every cell each time a haul job is made.

Compatibility
Compatible with Deep Storage, Pickup and Haul, While You Are Nearby, Rim Fridge etc.
Also compatible with Adaptive Storage Framework, RimKeeper - Storage & Filters Helper etc.


F.A.Q
Does this mod affect performance?
No. It actually improves performance, see explanation in the Performance section.

Is this mod safe to add/remove mid save?
Yes.

Why does my colonist refill my storage beyond the set upper limit?
That's normal. There is a overshoot effect which is intentional.

Detailed Explanation:
The upper limit serves two goals:
  1. When the usage is below it, if it was refilling, the refill won't stop.
  2. When usage reaches it, the refill will turn off automatically.

Note that the first goals is strict. It will never turn off refill automatically if the usage is below the upper limit.
However, the second goal is not strict. The moment when the usage hit the upper limit, it takes up to about a second (can be configured in the mod settings) for the storage to stop the refill. This is for game performance.
Also, for colonist work efficiency, this mod does not hard stop any colonist who is already on the way to delivery things to the storage. So they will finish whatever they are already hauling into the storage before the refill stop. (If you think about it, there is no point to hard stop at the upper limit, because that only wastes storage space and waste some of the ongoing work efforts)


Updates
v0.2.0 Now supports 1.6.
v0.1.6 Fixed a minor bug that shelves in blueprint could not be linked.
v0.1.5 Fixed a minor bug that mod settings would only appear in dev mode.
v0.1.4 Emergent bug fix: game cannot load.
v0.1.3 Fixed a minor bug that hoppers were ignoring smart refill settings.
v0.1.2 Improved UI logic so it's now compatible with more mods.
v0.1.1 Fixed a minor bug that when this mod is added mid save, old storages couldn't gain hysteresis function.
v0.1.0 First version.

Credits & Links
Many thanks to the members of the #mod-development channel on the Rimworld Discord server!

If you enjoy this mod, please check out my other Rimworld mods on Steam Workshop!
Discusiones populares Ver todo (1)
0
26 JUN 2024 a las 8:45 a. m.
Bug Report
pureMJ
235 comentarios
IEatTakoyaki 26 JUL a las 3:23 a. m. 
Is there an opposite mod for this? Like having storage next to butchers table for the leathers but i want a pawn to empty it if it gets too full
335369678 25 JUL a las 6:52 a. m. 
貌似只有总量的控制,能不能实现每种物品的数量控制:steamthumbsup:
DawnsGlow 25 JUL a las 1:38 a. m. 
The settings resets sometimes on gravship launch. Especially hoppers.
海胆今天吃dm53 23 JUL a las 4:42 a. m. 
在飞船上似乎起飞降落之后会自动关闭(
HUSboboKY 22 JUL a las 4:44 a. m. 
非常好用,萌新爱了,感谢:steamhappy:大佬
Han 20 JUL a las 6:16 a. m. 
您就是缘神!
irilis 19 JUL a las 9:13 a. m. 
Is there a way to actually enforce the upper limit? When I want only a small cache of something near some workstation, with 1%-2% smart refill mode. I don't want my pawns to carry a full stack there (especially with Stack XXL active)!
愛麗速子身上喘 19 JUL a las 2:45 a. m. 
感謝大佬
Windecho 16 JUL a las 3:49 a. m. 
Hero
johndoe123456 15 JUL a las 2:16 p. m. 
Bless 🙏