Skip to content

Mod Details

Tekbox edited this page Nov 27, 2024 · 3 revisions

Mod Details

Train Stop

Train Stop Priority

This cannot be used under any circumstances as Cybersyn relies on coordinate stops and Factorios pathing preferring closer train stops to reliably determine the target train stop regardless of train stop name and the new built in priority system overrules the distance based pathing.

Train Limits

Cybersyn reads out the vanilla train limit and adheres to it allowing you to use it as you would normally in Factorio with basically no difference.

Trains headed for this Stop

The Train Stop UI won't show Trains Cybersyn scheduled to go to the Train Stop, as Cybersyn uses Coordinate Stops to ensure the train heads to the correct stop, meaning that technically the Train isn't actually heading to the Train Stop as far as Factorio is concerned, until it has already physically arrived.

Control Signals

Request Threshold

A request order for a station will only be generated if the station is requesting an amount of cargo equal to or exceeding the request threshold. In addition, there must be a station in the network which is providing at least as much cargo as the request threshold, and there must be a train in the network that has cargo capacity equal to or exceeding the request threshold. Therefore all generated orders must be for a number of cargo greater than or equal to the request threshold. By setting high thresholds, the traffic on your network can be greatly reduced, at the cost of needing to maintain larger cargo buffers at each station. The request threshold signal sets the request threshold "per-station" whereas the station control combinator can set or override the threshold per-cargo as well.

On station combinators there is a setting called "Stack thresholds". When enabled, any request threshold for this station will be multiplied by the stack size of any item it is being compared to. This applies to station control thresholds as well. Thus the request threshold can be specified based on total stack count rather than total item count. Fluids are unaffected by the "Stack thresholds" setting, effectively having a stack size of 1, thus they are always specified by total fluid count.

There is no "provide threshold" in this mod because by design there is no need for one. Because the request threshold is enforced on the provider station as well as the requester, it pulls double duty as both the request and provide threshold.

Also for all the former LTN users who are used to have request threshold act independently from train capacity, no it won't be changed, as there is no reason to do so as not adhering to train capacity mostly has downsides, specifically that traffic will spike cause multiple trains are sent at once when you could have spread them out across a longer time frame by limiting your request threshold to the trains capacity, so no need to suggest it we already had plenty of those. (Probably a bit to aggressive the way I worded this)

Priority

Orders will be generated first for stations, depots and refuelers which are receiving a higher priority signal than the others. If multiple depots or refuelers have the same priority, the closest one will be prioritized. Depots calculate distance based on the location of their train.

If multiple stations have the same priority, the least recently used requester station will be prioritized, and the provider station closest to the requester station will be prioritized. So in times of cargo shortage (front-pressure), round robin distribution will be used, and in times of cargo surplus (back-pressure), minimum travel distance distribution will be used. Provider stations will be prevented from providing cargo to lower priority (relative to other requesters) requester stations until the highest priority requester station is satisfied.

Locked Slots per Cargo Wagon

After an order has been generated, enough cargo will be subtracted from that order to ensure at least X number of slots in each cargo wagon can be left empty, where X is the "Locked slots per cargo wagon" signal being received by the station combinator. It is necessary for multi-item provider stations to function if they aren't set up to be precise provider stations.

Cybernetic Combinator

Placement

Every Cybernetic combinator needs to be placed within 1 tile of a Train Stop, this can also be done diagonally. And you can see if a placement is valid if the yellow outline of the combinator overlaps the Train Stop.

Wagon control is the exception of this rule as it is to be placed within 1 tile of it's corresponding wagon, meaning it needs to be placed next to the rail where a train wagon (cargo, fluid or locomotive) will stop when the train parks at the corresponding Train Stop.

Combinator Modes

Depot

Depot Mode

Combinator Symbol: D

Train Registration

A train is registered by setting its destination in it's schedule as the Depot.

