Conveyors

Updated a week ago

What the Conveyor System Does

Functionality

The Conveyor System enables players to link multiple inventories together, allowing materials to flow automatically from one station to another. By setting up conveyor links, players can create a seamless production line for refining items, reducing the need to manually move resources between different stations. Once set up, the system maintains a buffer per recipe input in the receiving station: it targets 5× the per-craft requirement for each input item in the station’s input inventory. This gives a buffer to the amount of times the mod checks all territories for when to update the amounts.

Command Activation

To use the conveyor feature, players must ensure the command is enabled:

  • Command: .logistics conveyor
  • Shortcut: .l co

Setting Up Conveyors

While you can name your chests or station something else, you must add on the conveyor names. To utilize the Conveyor System, players must adhere to a specific naming convention for their stations: (Sender/Receiver)Group#

  • Sending Inventory: Name these stations/chests using an "s" prefix (e.g., s0, s1).
  • Receiving Inventory: Name these stations/chests using an "r" prefix (e.g., r0, r1).
  • Groups: After the "s" or "r" you specify a number to choose a conveyor group. This establishes different lines of conveyors. Senders feed receivers with the same group number.

You can name a particular chest/station with both s# and r# to have it receive items, process them, and then send them off to another chest/station within the group.

Example Naming

  • A chest that stores wood would be named wood s0.
  • A sawmill that produces wooden planks and sawdust could be named r0s0.
  • A papermill that processes the sawdust into paper could be named Paper r0.

How to Use the Conveyor System

Permissions

The conveyor system will only work on a territory if the actual owner of that territory has them enabled personally. If you are merely a clan member, your personal setting will not effect their castle. Clan ownership is not enough, it is only personal ownership. You can check the actual owner of a territory by looking at the world map and hovering over the territory in which you are attempting to use the conveyors.

Step-by-Step Instructions

  1. Identify Stations: Determine which chests and refining stations you want to connect. Keep in mind, only renamable stations work with conveyors.

  2. Name the Stations: Use the appropriate naming convention:

    • For output stations: Use s (e.g., s0).
    • For input stations: Use r (e.g., r0).
  3. Set Up Connections:

    • A station named s0 will send materials to stations named r0.
    • You can create multiple groups by using different numbers (e.g., s1, r1).
    • Order of operations during each tick: the system first drains Overflow to receivers, then feeds receivers from station senders in the same group, then from chest senders in the same group.
    • Chest senders only feed stations. They do not feed receiver chests directly.
  4. Check Recipe Requirements: Ensure that the necessary recipes are unlocked and enabled (checked) in the receiving stations, so they can process the materials as they arrive. Disable (uncheck) to filter out unwanted recipes.

  5. Monitor Production: As materials flow through the conveyor system, monitor the output of each station to ensure everything is functioning as expected.

Important Considerations

  • Naming Consistency: Ensure all stations are named correctly according to the conventions to avoid disruptions in the conveyor system.

  • Inventory Management: Monitor the inventory levels of each chest to prevent halts in production.

  • Recipes: Ensure that all stations have the correct recipes selected to process incoming materials effectively.

  • Overflow Behavior: Overflow chests are group-agnostic and are consumed first to satisfy receiver needs. Leftovers from station senders go to Overflow.


Tech Details

  • Tokens: Names are parsed with r(\d+) and s(\d+). Tokens can be anywhere in the name and can be combined (for example r3s3).

  • Receiver Station demand:

    • For each unlocked and not disabled recipe, for each input item, target the per-craft requirement in the input inventory.
    • If the station has a matching floor, reduce the target to 75% of the above.
  • Receiver chests: Any chest with r# “wants” any item types already present. Seed with a single item to attract that type. There is no fixed cap beyond inventory limits.

  • Order of operations per tick:

    1. Overflow to receivers: Pulls from all Overflow chests across the territory into any receiver that wants the item. Groups are ignored at this step.
    2. Station senders to receivers: For each s# station output, feed r# receivers in the same group. If supply exceeds demand, the leftover goes to Overflow.
    3. Chest senders to stations: For each s# chest, feed stations only in the same group, keeping 1 of each item in the sender chest.
  • Distribution when supply is short: Items are split proportionally among receivers that still need them. If supply is enough, receivers are filled, and any station leftovers are dumped into Overflow.

  • Overflow definition: Any allied chest in the territory whose name contains overflow. Overflow acts as both a source (drained first) and a sink (leftovers from station senders).

  • Scope: Same-territory only. Allied inventories only. Cross-territory links are not considered.