RimWorld

RimWorld

25 ratings
Stack By Weight
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.6
File Size
Posted
Updated
1.033 MB
11 Aug @ 4:56am
10 Sep @ 7:12am
5 Change Notes ( view )

Subscribe to download
Stack By Weight

Description
Stack By Weight - Define Your Stockpiles by Mass!

Ever wondered why a single tile can hold 75 chunks of heavy steel, yet also only 500 flakes of light gold?

Now, reshape your stockpiles with a unified standard of weight! This mod overhauls the vanilla stacking mechanics, replacing the rigid, fixed stack sizes with a more realistic and powerful system based on total weight.

Core Features
  • Stack by Mass: All item stack limits are calculated once at game startup, using the formula: "Max Weight per Tile / Item's Base Mass".

  • Fully Customizable: In the mod settings, freely define the "Max Weight per Tile" for your colony using a slider or a precise input field (default: 1000kg).

  • Smart UI: The settings menu provides a dynamic preview, showing you in real-time how many of a common resource you can stack with your current settings.

  • Override Rules:
    • Set custom stack limits for specific items to override the global weight rule.
    • Supports wildcard `*` matching (powered by regular expressions), allowing you to manage multiple items with a single rule like `*component*`!

  • Convenient List Management:
    • Adjust rule priority with intuitive drag-and-drop.
    • A one-click "Remove All" button with a confirmation dialog to prevent accidents.

Lightweight & Compatible
  • Zero Performance Impact: One-time calculation at startup with no running scripts, resulting in zero impact on game performance (TPS).

  • High Compatibility: No Harmony patches are used, which maximizes compatibility and reduces potential conflicts.

  • Standard Load Order: Follows standard load order behavior, playing nicely with other stacking mods (the last one loaded takes precedence).

How to Report Bugs
Please report any bugs in the "Discussions" tab. Be sure to include the following:
1. A link to your HugsLib log. 2. Detailed steps to reproduce the bug. 3. A list of any other relevant mods, if applicable.
A log is essential, otherwise I have no psychic powers to fix the bug.

Developer's Note
This mod was made with me providing the feature requests and testing feedback, while collaborating with Gemini on the programming. Therefore, finding any bugs is completely normal.

The current logic is not yet perfect, but using the "Lightweight Balancer" and "Custom Rules" should be sufficient for now. The next update is planned for October. Adjusting the UI takes too much time.

Update Log
07/09/25 - v3.2.8:
  • Added a "Lightweight Balancer" that can change the stack limit for an entire category of items. The calculation logic is: Stack limit of the selected item category / Weight calculation multiplier. The smart preset logic selects items with a weight below 0.25kg.
  • Optimized "Custom Rules" by adding a category option. The list within it references the category list in the game's storage zones.
  • Optimized UI.

13/08/25 - v1.7.2:
  • Fixed a sorting issue with the override rules.
  • Refactored code to optimize performance and logic.

12/08/25 - v1.6.2:
  • Added override rules to allow items to be divided into smaller stacks.
17 Comments
LS_Naix 7 Sep @ 2:53pm 
好好好:steamhappy::steamhappy:
Ta  [author] 7 Sep @ 8:17am 
@LS_Naix 已经添加这个功能了
Ta  [author] 1 Sep @ 8:15am 
@LS_Naix 下个更新添加这个功能,不过最近在忙别的,尽量在十月前搞出来吧
LS_Naix 31 Aug @ 1:39am 
@Ta 没法按照分类匹配吗?MOD金属的很多材料都没有重复的字...
Ta  [author] 30 Aug @ 9:36pm 
@LS_Naix 其实是有通配符的,输入*肉*,就可以一键将名字内含肉的物品的堆叠上限修改
LS_Naix 30 Aug @ 3:32pm 
自定义规则可否一个增加按照物品分类的通配符?金属这类高重量的一格堆不了多少,但是皮肉这种低重量的又堆太多了
Snuggl 17 Aug @ 7:35am 
@Ta: I appreiciate the unexpectedly long answer and explanation! Thanks 😊
Ta  [author] 16 Aug @ 10:54pm 
@Snuggl

For mods that just add more stack slots to storage, like LWM's Deep Storage, they should work perfectly together. The number of stacks a shelf can hold won't change, but my mod will make each of those stacks much larger based on its weight limit. So your total storage capacity will get a huge boost.

For storage mods that have their own logic, like a total weight or volume limit (e.g., from ASF), their rules should take priority for their specific buildings. So when you put stuff in one of their containers, it'll use their system. For everything else—like items on the floor or in regular stockpiles—it'll use my mod's rules.

So theoretically, they are fully compatible. I have to be honest though, I haven't used LWM in a long time and have never used ASF-based mods myself, so I can't guarantee they work exactly as I've described.

However, if you or anyone else reports a conflict, I will definitely try my best to patch it and make our mods compatible.
Snuggl 16 Aug @ 9:20pm 
How is this working in combination with mods that add storage buildings, such as Adaptive Storage Framework or LWM Deep Storage?
Ta  [author] 16 Aug @ 8:42pm 
@LS_Naix 这个Mod只修改了可堆叠物品的堆叠上限,器官、武器、装备一类原版不能堆叠的物品还是原样。