Upon arriving at the Depot Station it will be registered in Cybersyns Network, upon which the schedule is wiped except for the Depot Stop and the Depot Stop is given a 1 second inactivity condition. The trains are registered for the Networks the Depot is on so a train registered at a Depot on network A won't get deliveries for Stations only on Network B. Important to note is, that Network Registration only occurs upon arrival at the Depot Station so a train needs to reregister before it acknowledges any changes in Network on the Depot. Cybersyn automatically detects the makeup of the train and its cargo capacity (fluid and item) for the purposes of the Allowlist.

Settings

Require Same Depot

This setting is enabled by default. It forces a train to return to this exact Depot Station using a Coordinate Stop, like it does for all other Stations trains are sent to by Cybersyn.

This way you can ensure that even if your Depots are named the same your trains will stick to the same Depot allowing you to set Depot Stations with the same name to different networks without causing issues from trains slowly wandering from one network to another. The issue with it is that it ignores Train Limit so if you register more than one train on the Depot it can cause traffic jams when they want to return at the same time so that is something to be aware of. Personally I'd recommend to disable this setting as having your trains capable of flexibly going to the closest free depot saves you a lot of traffic and fuel, though it does mean you need to be a bit more careful about naming your Train Stops. Especially dangerous is a Train Stop with the same name as a Depot, while not being a Depot itself as any trains heading there will not have their schedule reset causing them to repeat their previous order. If combined with Depot Bypass this can even lead to contaminating stations with the wrong items, but this should not discourage disabling this setting or enabling Depot Bypass as proper blueprints take care of the dangers and the benefits are immense.

Depot Bypass

This setting, which is by default enabled, allows Cybersyn to assign new jobs to trains that have completed an order, but have yet to return to a Depot.

This allows for far less trains to be needed, less traffic on the rail network and less fuel to be wasted, as this saves a lot of pointless trips to and from depots. This setting I highly recommend to enable on all Depots. There is basically no reason not to use it. As for refueling a train checks if it needs to refuel after each completed order and when it needs to do so it will head to a refueler or lacking such back to a depot for those that use the depots for refueling.

Station

Station Mode

Combinator Symbol: S

The Color of the Symbol indicates the state of the Station.

  • Blue = Standby (waiting for the conditions to schedule a delivery to be fulfilled)
  • Green = Delivery scheduled
  • Red = Failed to Schedule a delivery (Not enough items, No trains that are big enough, etc.)

Settings

Provide/Request Slider

This slider lets you set a station to Provide only, Provide and Request or Request only.

The purpose of this is that you don't need to worry about sanitizing your inputs when you know the station is only supposed to do one of these things. If it is set to Provide and Request (default) when a train delivers a request and has loaded more than actually needed it could result in the cargo stored in the buffer being more than the request signal meaning after adding together the resulting signal is positive, which would result in the station actually providing the items to the network. It can easily be circumvented with circuits but by setting the station to only do one thing you just don't need to worry about it at all.

Auto Allowlist

Cybersyn automatically detects inserters, loaders, pumps and the like placed next to the rail near it's stations, letting it determine what kind of trains are allowed to pick up or deliver to it. This is still subject to change as there is desire for this feature to be more adjustable by the user, so this section may be outdated in the nearish future The Allowlist only allows trains to come to a station if all of it's wagons can be loaded/unloaded. This means, that a train needs to match the Allowlist of both the provider and the requester to be scheduled for delivery.

For example this would prevent a 1-2 train from going to a 1-2 provider picking up items to bring to a 1-1 requester and then getting stuck there because the requester couldn't unload the second wagon. What it doesn't prevent is for example a 1-1 train from going to a 1-4 provider to pick up items and then going to a 1-2 requester to deliver them. So you will need to be aware of this and be capable of balancing these things if you wish to use multiple different train lengths on a single network.

Stack Threshold

When enabled, any request threshold for this station will be multiplied by the stack size of any item it is being compared to. This applies to station control thresholds as well.

