The Spatials: Galactology

The Spatials: Galactology

Not enough ratings
Hauling Hysteresis - More Efficient Hauling
   
Award
Favorite
Favorited
Unfavorite
Mod
File Size
Posted
372.460 KB
11 Jul, 2020 @ 7:24pm
1 Change Note ( view )

Subscribe to download
Hauling Hysteresis - More Efficient Hauling

Description
Important Information

This mod is only compatible with game version 3.14 and upwards, which is as of 2020-07-11 in the experimental branch on Steam and not yet part of the main game.

Intoduction

"Hey, Cale?"

"Yes, Gwyn?"

"For the last 15 minutes you keep coming in here, putting two canisters of oil on the pallet and leave to get more oil. Why do you do that?"

"Well, when I put the oil there, the control panel says that the pallet needs two more canisters of oil. Probably because you keep taking oil to make soap with while I'm away getting more oil."

"Have you ever considered getting more oil than what the control panel says so the pallet is actually full when you drop it in?"

"No, Gwyn."

"Why not?"

"Because that's not what the monitor says."

Well, let's fix that! Introducing ...

Hauling Hysteresis

This mod aims to improve hauling efficiency by introducing a hysteresis system for hauling tasks, in effect allowing haulers to "overfill" a stockpile, heavily inspired by the "Hauling Hysteresis" mod for RimWorld by Steam User Vendan.
This happens by adding an additional configuration field, "Target Amount", which controls the desired amount of items in a stockpile, while "Max Amount" still controls the maximum amount of items allowed in a stockpile.
By default, "Target Amount" is set to the vanilla "Max Amount" value, while "Max Amount" is now doubled.
When this mod is active, officers carrying items to a stockpile will still attempt to fill a stockpile up to the maximum, but the stockpile will stop asking for more items as soon as the target amount is reached.
This mainly fixes the issue that officers will perpetually top off a stockpile that is currently being drawn from since it wouldn't ever be completely full if a producing offers takes resources from it while another officers is bringing resources to fill it up correctly.

Compatibility info for modders

The global variables this mod introduces are using the hauling_hysteresis_* naming scheme to avoid conflict with other mods.

This mod expands several global functions of the stock system:
- core_station_make_station_pallet
- core_station_pallet_set_resource
- stock_update

This is achieved by saving the global functions locally and overriding the globals with a call to the saved local functions and executing this mod's code after that. If anothe code expands these functions in a similar way, there should be no conflicts. Check the source to see the exact implementation.

This mod also removes the default stocks_control infopanel and replaces it with the hauling_hysteresis_stocks_control infopanel, which includes one additional field to alter the hauling hysteresis target value.

Source Code
The Source Code of this mod is available here[gitlab.com] on GitLab.

Acknowledgements
Thanks to BkBarbee on the Steam Discussions, who's written a helpful modding introduction for this game and given me a few helpful pointers,
and many thanks to Weird and Wry who have created a change to the game to make mods like this possible, only a day after asking for help on how to create a mod like this. You are awesome!
3 Comments
Cheet4h  [author] 12 May, 2021 @ 8:25am 
The reason for the mod only working in 3.14 is that there were some pretty extensive changes to the game's modding features, and without those this mod would've been nearly impossible to create.
It's been a few months since I played the last time, but I don't remember encountering any bugs in that version. At least none that weren't also present in the current public version.

I have a notice about that somewhere in the wall of text above, but as I thought that it wouldn't be long until the update was published, I didn't give it a prominent spot - it's understandable that you probably didn't see it. I'm going to move it to the top so it is more easily noticed.
Cheet4h  [author] 12 May, 2021 @ 8:25am 
Hey mipper,

the mod only works in version 3.14 or later, which is available in the game's "pretest"-branch. At the time of writing the mod the dev wrote that they intended to push that update to public, but it seems that got lost.

To activate to the "pretest" branch of the game, right-click the game's entry in your library, then click on "Properties"*. In the window that pops up select the "Betas"* category, then click on the dropdown menu and select "pretest - Pre-public builds".

*) Might be called differently, I'm using Steam in German and am not 100% sure of the English label
mipper 12 May, 2021 @ 6:53am 
Hi, just testing the mod and it seems to be breaking the palette selection button. When I have the mod enabled I cannot select any items in the palette and the palette stays disabled.