Files
factorio-clusterio/plugins/subspace_storage/README.md
T
bbassieandClaude Opus 5.5 bf33f4f52e Refuse to start without required mods and download them
requiredMods entries are now Factorio dependency strings, and a mod
listed twice gives a version range. The plugin loader validates them.

The host refuses to start an instance whose mod pack is missing a
required mod of a loaded plugin, has it disabled or has it outside the
version range.

On start the controller resolves the required mods of its plugins and
their dependencies for the default mod pack's Factorio version and
downloads the ones missing from the mod store. The resolver and portal
download move from the ControlConnection handlers into Controller
methods so both paths share them.

Subspace Storage requires subspace_storage >= 1.99.0, and the
integration tests build a stub of that mod for the test mod pack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:19:05 +00:00

61 lines
3.0 KiB
Markdown

# Clusterio Subspace Storage Plugin
Plugin for the [Subspace Storage mod](https://github.com/clusterio/subspace_storage).
## Installation
Run the following commands in the folder Clusterio is installed to:
npm install @clusterio/plugin-subspace_storage
npx clusteriocontroller plugin add @clusterio/plugin-subspace_storage
Substitute clusteriocontroller with clusteriohost or clusterioctl if this a dedicate host or ctl installation respectively.
The plugin needs the [Subspace Storage mod](https://mods.factorio.com/mod/subspace_storage) in the mod pack of every instance it is loaded on.
The controller downloads it from the mod portal on start if the Factorio credentials are configured, but you have to add it to the mod packs yourself.
Instances with the plugin loaded refuse to start without it. Set `subspace_storage.load_plugin` to false on instances that should not use it.
## Controller Configuration
### subspace_storage.division_method
How to divide items between instances when there isn't enough in storage to give everyone what they ask for.
One of `simple`, `dole` or `neural_dole`.
With `simple` requests are served in full on a first come first served basis until the storage runs out.
With `dole` a per item division factor is kept that halves the amount handed out each time a request can't be met and slowly recovers when requests succeed, which spreads the remaining items between instances at the cost of draining the last of an item slowly.
`neural_dole` does the same with a small neural network estimating a fair share from the recent request history.
Defaults to `simple`.
### subspace_storage.log_item_transfers
Log every item transfer in and out of the storage to the controller console at verbose level.
Defaults to `false`.
## Instance Configuration
### subspace_storage.log_item_transfers
Log every item transfer in and out of the storage to the host console at verbose level.
Defaults to `false`.
## Development: inventory updates
The Node sender is in [instance.ts](instance.ts); the Factorio receiver is `UpdateInvData` in the separate mod repository's [src/control.lua](https://github.com/clusterio/subspace_storage/blob/master/src/control.lua).
Check both ends when changing inventory synchronization.
Each entry is `[name, count, quality]` and replaces the absolute count for that name/quality pair; it is not an amount to add or subtract.
With `full=true`, the receiver clears the previous inventory before applying entries, so an empty full snapshot clears all old state.
Without `full=true`, entries update only the listed pairs; omitted pairs retain their previous values, and an explicit zero records a zero count.
A new or restarted instance needs a complete snapshot before incremental updates.
Keep a complete inventory cache separate from any latest-delta cache: one delta is not enough to initialize a new receiver, and changes across several update windows must not overwrite each other before delivery.
Verify empty snapshots, zero counts, multiple qualities, and consecutive deltas when changing this path.