Difference between revisions of "User:Maqifrnswa"
From #openttdcoop wiki
Maqifrnswa (Talk | contribs) |
Maqifrnswa (Talk | contribs) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
See my [[New Player Pointers]] | See my [[New Player Pointers]] | ||
− | + | = game mechanics = | |
− | * | + | |
− | * | + | Formulas: |
+ | (un)loaded per tick = (load_amount / 40)*(num_cars_loading) | ||
+ | maximum primary produced per tick = default_level/32 | ||
+ | line carry capacity per tick per track = TC * velocity_tile_per_tck / (TL+gap) | ||
+ | TC = train cargo | ||
+ | TL = train length | ||
+ | 100 kmh = 3.6 tile/day = 3.6/74 tile_per_tick | ||
+ | velocity_tile_per_tick = 2056 * velocity_in_kmh | ||
+ | line carry capacity per tick per track = TC * 2056 * velocity_in_kmh / (TL+gap) | ||
+ | |||
+ | |||
+ | Conclusions: | ||
+ | Max station num cars = default_prod_level/load_amount* 1.25 | ||
+ | Max MAIN station num cars = TC * velocity_in_kmh/ load amount / (TL+gap)/51 | ||
+ | |||
+ | 420*(10)*133/6/51 | ||
+ | note that it is cars, not tiles. | ||
+ | |||
+ | |||
+ | == cargo delivery to stations == | ||
+ | Every day is 74 ticks. every 256 ticks cargo is delivered to stations (8 or 9 times a month, every 3.5 days). The default amount of cargo produced is in src/table/build_industry.h. The amount delivered can be 1/8, 1/4, 1/2, 1x, 2x, 4x, or 8x of the default value, depending on level of production. | ||
+ | |||
+ | Coal 15, Wood 13, Oil rig 15, oil well 12, livestock 10, Grain 10, copper 10, bank 6, gold 7, diamond 7, iron 10, water 12, maize 11. | ||
+ | |||
+ | So the max an industry can produce is ~1100/month (coal). More precisely, 0.46875 per tick = 18.75 per 40 ticks (one train load cycle). Assuming 100% delivery (which never happens...) and the default 5 cargo loaded on to one train car per 40 ticks, 4 loading train cars (2 tiles) are needed to keep up with production. Those 2 tiles need to be constantly occupied, so parallel tracks are needed. Therefore, a station of 2 tracks for a train length of 3 should keep up with demand (although require a constant stream of trains!). To burn down excess supply at a station, more tracks (and/or longer trains) would be needed. | ||
+ | |||
+ | == vehicle loading rates == | ||
+ | When a vehicle is loading, cargo is loaded every: 40 ticks for trains, 20 ticks for planes/road vehicles, or 10 ticks for ships. Each individual train car adds cargo every loading event, so longer trains load more per tick than short trains. The default amount of cargo loaded is seen below: | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+Default Vehicle Loading Rates | ||
+ | |- | ||
+ | !Type | ||
+ | !Ticks per Load | ||
+ | !Units Cargo Loaded Per Load | ||
+ | |- | ||
+ | |Train | ||
+ | |40 | ||
+ | |5 | ||
+ | |- | ||
+ | |Road | ||
+ | |20 | ||
+ | |5 | ||
+ | |- | ||
+ | |Ship | ||
+ | |10 | ||
+ | |10 | ||
+ | |- | ||
+ | |Air | ||
+ | |20 | ||
+ | |20 for all except mail (5 for mail) | ||
+ | |} | ||
+ | From: (src/economy.cpp "const uint gradual_loading_wait_time[] = { 40, 20, 10, 20 }", order is enumerated in src/vehicle_type.h) | ||
+ | src/tables/engines.h. NewGRFs define the loading_speed property which is not visible in the client (maybe it should be?). It is in the item "property" or "graphics" setting. for example, brickwalker in NUTS has a loading_speed=2. | ||
+ | |||
+ | |||
+ | Air Mail is funky, according to src/economy.cpp | ||
+ | |||
+ | /* The default loadamount for mail is 1/4 of the load amount for passengers */ | ||
+ | bool air_mail = v->type == VEH_AIRCRAFT && !Aircraft::From(v)->IsNormalAircraft(); | ||
+ | if (air_mail) load_amount = CeilDiv(load_amount, 4); | ||
+ | |||
+ | From (src/aircraft_cmd.cpp), mail is carried by the airplane's shadow! that's why you need to check if it is not a normal aircraft (but its shadow!) | ||
+ | |||
+ | |||
+ | 1 unit of cargo is defined in the default OpenGRF as: | ||
+ | {| class="wikitable" | ||
+ | ! Cargo !! Multiplier !! Meaning | ||
+ | |- | ||
+ | | PASS || 4 || A vehicle carrying 1 ton of coal, can carry 4 passengers. | ||
+ | |- | ||
+ | | MAIL || 2 || A vehicle carrying 1 ton of coal, can carry 2 bags of mail. | ||
+ | |- | ||
+ | | GOOD, SWET || 2 || A vehicle carrying 1 ton of coal, can carry 2 crates of goods/sweets. | ||
+ | |- | ||
+ | | (everything else) || 1 || All other slots default to 1, i.e. 1 unit of cargo equals 1 ton of coal. | ||
+ | |} | ||
+ | source: https://newgrf-specs.tt-wiki.net/wiki/Action0Cargos and src/table/cargo_const.h | ||
+ | |||
+ | = notes = | ||
rate equiations | rate equiations | ||
Line 21: | Line 100: | ||
* start with furthest station, make all other stations merge with sideline with priority given to furthest station | * start with furthest station, make all other stations merge with sideline with priority given to furthest station | ||
* optimize flow from furthest station (overload with trains such that waiting cargo goes to 0, and overflow is full. wait for steady state | * optimize flow from furthest station (overload with trains such that waiting cargo goes to 0, and overflow is full. wait for steady state | ||
− | * when at steady state (i.e., multiple round trips of trains generated on demand) delete excess trains in overflow from furthest station. this station now generates trains on demand. Excess trains mean the total trains servicing the station should be round trip time times industry generation rate | + | * when at steady state (i.e., multiple round trips of trains generated on demand) delete excess trains in overflow from furthest station. this station now generates trains on demand. Excess trains mean the total trains servicing the station should be round trip time times industry generation rate. At steady state, a train is returning to station as often as it is being generated, so any train in overflow is excess! |
* move to next closest station, repeat. | * move to next closest station, repeat. | ||
* at end, each station will generate trains on demand. If, in steady state, on track never moves (because it has worst priority) - that means you need a second sideline. Start it from there, and all later stations merge with this new one. | * at end, each station will generate trains on demand. If, in steady state, on track never moves (because it has worst priority) - that means you need a second sideline. Start it from there, and all later stations merge with this new one. | ||
* repeat | * repeat | ||
* if you added sideline out, will also need to add a new sideline in | * if you added sideline out, will also need to add a new sideline in |
Latest revision as of 01:00, 9 August 2016
See my New Player Pointers
game mechanics
Formulas:
(un)loaded per tick = (load_amount / 40)*(num_cars_loading) maximum primary produced per tick = default_level/32 line carry capacity per tick per track = TC * velocity_tile_per_tck / (TL+gap) TC = train cargo TL = train length
100 kmh = 3.6 tile/day = 3.6/74 tile_per_tick
velocity_tile_per_tick = 2056 * velocity_in_kmh line carry capacity per tick per track = TC * 2056 * velocity_in_kmh / (TL+gap)
Conclusions:
Max station num cars = default_prod_level/load_amount* 1.25 Max MAIN station num cars = TC * velocity_in_kmh/ load amount / (TL+gap)/51
420*(10)*133/6/51 note that it is cars, not tiles.
cargo delivery to stations
Every day is 74 ticks. every 256 ticks cargo is delivered to stations (8 or 9 times a month, every 3.5 days). The default amount of cargo produced is in src/table/build_industry.h. The amount delivered can be 1/8, 1/4, 1/2, 1x, 2x, 4x, or 8x of the default value, depending on level of production.
Coal 15, Wood 13, Oil rig 15, oil well 12, livestock 10, Grain 10, copper 10, bank 6, gold 7, diamond 7, iron 10, water 12, maize 11.
So the max an industry can produce is ~1100/month (coal). More precisely, 0.46875 per tick = 18.75 per 40 ticks (one train load cycle). Assuming 100% delivery (which never happens...) and the default 5 cargo loaded on to one train car per 40 ticks, 4 loading train cars (2 tiles) are needed to keep up with production. Those 2 tiles need to be constantly occupied, so parallel tracks are needed. Therefore, a station of 2 tracks for a train length of 3 should keep up with demand (although require a constant stream of trains!). To burn down excess supply at a station, more tracks (and/or longer trains) would be needed.
vehicle loading rates
When a vehicle is loading, cargo is loaded every: 40 ticks for trains, 20 ticks for planes/road vehicles, or 10 ticks for ships. Each individual train car adds cargo every loading event, so longer trains load more per tick than short trains. The default amount of cargo loaded is seen below:
Type | Ticks per Load | Units Cargo Loaded Per Load |
---|---|---|
Train | 40 | 5 |
Road | 20 | 5 |
Ship | 10 | 10 |
Air | 20 | 20 for all except mail (5 for mail) |
From: (src/economy.cpp "const uint gradual_loading_wait_time[] = { 40, 20, 10, 20 }", order is enumerated in src/vehicle_type.h) src/tables/engines.h. NewGRFs define the loading_speed property which is not visible in the client (maybe it should be?). It is in the item "property" or "graphics" setting. for example, brickwalker in NUTS has a loading_speed=2.
Air Mail is funky, according to src/economy.cpp
/* The default loadamount for mail is 1/4 of the load amount for passengers */ bool air_mail = v->type == VEH_AIRCRAFT && !Aircraft::From(v)->IsNormalAircraft(); if (air_mail) load_amount = CeilDiv(load_amount, 4);
From (src/aircraft_cmd.cpp), mail is carried by the airplane's shadow! that's why you need to check if it is not a normal aircraft (but its shadow!)
1 unit of cargo is defined in the default OpenGRF as:
Cargo | Multiplier | Meaning |
---|---|---|
PASS | 4 | A vehicle carrying 1 ton of coal, can carry 4 passengers. |
2 | A vehicle carrying 1 ton of coal, can carry 2 bags of mail. | |
GOOD, SWET | 2 | A vehicle carrying 1 ton of coal, can carry 2 crates of goods/sweets. |
(everything else) | 1 | All other slots default to 1, i.e. 1 unit of cargo equals 1 ton of coal. |
source: https://newgrf-specs.tt-wiki.net/wiki/Action0Cargos and src/table/cargo_const.h
notes
rate equiations
pick up station
- generation rate
- loading rate * station size
- what limits: track capacity, loading rate or generation rate?
- ideal, limit by generation rate. Generation rate determines min number of station tracks, and number of station tracks determines sideline size
Drop off station size
- limited by input capacity, which is = number of input tracks * max track capacity
- min number of stations tracks determined by number of input tracks (make unload capacity = loading capacity)
clearing sideline jams:
- start with furthest station, make all other stations merge with sideline with priority given to furthest station
- optimize flow from furthest station (overload with trains such that waiting cargo goes to 0, and overflow is full. wait for steady state
- when at steady state (i.e., multiple round trips of trains generated on demand) delete excess trains in overflow from furthest station. this station now generates trains on demand. Excess trains mean the total trains servicing the station should be round trip time times industry generation rate. At steady state, a train is returning to station as often as it is being generated, so any train in overflow is excess!
- move to next closest station, repeat.
- at end, each station will generate trains on demand. If, in steady state, on track never moves (because it has worst priority) - that means you need a second sideline. Start it from there, and all later stations merge with this new one.
- repeat
- if you added sideline out, will also need to add a new sideline in