Thus the request threshold can be specified based on total stack count rather than total item count, and number of stacks a train can carry is static for any one train size in contrast to number of items, for which the capacity varies with stack size. Fluids are unaffected by the "Stack thresholds" setting, effectively having a stack size of 1, thus they are always specified by total fluid count. This setting affects only the request threshold, requests will still need to be specified in terms of items.

Inactivity Condition

This setting adds a 1 second inactivity condition to the stop in the trains schedule.

This is so you can ensure the train doesn't just leave once it's other wait condition is fulfilled. This is especially useful for creating multi item providers and precise providers, as for those you do not want the train to leave once it got the order it asked for.

Input

Here you pass the requests, cargo buffer and control signals using circuits.

Cargo Signal Polarity

Positive Item Signals represent cargo currently in your buffer. Negative signals represent requests/what you want to be in your buffer. Thus when adding these together the difference is what you can provide to the network or request from it. For a Provider Station you do not have any requests hence all cargo signals being positive, coming from your buffer. For a Requester Station you have a negative cargo signal that tells the station what you want and when enough is delivered the total goes towards 0 as it is added together with the content of the buffer.

Control Signal Behavior
Request Threshold

Unofficially also called the Minimum Delivery Size, it is the minimum value a request needs to reach before a delivery is scheduled and also the minimum capacity a train needs to have to be eligible for serving this delivery. If no signal is provided, Cybersyn uses the default from the settings, which by default is 2000.

A request order for a station will only be generated if the station is requesting an amount of cargo equal to or exceeding the request threshold. In addition, there must be a station in the network which is providing at least as much cargo as the request threshold, and there must be a train in the network that has cargo capacity equal to or exceeding the request threshold. Therefore all generated orders must be for a number of cargo greater than or equal to the request threshold. By setting high thresholds, the traffic on your network can be greatly reduced, at the cost of needing to maintain larger cargo buffers at each station. The request threshold signal sets the request threshold on a per-station basis.

Priority

Orders will be generated first for stations with higher priority. Priority can also go into the negative and the default is by default 0.

Provider stations will be prevented from providing cargo to lower priority (relative to other requesters) requester stations until the highest priority requester station is satisfied.

Locked Slots per cargo wagon

After an order has been generated, enough cargo will be subtracted from that order to ensure at least X number of slots in each cargo wagon can be left empty, where X is the "Locked slots per cargo wagon" signal being received by the station combinator. It is necessary for multi-item provider stations to function if they aren't set up to be precise provider stations.

Output

The Station Combinators output is the order of the train currently parked at the station, with positive signals being items the train has delivered and negative signals being items the train wants to pick up. This can be used to create precise providers, multi item providers and more.

Station Control

Station Control Mode

The Station Control mode allows for finer control over your stations by providing a second set of inputs and outputs.

Combinator Symbol: C

Input

Request Threshold

The request threshold signal has no use for the Station Control Combinator. Instead you can overwrite the default Request Threshold sent to the Station Combinator by sending specific item signals with the value of these signals being the new request threshold per item. These new thresholds are also affected by the Station Combinators Stack threshold setting.

Pseudo Active Provider: By adding a request threshold for an item to a provider you can turn it into a Pseudo Active Provider. When the cargo it provides meets or exceeds the threshold it will hijack any delivery created for the material it is providing ensuring that it is emptied out first even if it doesn't have enough materials to satisfy the requesters request threshold. This feature is mainly intended for flushing out old stations before decommissioning them, like old mining outposts for example. I wouldn't recommend using it like you would an active provider chest in a bot network, as it simply doesn't work that way and there generally is a better solution to pushing out items from a station that needs to be emptied.

Priority

You can send a second Priority signal to the Station control Combinator, which then overwrites the priority for the items which you have overwritten the request threshold for, allowing you to set two separate priorities for your station.

Output

The output of the Station Control Combinator gives the sum total of all cargo loading or unloading orders in progress for the station.

