From de5f465910b10882eac9a23d97127aadb7061b5c Mon Sep 17 00:00:00 2001 From: mamoniot Date: Fri, 23 Dec 2022 22:13:42 -0500 Subject: [PATCH] fixed inconsistent naming --- README.md | 22 +++++++++++----------- cybersyn/changelog.txt | 4 ++-- cybersyn/locale/en/base.cfg | 8 ++++---- cybersyn/scripts/constants.lua | 2 +- cybersyn/scripts/factorio-api.lua | 2 +- cybersyn/scripts/gui.lua | 2 +- cybersyn/scripts/layout.lua | 2 +- cybersyn/scripts/main.lua | 4 ++-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 124042f..0b88d7b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Behold one of the most feature-rich and performant train logistics network mods Within Project Cybersyn, you can think of requester stations as requester chests, provider stations as passive provider chests, depots as roboports and trains as the logistics bots. There is a direct correspondence between the Cybersyn train network and Factorio's robot logistics network. -A bare minimum Cybersyn train network consists of 2 components: depots and stations. Both are created by placing a cybernetic combinator adjacent to a train stop. Select the "Control Mode" of the combinator to "Station" to create a station, and to "Depot" to create a depot. Create a basic train and order it to park at the depot you just created, it is now controlled by the Cybersyn network. Depots and stations can have any train stop name, names do not impact their function. The circuit network input of a station's cybernetic combinator determines what items that station will request or provide to the Cybersyn network. A positive item signal is interpreted as that station providing that item to the network; A negative item signal is interpreted as that station requesting that item from the network. +A bare minimum Cybersyn train network consists of 2 components: depots and stations. Both are created by placing a cybernetic combinator adjacent to a train stop. Select the "Mode" of the combinator to "Station" to create a station, and to "Depot" to create a depot. Create a basic train and order it to park at the depot you just created, it is now controlled by the Cybersyn network. Depots and stations can have any train stop name, names do not impact their function. The circuit network input of a station's cybernetic combinator determines what items that station will request or provide to the Cybersyn network. A positive item signal is interpreted as that station providing that item to the network; A negative item signal is interpreted as that station requesting that item from the network. ![Image](https://raw.githubusercontent.com/mamoniot/project-cybersyn/main/previews/basic-provider.png) ![Image](https://raw.githubusercontent.com/mamoniot/project-cybersyn/main/previews/basic-requester.png) @@ -63,7 +63,7 @@ If you like my work, consider supporting me on [ko-fi](https://ko-fi.com/lesbian ## Mod Details -This mod adds a single new entity to the game, the cybernetic combinator. This combinator can be in one of 5 different possible control modes. While each mode has a purpose, the only modes you are required to use are station mode and depot mode. +This mod adds a single new entity to the game, the cybernetic combinator. This combinator can be in one of 5 different possible modes. While each mode has a purpose, the only modes you are required to use are station mode and depot mode. ### Station mode @@ -79,7 +79,7 @@ Stations can be set to provide only or request only. By default stations can bot ![Image](https://raw.githubusercontent.com/mamoniot/project-cybersyn/main/previews/big-depot.png) -When placed adjacent to a vanilla train stop, a Cybersyn depot is created. Any train which parks at this depot will automatically be added to the train network. Whenever a train order is generated, if this train has the cargo capacity to fulfill it, and is allow-listed by both stations, then it will automatically be dispatched to fulfill the order. When the order is completed, the train will return to any train stop with the same name as the depot it first parked in. This almost always means it returns to a Cybersyn depot where it will again await to fulfill a new order. To save on UPS the input of a depot control combinator is only read when a train parks at the depot; this is only relevant for networks which make extensive use of network masks on depots. +When placed adjacent to a vanilla train stop, a Cybersyn depot is created. Any train which parks at this depot will automatically be added to the train network. Whenever a train order is generated, if this train has the cargo capacity to fulfill it, and is allow-listed by both stations, then it will automatically be dispatched to fulfill the order. When the order is completed, the train will return to any train stop with the same name as the depot it first parked in. This almost always means it returns to a Cybersyn depot where it will again await to fulfill a new order. To save on UPS the input of a depot combinator is only read when a train parks at the depot; this is only relevant for networks which make extensive use of network masks on depots. ### Fuel loader mode @@ -87,17 +87,17 @@ When placed adjacent to a vanilla train stop, a Cybersyn fuel loader is created. Fuel loaders 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. -### Station info mode +### Station control mode ![Image](https://raw.githubusercontent.com/mamoniot/project-cybersyn/main/previews/science.png) When placed adjacent to the train stop of an already existing Cybersyn station, this combinator will provide a second set of inputs and outputs that can be used to more precisely control this station. The combinator input allows for request thresholds to be set per-item. Any non-zero item signal given on the input circuit network will override the station's request thresholds for just that item. When this is used on a provider station, if the station has more items than the input threshold, it will force the creation of a delivery for that item to the next available requester station. This effectively overrides the requester station's request threshold. This is useful for purging unwanted items from provider stations. -If a station info combinator receives a "priority" signal as input, it will apply that priority to each item signal it is receiving as input. This allows you to specify up to 2 different priorities per-item on a single station. +If a station control combinator receives a "priority" signal as input, it will apply that priority to each item signal it is receiving as input. This allows you to specify up to 2 different priorities per-item on a single station. The output of the combinator gives the sum total of all item 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 the same pool of items. Only one train can be dispatched per-tick per-item specifically to accommodate this. -### Wagon info mode +### Wagon control mode ![Image](https://raw.githubusercontent.com/mamoniot/project-cybersyn/main/previews/filtered-slots.png) @@ -107,7 +107,7 @@ When placed adjacent to the tracks of an already existing Cybersyn station, this ![Image](https://raw.githubusercontent.com/mamoniot/project-cybersyn/main/previews/gui-network.png) -Stations, depots and fuel loaders can be set to belong to a particular network by setting that network on the control combinator. By default all combinators belong to the "signal-A" network. By setting a different signal Id, the combinator will belong to that different network. Networks identified with different signal Ids do not share any trains or items; Orders will never be generated to transfer items between separate networks. +Stations, depots and fuel loaders can be set to belong to a particular network by setting that network on their combinator. By default all combinators belong to the "signal-A" network. By setting a different signal Id, the combinator will belong to that different network. Networks identified with different signal Ids do not share any trains or items; Orders will never be generated to transfer items between separate networks. In addition, if the combinator receives as input a signal of the same Id as its network signal Id, then the value of this signal will be interpreted as a bitmask to give 32 "sub-networks" to choose from. Each station can belong to any set of sub-networks based on its mask. A delivery will only be made between two stations if any two bits match between the two masks, i.e. if `mask1 & mask2 > 0`. When a network Id is an item, that item will be ignored by stations, its signal will only ever be interpreted as the network mask. @@ -117,19 +117,19 @@ Stations and fuel loader combinators allow their network to be set to the "each" ![Image](https://raw.githubusercontent.com/mamoniot/project-cybersyn/main/previews/virtual-signals.png) -If a station control combinator receives a request threshold signal as input, a request order for the station will only be generated if the station is requesting a number of items exceeding the request threshold. In addition, there must be a station in the network which is providing at least as many items as the request threshold, and there must be a train in the network that has cargo capacity exceeding the request threshold. Through this logic all generated orders must be for a number of items 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 item buffers at each station. There is no "provide threshold" in this mod because by design there is almost no need for one. If desired a provide threshold can be simulated with a single decider combinator. The request threshold signal sets the request threshold "per-station" whereas the optional station control combinator can set or override the threshold per-item as well. +If a station combinator receives a request threshold signal as input, a request order for the station will only be generated if the station is requesting a number of items exceeding the request threshold. In addition, there must be a station in the network which is providing at least as many items as the request threshold, and there must be a train in the network that has cargo capacity exceeding the request threshold. Through this logic all generated orders must be for a number of items 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 item buffers at each station. There is no "provide threshold" in this mod because by design there is almost no need for one. If desired a provide threshold can be simulated with a single decider combinator. The request threshold signal sets the request threshold "per-station" whereas the station control combinator can set or override the threshold per-item as well. -On station combinators their is a setting called "Stack thresholds". When set, 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 info 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, they are always specified by total fluid count. +On station combinators their is a setting called "Stack thresholds". When set, 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, they are always specified by total fluid count. ### Locked slots per cargo wagon -After an order has been generated, enough items 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 control combinator. It is necessary for multi-item stations to function. +After an order has been generated, enough items 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 stations to function. ### Priority Orders will be generated first for stations, depots and fuel loaders which are receiving a higher priority signal than the others. If 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 item shortage (front-pressure), round robin distribution will be used, and in times of item surplus (back-pressure), minimum travel distance distribution will be used. Provider stations will be prevented from providing items to lower priority requester stations until the highest priority requester station is satisfied. -If a combinator set to station info mode receives a priority signal, for each item signal input to the combinator, items of that type will have its priority overridden in addition to its request threshold. This effectively allows you to choose one of two possible priorities for each item that a station processes. +If a combinator set to station control mode receives a priority signal, for each item signal input to the combinator, items of that type will have its priority overridden in addition to its request threshold. This effectively allows you to choose one of two possible priorities for each item that a station processes. ### Train limits diff --git a/cybersyn/changelog.txt b/cybersyn/changelog.txt index bd81c8f..74ad707 100644 --- a/cybersyn/changelog.txt +++ b/cybersyn/changelog.txt @@ -3,7 +3,7 @@ Version: 1.2.0 Date: 2022-12-23 Changes: - Forced provide stations to wait until they can service the highest priority request station - - Provide stations now override request thresholds with the per-item thresholds set by their station info combinator + - Provide stations now override request thresholds with the per-item thresholds set by their station control combinator - Allowed station and fuel combinators to be set to network id "each", for each virtual signal they recieve as input, the stop is added to that network and its signal strength is used as the network mask - Added the ability to specify per-station whether request thresholds represent total items or total stacks - Prioritized a train's distance from the provide station over the train's cargo capacity @@ -49,7 +49,7 @@ Date: 2022-12-8 Version: 1.1.0 Date: 2022-12-8 Changes: - - Added the ability to use the priority signal as input to station info combinators so one can override priority on items with station info combinators thresholds + - Added the ability to use the priority signal as input to station control combinators so one can override priority on items with station control combinators thresholds - Added refueler stations - Slightly more permissive allow-list logic - Made non-backwards compatible improvements and bugfixes to the modding interface diff --git a/cybersyn/locale/en/base.cfg b/cybersyn/locale/en/base.cfg index 9870edd..9346cd1 100644 --- a/cybersyn/locale/en/base.cfg +++ b/cybersyn/locale/en/base.cfg @@ -29,7 +29,7 @@ cybersyn-combinator=Cybernetic combinator cybersyn-combinator-output=Cybernetic combinator output [entity-description] -cybersyn-combinator=Has 4 different control modes. Primary control allows providing and requesting. Optional Control allows setting thresholds per-item and reading all in progress deliveries. Depot control allows parked trains to be added to the network. Wagon control allows for reading the desired contents of the adjacent wagon. +cybersyn-combinator=Has 5 different control modes. Station mode allows providing and requesting. Station control mode allows setting thresholds per-item and reading all in progress deliveries. Depot mode allows parked trains to be added to the network. Fuel loader mode allows refueling stations to be designated. Wagon control mode allows for reading the desired contents of the adjacent wagon. [technology-name] cybersyn-train-network=Cybersyn train network @@ -58,12 +58,12 @@ no-train-matches-p-layout=Could not find a train on the allow-list of __2__ to m [cybersyn-gui] combinator-title=Cybernetic combinator -operation=Control Mode +operation=Mode comb1=Station depot=Depot refueler=Fuel loader -comb2=Station info -wagon-manifest=Wagon info +comb2=Station control +wagon-manifest=Wagon control network=Network network-tooltip=A signal is used to identify which network this combinator is a member of. Trains will only be dispatched from depots to provider and requester stations if they are all identified with the same signal. allow-list-description=Automatic allow-list diff --git a/cybersyn/scripts/constants.lua b/cybersyn/scripts/constants.lua index 1fa7d7a..0d7307a 100644 --- a/cybersyn/scripts/constants.lua +++ b/cybersyn/scripts/constants.lua @@ -19,7 +19,7 @@ MODE_PRIMARY_IO_FAILED_REQUEST = "^" MODE_PRIMARY_IO_ACTIVE = "<<" MODE_SECONDARY_IO = "%" MODE_DEPOT = "+" -MODE_WAGON_MANIFEST = "-" +MODE_WAGON = "-" MODE_REFUELER = ">>" NETWORK_SIGNAL_DEFAULT = {name="signal-A", type="virtual"} diff --git a/cybersyn/scripts/factorio-api.lua b/cybersyn/scripts/factorio-api.lua index 1488359..8593c35 100644 --- a/cybersyn/scripts/factorio-api.lua +++ b/cybersyn/scripts/factorio-api.lua @@ -451,7 +451,7 @@ function get_comb_gui_settings(comb) selected_index = 3 elseif op == MODE_SECONDARY_IO then selected_index = 4 - elseif op == MODE_WAGON_MANIFEST then + elseif op == MODE_WAGON then selected_index = 5 end return selected_index, params.first_signal, switch_state, not allows_all_trains, is_stack diff --git a/cybersyn/scripts/gui.lua b/cybersyn/scripts/gui.lua index 018d86f..a75c2e7 100644 --- a/cybersyn/scripts/gui.lua +++ b/cybersyn/scripts/gui.lua @@ -185,7 +185,7 @@ function register_gui_actions() elseif element.selected_index == 4 then set_comb_operation(comb, MODE_SECONDARY_IO) elseif element.selected_index == 5 then - set_comb_operation(comb, MODE_WAGON_MANIFEST) + set_comb_operation(comb, MODE_WAGON) else return end diff --git a/cybersyn/scripts/layout.lua b/cybersyn/scripts/layout.lua index a598350..90c7b32 100644 --- a/cybersyn/scripts/layout.lua +++ b/cybersyn/scripts/layout.lua @@ -532,7 +532,7 @@ function reset_stop_layout(map_data, stop, is_station_or_refueler, forbidden_ent end elseif entity.name == COMBINATOR_NAME then local param = map_data.to_comb_params[entity.unit_number] - if param.operation == MODE_WAGON_MANIFEST then + if param.operation == MODE_WAGON then local pos = entity.position local is_there if is_ver then diff --git a/cybersyn/scripts/main.lua b/cybersyn/scripts/main.lua index 8a4f804..9983db6 100644 --- a/cybersyn/scripts/main.lua +++ b/cybersyn/scripts/main.lua @@ -247,7 +247,7 @@ local function on_combinator_built(map_data, comb) params.operation = op params.first_signal = NETWORK_SIGNAL_DEFAULT control.parameters = params - elseif op ~= MODE_PRIMARY_IO and op ~= MODE_SECONDARY_IO and op ~= MODE_DEPOT and op ~= MODE_REFUELER and op ~= MODE_WAGON_MANIFEST then + elseif op ~= MODE_PRIMARY_IO and op ~= MODE_SECONDARY_IO and op ~= MODE_DEPOT and op ~= MODE_REFUELER and op ~= MODE_WAGON then op = MODE_PRIMARY_IO params.operation = op control.parameters = params @@ -258,7 +258,7 @@ local function on_combinator_built(map_data, comb) map_data.to_output[comb.unit_number] = out map_data.to_stop[comb.unit_number] = stop - if op == MODE_WAGON_MANIFEST then + if op == MODE_WAGON then if rail then update_stop_from_rail(map_data, rail, nil, true) end