# Function Description
The Smart Storage System provides three intelligent storage modes for the vanilla shelving system:
For vanilla use only. If you are using the Adaptive Storage Framework (ASF), please use the compatible version.
[url=https://steamcommunity.com/sharedfiles/filedetails/?id=3699035593]https://steamcommunity.com/sharedfiles/filedetails/?id=3699035593[/url]
It implements a hierarchical storage network consisting of a Main Warehouse, Distributed Warehouses, and Production Transfer Stations. You can build transfer stations next to workbenches to reduce the issue where crafters have to travel to the warehouse twice per finished product (once for materials, once for delivery). You can also place Distributed Warehouses on the outer parts of your base to solve the problem where hauling time becomes longer than construction time during base expansion.
1. Main Warehouse
- Used as regular storage
- Smart restocking / shipping rules are disabled
2. Distributed Warehouse
- Suitable for placement near production areas
- Supports automatic restocking based on thresholds
- Logic: restocking starts when stock falls below the restock line and stops when above the stop line
- Allows setting a maximum number of stacks for individual items
3. Transfer Station
- Designed as shelving next to workbenches for finished goods and production buffering
- Supports separate input and output rules
- Input rules supply materials required for recipes
- Output rules cache finished products and ship them out once the shipping threshold is reached
- Supports importing recipes from nearby workbenches to auto-generate input/output rules
## Differences from the Original Smart Shelves
The original Smart Shelves only feature standalone transfer station shelves, but they have the advantage of simple logic and high stability. However, in late-game with a very large base, haulers may still take long trips, wander off or idle midway, forcing crafters to fetch materials and deliver goods themselves, which slows down production.
This system uses shelving with the same capacity as Smart Shelves and is therefore incompatible with them.
## Where Does the Extra Overhead Come From Compared to Vanilla?
1. Expanded Storage Slot Search
- Vanilla only checks whether a storage slot is valid
- The Smart Storage System additionally checks whether a smart warehouse should restock or ship at the current moment
2. Smart Warehouse Scanning
- On the `StoreUtility.TryFindBestBetterStoreCellFor` path, it performs extra checks on candidate smart warehouses across the map
3. Periodic Rule Refresh
- Refreshes the rule state of non-main warehouses every 30 ticks
4. Dynamic Filters and Virtual Priorities
- Transfer station outputs and distributed restocking add extra logic that affects vanilla storage decision paths
## Current Performance Experience
1. Small to Medium-Sized Bases
- Generally acceptable
- Recommended for use at a small number of key production points
2. Many Smart Warehouses, Numerous Workbenches, Large Maps
- Performance overhead is noticeably higher than vanilla
- Especially obvious during sustained heavy hauling
## Estimated Extra Cost vs. Vanilla
Total game performance:
- Light usage: approximately `3% - 8%`
- Medium usage: approximately `8% - 18%`
- Heavy usage: potentially `20%+`
## Is This Overhead Worth It?
When used only at key logistics nodes, the overhead is usually worthwhile, as it provides:
1. Less fragmented hauling
2. Fewer round trips between production points and the main warehouse
3. More stable material buffering and finished goods caching
4. More intuitive transfer stations and distributed logistics nodes
## Current Issues
1. Occasional minor "restock one by one" behavior may still occur (when crafting speed exceeds hauling speed, restocking never reaches the stop threshold)
- The current version does not include "in-transit item counting"
- Because that logic causes excessive performance costs on real-world maps
2. Performance is higher than vanilla in large maps with many smart warehouses