The very tick a train is dispatched for a new order to the station, that order is added to the output of this combinator, and it is removed as soon as the train leaves the station. The primary use case for this is to prevent duplicate orders from being generated for stations that provide or request from the same pool of cargo. To facilitate this only one train can be dispatched per-tick per-network per-cargo specifically to accommodate this.

Refuel

Refueler Mode

Combinator Symbol: R

Fuel Threshold

Whenever a train completes a delivery, if it is running low on fuel (configurable in mod settings), it will attempt to visit a refueler before returning to the depot. To disable this check set the refuel threshold to -1. This is required for some mods, which provide trains that aren't fueled by traditional fuel.

Allowlist

Refuelers can automatically build allow-lists. When this option is enabled, trains will be prevented from parking at this station if one of their cargo wagons would be filled with fuel, however this does not guarantee that all locomotives of the train can be fueled. So if you have 1-1-1 trains, 1-2 trains and 1-1 trains on the network and two refuelers one set up to only refuel the front locomotive and one set up to refuel the front locomotive and the third place (second locomotive for the 1-1-1 train) All trains will still be able to refuel at the first refueler, which can lead to the 1-1-1 trains running out of fuel. Also the second refueler can be targeted by only the 1-1-1 and 1-1 trains as they won't have their cargo wagons filled by the inserters, but the 1-2 train won't come to this refueler to refuel.

Wagon Control

Wagon Control Mode

Combinator Symbol: W

Placement

Wagon control is to be placed within 1 tile of the wagon it is supposed to connect to, meaning it needs to be placed next to the rail where a train wagon (cargo, fluid or locomotive) will stop when the train parks at the corresponding Train Stop.

If this wagon is a cargo wagon, its slots will automatically be filtered so items can only enter it in sorted order

Settings

A setting allows for the unfiltered slots to be locked.

Output

The output of this combinator gives the list of cargo expected to be loaded or unloaded to just this specific wagon, allowing you to create precise provider stations for more than 1 wagon trains.

Networks

Cybersyn does not know the physical makeup of your rail network and thus needs to be told which stations are allowed to interact with each other. This is done through the use of networks.

Since a recent update it can however now distinguish between stations on different surfaces allowing you to not worry about accidentally assigning stations from different surfaces to the same network.

Basic use

The most basic way to use networks is to simply set them in the Cybernetic Combinator of your station. The default network when placed is the virtual Signal A (virtual signals being signals that do not have a physical counterpart in the game world) and can be changed by clicking on it like you would in vanilla combinators. Simply select your desired virtual Signal and it will become the new network for that station. Do not select non virtual signals or one of the three control signals added by Cybersyn.

Using multiple Networks at once

Of course it could be that you want a station to provide to multiple networks at once and having to build a second station just for that is bulky and unnecessary as you can assign multiple networks to one station. Simply select the virtual Each signal as the network in the combinator and you can now control the networks this station is on by sending the virtual Signal to the combinator through circuits. Important to know for that is that the signal value represents the Subnetwork a station is placed on. If you do not wish to dive deep into subnetworks here is the two most useful values you should know: -1 represents a Network which is on all Subnetworks and is also the default for any station that isn't sent a network signal unless changed in the mod settings. 1 represents the first subnetwork and while not special compared to the others it is useful as it is easier to get the value 1 on a signal than it is for any other value as you can directly force a signal to take on such a value using a decider combinator making it the subnetwork of choice you want to go for when working with circuits usually. Simply pick one of these two values to use and be consistent in what you use across your entire base and things will work out, without having to understand how Subnetworks work.

Subnetworks

Subnetworks allow for even more different networks and more flexibility when working with complex setups where you want a lot of control over a system. To properly utilize them however you need to at the very least understand what a bitmask is, as that is what Subnetworks are in essence. I highly recommend using the Cybersyn Combinator Mod as it has a UI that makes it much easier to create the desired Subnetwork mask without having to thoroughly understand bitmasks and without the need to constantly do the math whenever you need more complex Subnetwork masks. But understanding bitmasks will certainly help understand the intricacies of Subnetwork masks more easily.

