prepared for 1.0.0

This commit is contained in:
Monica Moniot
2022-11-29 15:12:28 -05:00
parent c4d8d3d21b
commit 090c60e627
6 changed files with 29 additions and 15 deletions

View File

@@ -1,14 +1,16 @@
[mod-setting-name]
cybersyn-ticks-per-second=Central planning updates per second
cybersyn-wait-time=Required inactivity duration (sec)
cybersyn-request-threshold=Default requester threshold
cybersyn-network-flag=Default network flags
cybersyn-network-flag=Default sub-network flags
cybersyn-warmup-time=Station warmup time (sec)
cybersyn-stuck-train-time=Stuck train timeout (sec)
[mod-setting-description]
cybersyn-ticks-per-second=How many times per second the central planner should update the state of the network and schedule deliveries. Only one deliveries can be made per update. This value will be rounded up to a divisor of 60.
cybersyn-wait-time=How many seconds the duration of a train's inactivity order will be set to. Trains will be forced to wait in the station or depot until this amount of time has passed without the train receiving any kind of interaction. Non-zero values prevent inserters from getting stuck and prevent trains from leaving depots without refueling. Decimal values are allowed, they will be rounded up to a multiple of 1/60 (0.01667).
cybersyn-request-threshold=The default request threshold when a request threshold signal is not given to a station. When a station receives a negative item signal that surpasses its request threshold, so long as any station exists with a positive signal greater than the request threshold, a delivery of that item will be scheduled between the two stations.
cybersyn-network-flag=The default set of networks a station will service when no network signal is given to a station. This integer is interpretted bit-wise to give 32 possible network flags to choose from.
cybersyn-network-flag=The default set of sub-networks a station will service when no network signal is given to a station. This integer is interpretted bit-wise to give 32 possible sub-network flags to choose from.
cybersyn-warmup-time=How many seconds a cybernetic combinator will wait before connecting to the Cybersyn network. This is a grace period to modify or correct the circuit network before trains start dispatching to a newly blueprinted station.
cybersyn-stuck-train-time=After this many seconds from a train's dispatch, an alert will be sent to let you know a train is probably stuck and has not completed its delivery. The player will likely have to debug their network to get the train unstuck.

View File

@@ -22,6 +22,7 @@ OPERATION_DEPOT = "+"
OPERATION_WAGON_MANIFEST = "-"
NETWORK_SIGNAL_DEFAULT = {name="signal-A", type="virtual"}
INACTIVITY_TIME = 60
DELTA = 1/2048

View File

@@ -39,7 +39,7 @@ end
------------------------------------------------------------------------------
local create_loading_order_condition = {type = "inactivity", compare_type = "and", ticks = 120}
local create_loading_order_condition = {type = "inactivity", compare_type = "and", ticks = INACTIVITY_TIME}
---@param stop LuaEntity
---@param manifest Manifest
function create_loading_order(stop, manifest)
@@ -68,7 +68,7 @@ function create_unloading_order(stop)
return {station = stop.backer_name, wait_conditions = create_unloading_order_condition}
end
local create_inactivity_order_condition = {{type = "inactivity", compare_type = "and", ticks = 120}}
local create_inactivity_order_condition = {{type = "inactivity", compare_type = "and", ticks = INACTIVITY_TIME}}
---@param depot_name string
function create_inactivity_order(depot_name)
return {station = depot_name, wait_conditions = create_inactivity_order_condition}

View File

@@ -645,7 +645,9 @@ local function on_train_arrives_buffer(map_data, stop, train)
set_r_wagon_combs(map_data, station, train)
end
elseif train.status == STATUS_P and train.p_station_id == station_id then
elseif train.status == STATUS_R and train.r_station_id == station_id then
--this player intervention that is considered valid
elseif (train.status == STATUS_R or train.status == STATUS_R_TO_D) and train.r_station_id == station_id then
--this player intervention that is considered valid
else
on_failed_delivery(map_data, train)
remove_train(map_data, train, train.entity.id)

View File

@@ -9,28 +9,37 @@ data:extend({
minimum_value = 1,
maximum_value = 60,
},
--{
-- type = "int-setting",
-- name = "cybersyn-wait-time",
-- order = "ab",
-- setting_type = "runtime-global",
-- default_value = 2000,
-- minimum_value = 1,
-- maximum_value = 2147483647,
--},
{
type = "int-setting",
type = "double-setting",
name = "cybersyn-request-threshold",
order = "ab",
order = "ac",
setting_type = "runtime-global",
default_value = 2000,
minimum_value = 1,
default_value = 1,
minimum_value = 0,
maximum_value = 2147483647,
},
{
type = "int-setting",
name = "cybersyn-network-flag",
order = "ac",
order = "ad",
setting_type = "runtime-global",
default_value = 1,
default_value = -1,
minimum_value = -2147483648,
maximum_value = 2147483647,
},
{
type = "int-setting",
name = "cybersyn-warmup-time",
order = "ad",
order = "ae",
setting_type = "runtime-global",
default_value = 20,
minimum_value = 0,
@@ -39,7 +48,7 @@ data:extend({
{
type = "int-setting",
name = "cybersyn-stuck-train-time",
order = "ae",
order = "af",
setting_type = "runtime-global",
default_value = 600,
minimum_value = 0,