Item Network SA

by djmalk

This mod adds a network for transporting items and fluids. Now with QUALITY support.

Tweaks
2 months ago
2.0
826
Logistics Fluids Logistic network Storage Cheats
Owner:
djmalk
Source:
N/A
Homepage:
https://mods.factorio.com/mod/item-network-sa
License:
MIT
Created:
4 months ago
Latest Version:
1.0.3 (2 months ago)
Factorio version:
2.0
Downloaded by:
826 users

Item Network SA

Do you have questions, comments or bugs? Start a discussion in the mod portal.

Original mod by y_e_a_r. https://mods.factorio.com/mod/item-network
Russian translation by Dizabeth. https://mods.factorio.com/user/Dizabeth
Works without the Quality Mod.

Overview

This mod adds a new transportation mechanic to move items and fluids as quickly as possible.
It does this by adding Network Chests and Tanks which serve as an access points to a limitless shared inventory for the entire mod. Network Chests can give and take items to and from this shared inventory and Network Tanks move fluids.
This approach scales well for everything from a seldom-used mall to moving vast quantities of items.
By default, Network Chests are unlocked instantly.
For a more balanced experience, you can enable a mod setting to lock them behind:
- Production Science
- Space Science
- Promethium Science
Set your preferred unlock stage in Mod Options.

Configuring Network Chests

Network chests have a custom UI to configure requests that can be accessed by clicking on the chest.
Each chest has a list of items where the chest either requests or provides each item.
Each request has a "limit" and "buffer" defined as follows:
- Provide item to the network when there are less than limit items in the network and store buffer items in this chest.
- Request item from the network when there are more than limit items in the network and store buffer items in this chest.
This method of defining requests is easy to use but also allows for complex production loops with both custom input and output priorities..

Copy Recipes from Assemblers

Recipes can be copied from assemblers just like requester chests.
Now also supports fluids (to tanks) and the rocket silo.

Fluids

Fluids can be transported through the network using Network Tanks. These tanks are similar to Network Chests except they only transport 1 fluid at a time.
Network Tanks configured to Provide will try to push any fluids from the tank into the network up to the configured limit.
Network Tanks configured to Request will try to take the specified fluid at the specified temperature from the network.
As of 0.5.0, the network correctly handles fluids with different temperatures. Currently only whole-number temperatures are supported so please reach out if you have a use case for temperatures with decimals.

Network View

Pressing Ctrl + Shift + N will bring up the Network View to see items and fluids currently in the network.
This keybind can be changed in the game settings.
In addition to displaying items and fluids in the network, there is also a "Shortages" tab that displays the number of unsatisfied item requests for the past 5 seconds.

Logistics Integrations

  • The mod will try to fulfill logistic and trash requests from players.
  • The mod will try to fulfill logistic and trash requests from vehicles.
  • The mod will try to fulfill logistic requests from Requester and Buffer chests.
  • The mod will try to give items to logistic networks that need items for construction.
    Some of these integrations can be disabled in mod settings.

Underlying Implementation

Network chests are implemented as a normal chest with 48 slots. Each of the chest's requests has a buffer size and filtered item slots are used to reserve space for that item. For example if the request buffers 51 coal, the mod will filter 2 chest slots for coal.
Since 2 slots of coal can hold 100 coal, the mod will set the chest bar to prevent inserting more coal if the number of coal equals or exceeds 51.
The mod won't let you add requests that buffer more than can be stored in the network chest.
This implementation makes it easy to buffer just one nuclear reactor at the mall or buffer 1000 iron ore for bulk transport.

Performance

This mod is tuned to take about 1-3ms every tick and does a fixed amount of work on every tick. While this is a lot of time for each tick, this mod also does a lot of work to transport all items for an entire base. For larger bases this overhead is comparable to the render time for belts, trains and bots.
Internally the mod maintains a FIFO queue of every Network Chest and Tank. On every tick it:
- Pops 20 entities off the front of the queue, updates the entities, and pushes them to the back of the queue.
- Randomly swaps a single entity to the front of the queue to slowly shuffle the update order.
Because this approach only scans a fixed number of chests per tick, chests will be scanned less frequently as the base scales up and more chests are built. It's sometimes necessary to increase the buffer and limit of high-throughput items like iron or copper and usually a buffer of 500-1000 items is enough to keep a full blue belt saturated.
Network chests have no trouble keeping blue belts saturated with less than 2K Network Chests in the map. However there have been reports that it is hard to saturate belts in larger factories with ~50K Network Chests.It is recommended to keep the number of chests below 3K.
- Scale: This mod is designed and tested to scale thousands of network chests and transport as many items as possible while being UPS friendly.
- Complex Recipes: Through limits, this mod can prioritize requesting and providing items to move items through complex recipe chains without requiring other coordination mechanisms like splitters or pumps.
- Ease of Use: This mod is designed to make it as easy as possible to move items without trying to make the mechanic balanced or fair. This mod is cheating but in an interesting way that can delight experienced players.
- Compatibility: This mod is designed to work with with all other mods without config changes.