Signed Int 32

Signals in Factorio consist of a signed 32 bit integer value, meaning we got 32 bits to work with for encoding our Subnetworks.

Encoding our Subnetworks

We do this by assigning each bit to a Subnetwork meaning that we can have a total of 32 Subnetwork for every main Network. Whether a station is on any one Subnetwork we determine by whether the corresponding bit is a 1 (on the subnetwork) or 0 (not on the subnetwork).

Matching with other stations

To see whether two stations share a Subnetwork and thus whether a delivery can be scheduled from one to the other we simply apply the bitwise AND operation on the two Subnetwork masks. For example lets say we have a station with subnetwork mask 1 (Station A) and one with subnetwork mask 5 (Station B) and another with subnetwork mask 4 (Station C). Discarding the large numbers of 0s in front the subnetwork masks would look something like this in bit: Station A: 0001 Station B: 0101 Station C: 0100 The bitwise AND operation simply creates a new number that only has 1s in places where both input numbers also have a 1 and we know two stations share a network if the resulting number is anything other than 0. Example operations: Station A: 0001 & Station A: 0001 & Station B: 0101 & Station B: 0101 Station C: 0100 Station C: 0100 Mask: 0001 Mask: 0000 Mask: 0100

As you can see Station A & B share a network as do Station B & C, but Station A & C do not so while A can schedule a delivery to or from B it cannot do so with C and the same goes in reverse, C can schedule a delivery to or from B, but cannot do so with A. This is because A is on Subnetwork 1, while C is on Subnetwork 4, B however is on both Subnetwork 1 & 4 hence being accessible to both A and C.

Mod Settings

To reach the settings go Settings > Mod settings and then scroll down to P for Project Cybersyn in the desired tab.

Startup

  • Preview the Indev Cybersyn Manager Is disabled by default, but feel free to enable it as it can be very useful and most issues it cause aren't something big you should be worried about with crashes occurring very rarely, despite what the info box says. Will cause your game to restart upon changing as it is a Startup setting.

Map

  • Enable central planning Turns Cybersyn itself on or off. Very useful for debugging certain aspects like rogue trains.
  • Central planning updates per second Self explanatory, controls how often Cybersyn updates per second, capping at 1 (every 60 ticks) and 60 (every tick) respectively. Default is 30 (every two ticks)
  • Central planning update rate Controls how many stations are checked per update, as well as how many trains will be dispatched at maximum per loop (through all stations on your network) Default is 2 so two stations per update and 2 trains per loop. If your trains are slow to respond you may want to consider increasing this value to double or even quadruple what it is by default. I have yet to encounter performance complaints after doing so, so it's impact should be marginal on most decent PCs.
  • Default request threshold Sets the request threshold for stations where it isn't set by signal. Default is 2000
  • Default priority Sets the priority for stations where it isn't set by signal. Default is 0
  • Default locked slots per cargo wagon Sets the locked slots per cargo wagon for stations where it isn't set by signal. Default 0
  • Default network mask Sets the network mask for stations where it isn't set by signal. Default is -1
  • Fuel threshold Determines how full a trains fuel must be to skip refueling. Set to 1 for them to always refuel and to -1 to skip refueling always Default is 0.5
  • Station warmup time (sec) How many seconds the cybernetic combinator will wait after construction, before it connects to the Cybersyn network Default 20
  • Stuck train timeout (sec) How many seconds after a train is dispatched Cybersyn waits until throwing a Train is stuck alert. If it is thrown without reason you may want to increase this value. Default is 600
  • Allow cargo in depots When enabled Cybersyn won't hold Trains with cargo remaining in requesters and depots and won't throw alerts when trains reach depots with cargo. Default is disabled Do not use unless you know what you are doing and even then not really recommended.

Per player

  • Max entities displayed on GUI pages This setting lets you cap the number of matching entities (e.g. stations, trains) to limit the amount of update time consumed when the list is refreshed. -1 is the default and returns all results.