Game Mechanics
Manuale OpenTTD
Installazione · Tutorial
FAQ · Interfaccia del gioco
Readme.txt (en)
Costruzione

Ferrovie :

Segnali · Stazioni · Scambi · Capacità di carico · Pianificazione e consigli
Strade · Tram · Canali · Aeroporti · Modifica del territorio
Veicoli (en)
Treni · Veicoli su strada (en) · Navi (en) · Aerei (en) · Ordini (en)
Configurazione
Opzioni del gioco · Difficoltà (en) · Configurazioni avanzate (en) · Configurazioni IA (en) · Grafica personalizzata · Trucchi (en)
Altri argomenti
Città · Economia · Industrie · Disastri · Consigli · Caratteristiche nascoste · Accesso rapido · Console (en) · Meccanica del gioco · Giocatori multipli · Editor dello scenario · Contenuti online
Risoluzione di problemi · Link

Qui puoi trovare informazioni su come OpenTTD calcola i dati in gioco.

Hai sempre voluto sapere come è stata costruita la valutazione della stazione? Come funziona la distribuzione delle merci? Qui puoi trovarlo!

Contents

Valutazione della Compagnia

Each part of the company rating is a linear function, ie. earning 50% of the target for a component will give 50% of the points allocated for that component. Where components involve monetary amounts, these are converted to the currency of the current game; internally these amounts are stored as the pound amount.

Component Target Points (min) Points (max) Percentage
Vehicle count >=120 0 points for 0 vehicles 100 points for at least 120 vehicles 0 to 10%
Number of station parts company owns >=80 0 points for 0 parts 100 points for at least 80 parts 0 to 10%
Lowest profit of vehicles at least two years old >=£10,000 0 points for loss or £0 100 points for at least £10,000 0 to 10%
Lowest quarterly revenue earned in past 3 years >=£50k 0 points for £0 50 points for at least £50k 0 to 5%
Highest quarterly revenue earned in past 3 years >=£100k 0 points for £0 100 points for at least £100k 0 to 10%
Units of cargo delivered in past year >=40,000 0 points for 0 units 400 points for at least 40,000 units 0 to 40%
Number of types of cargo delivered in past quarter >=8 0 points for 0 cargo-types 50 points for at least 8 cargo-types 0 to 5%
Current cash in bank >=£10m 0 points for £0 50 points for at least £10m 0 to 5%
Current loan from bank £0 0 points for >£250k 50 points for £0 0 to 5%
Totals

0 points 1000 points 0 to 100%
Company League Table ratings
Rating Title
0 to 127 Engineer
128 to 255 Traffic Manager
256 to 383 Transport Coordinator
384 to 511 Route Supervisor
512 to 639 Director
640 to 767 Chief Executive
768 to 895 Chairman
896 to 959 President
960 to 1000 Tycoon
2050 High Score ratings
Rating Title
0 to 319 Businessman
320 to 447 Entrepreneur
448 to 575 Industrialist
576 to 703 Capitalist
704 to 831 Magnate
832 to 959 Mogul
960 to 1000 Tycoon of the Century

Station rating

This section shows the factors that affect the station rating. All calculations are done separately for each cargo type.

Factor Condition Rating points Rating %
Max speed of last vehicle to load cargo (to a max of 255 km/h)
Divide speed by 2 if it was a road vehicle.
Above 85 km/h (52 mph) (Speed (km/h) - 85) / 4 0% to 17%
Age in years of last vehicle to load cargo 2 10 4%
1 20 8%
0 33 13%
Days since last cargo pickup
Multiply days in "Condition" column by 4 if last vehicle was a ship.
(Note: If a vehicle was ready to pick up a cargo but there was no cargo, it is regarded as a cargo pickup anyhow)
30 to 52,5 25 10%
15 to 30 50 20%
7.5 to 15 95 37%
less than 7.5 130 51%
Units of cargo waiting at station More than 1500 -90 -35%
1001 to 1500 -35 -14%
601 to 1000 0 0%
301 to 600 10 4%
101 to 300 30 12%
less than 100 40 16%
Statue in town of station Built 26 10%
Small advertising campaign Station within 10 tiles of town center +64 +25%
Medium advertising campaign Station within 15 tiles of town center +112 +44%
Large advertising campaign Station within 20 tiles of town center +160 +63%
Road vehicle crashed Station within 22 tiles of crash -160 -63%
Train crashed Station within 30 tiles of crash -160 -63%

Divide the total rating points by 255 to get the percent rating. The maximum possible rating is 100%. Advertising campaigns give an instant, temporary boost to ratings of nearby stations. The boost will gradually fall down to the calculated rating.

The amount of cargo that can be transported from an industry is fully reliant on the station rating. So if the amount of cargo transported from an industry is low, it is probably because the station rating is low, too.

Every 2.5 days station ratings are computed; ratings can't change by more than 2 points per cycle, except after crashes.

Note: The exact formula can be seen under "UpdateStationRating()" in station_cmd.cpp. This uses some values calculated in "LoadUnloadVehicle()" in economy.cpp.

Note: If the rating gets less than 50%, the station starts losing cargo.

Cargo delivery to stations

During each cycle of 2.5 days for each cargo type of the delivering industry a maximum of 2 stations can get cargo assigned. If there are more than 2 possible stations with the same maximum rating value for the current cargo type then it depends on internal ordering of the stations which ones get the cargo.

If there's only one possible station then the delivered amount is: produced_amount * station_rating_in_percent, rounded up to the next integer value.

For two possible stations the calculation is more complex. First the rating in points of station 2 is divided by 2 for the further local calculations. The amount available to station 1 is calculated as follows: (station_rating_in_points1 * (amount + 1)) / (station_rating_in_points1 + station_rating_in_points2); for similar ratings this is about 2/3 of the production, it increases for larger differences. The result is subject to the same calculation as in the single station case. This is delivered to station 1. If station 1 doesn't get the full amount available to it then that part won't be transported at all. The remaining amount of the production, if any, is subject to the same calculation as in the single station case and delivered to station 2.

Local authority rating

Ratings limit some player actions; they start at +500 and can change based on some actions.

Currently you can exploit the game by planting about 200 trees within a town's influence radius. You may need to clear an area first, in order to have somewhere to plant them, but planting 200 will raise even a minimum rating of -1000 to 220. If your rating is Mediocre or lower, planting 30 trees will approximately wipe out the rating penalty from building one station. Planting trees while at a rating of Very Good or better has no effect.

Rating points Rating
-1000 to -400 Atrocious
-399 to -200 Very Poor
-199 to 0 Poor
0 to 200 Mediocre
201 to 400 Good
401 to 600 Very Good
601 to 800 Excellent
801 to 1000 Outstanding
Player action Required rating* Effect on rating
Build a station -200 n/a
Destroy an 'edge' piece of road 16 / 64 / 112 -18, down to -100.
Destroy an 'inner' piece of road 16 / 64 / 112 -50, down to -100.
Destroy a city tunnel or bridge 144 / 208 / 400 -250, down to 0.
Destroy building** 40 to 300 -40 to -300
Plant tree on clear square n/a +7, up to 220.
Clear a tile with trees n/a -35
Successful bribe n/a +200, up to 800.
Unsuccessful bribe n/a Set to -50.
* "Required rating" is listed for the settings Permissive / Neutral / Hostile of
the Difficulty (en) option City council attitude towards area restructuring.
** For default buildings. NewGRFs can set this number from 0 to >1000,
which effectively makes the building unremovable.

Each month players' ratings automatically change:

Example:
A player has a rating of -300, (Very Poor), 2 active stations and 1 inactive station at a town.
5pts + 2 * 12pts - 15pts = 14pts points gain per month.
(-200 - -300)pts / 14pts/mo = 8 months before the town will let him build another station.

Code for town ratings is in town.h, town_cmd.c, tree_cmd.c, and road_cmd.c.

Industry production

Here is how the game determines how much cargo an industry produces per month. Production of raw materials happens 8 or 9 times per month. (It happens every 256 ticks. There are 74 ticks in a day, and 28 to 31 days in a month (date_type.h). This means that only about 9% of industries will produce 9 times in a 28-day February, but about 96% of industries will produce 9 times in a 31-day month like March.) The production will always be a multiple of 8 or 9, unless the industry changed production during that month.

This table lists possible starting productions governed by the smooth economy patch. These numbers are multiples of 8. When the game generates a new map, each industry produced 8 times and had no production changes in the December before the game started.

Raw Material Industry Produced Cargo Initial production range
Coal Mine (en) Coal 56 to 176
Forest (en) Wood 48 to 152
Oil Rig (en) Oil 56 to 176
Farm (en) Grain and Livestock 40 to 112
Copper Ore Mine (en) Copper Ore 56 to 112
Oil Wells (en) Oil 48 to 152
Iron Ore Mine (en) Iron Ore 40 to 112
Bank (en) (temperate) Valuables 24 to 64

Gold Mine (en) Gold 24 to 80

Diamond Mine (en) Diamonds 24 to 80
Fruit Plantation (en) Fruit 40 to 112
Rubber Plantation (en) Rubber 40 to 112
Water Supply (en) Water 48 to 152
Farm (en) Maize 40 to 128
Lumber Mill (en) Wood 180 or 225 (if trees available)

Candyfloss Forest (en) Cotton Candy 48 to 152
Battery Farm (en) Batteries 40 to 128
Cola Wells (en) Cola 48 to 136
Plastic Fountains (en) Plastic 56 to 160
Bubble Generator (en) Bubbles 48 to 152
Toffee Quarry (en) Toffee 40 to 112
Sugar Mine (en) Sugar 40 to 128

(To calculate this table, look under _origin_industry_specs in table/build_industry.h for the industry and its cargo. The sugar mine has CT_SUGAR, 11, so the production starts at 11. Apply the formula from DoCreateNewIndustry() in industry_cmd.cpp: multiply the production by a random integer from 128 to 383, then divide by 256, rounding down. So 11 becomes 5 to 16. Finally, multiply it by 8 to get 40 to 128.)

Production change

Each month the game randomly changes some industry productions.

Default / TTD-like Economy Rules

For 256x256 tile maps there is one change per month possible (only 1 industry changes). Number scales nicely with map size since the introduction of "Daily production changes" function in trunk (r14332).

However - productions are limited to 6 production levels: lowest, lower, normal (with a new game started or a new industry built), higher, 2x higher and the highest. Production changes between these levels are either a 50% decrease (half) or a 100% increase (double).

To make things simple, let's look what are the chances for 256x256 maps (max. 1 change per month = max. 1 industry per month changes production):

Smooth Economy Rules

Distinguish Smooth economy (advanced setting) and Steady economy (difficulty setting)

Examples

If a coal mine has 70% of its output transported, there is a 3% chance (4.5% * 67%) of a production increase from 3-23% and a 1.5% chance (4.5% * 33%) of a production decrease from 3-23% (but 13% on average).

(1 + (0.03 - 0.015) * 0.13) ^12 - 1 = 0.0237 or 2.37%

The coal mine will grow an average of 2.37% after the first year
(1.0237 ^20) - 1 = 59.6% after twenty years
(1.0237 ^50) - 1 = 321.8% or 3.22x after fifty years
(1.0237 ^100) - 1 = 10.35x after one hundred years

For an industry with rating of more than 80%, there is a 3.75% chance of increase and 0.75% chance of decrease:
(1 + (.0375 - 0.0075) * .13) ^12 - 1 = 0.0478 or 4.78%

The industry will grow approximately 4.78% after first year
(1.0478 ^20) - 1 = 2.54x after twenty years
(1.0478 ^50) - 1 = 10.32x after fifty years
(1.0478 ^100) - 1 = 106.62x after one hundred years

For good service, it takes 29.6 years on average to double; with excellent service, it takes 14.8 years. If in the game's time a day is 2.36 seconds, then the doubling time with good service is 7.1 hours; with excellent service, the doubling time is 3.6 hours. For production to go from near bottom of 100 to near maximum of 2100 takes 130 years with good service and 65 years with excellent service.

However, in game you will find industries changing their production rate very randomly. It must be stressed the above examples are only true when observing many industries over the long-term; individual industries may greatly deviate from these averages. Statistically speaking, 6 out of 10 industries will not go from 100 to 2100 even with the best service during 65 years. About 1 out of 9 industries will even lower their production when being served at 60-80% cargo transported for 50 years.

For more responsiveness from industries, adapt the number of wagons to industry production (for the lowest production, you should use two wagons). [Full Load] orders are usually used for such cargo trains.

Note: The exact formula can be seen under "ChangeIndustryProduction()" in industry_cmd.cpp.

Tassi di pagamento alla consegna

The amount you get paid for delivering cargo is based on 4 factors: the amount of cargo you deliver, the value of the cargo, the distance you deliver it, and how on-time you deliver it.

Cargo Units Early Delivery
Time (days)
Late Delivery
Time (days)
Initial cargo
payment (pounds)
Passengers (en)

Immediate 24 £39
Valuables (en) Bags 1 32 £91
Livestock (en) Items 4 18 £53
Grain (en) Tons 4 40 £58
Goods (en) Crates 5 28 £75
Coal (en) Tons 7 None £72
Steel (en) Tons 7 None £69
Iron Ore (en) Tons 9 None £62
Wood (en) Tons 15 None £61
Oil (en) Kiloliters 25 None £54
Mail (en) Bags 20 90 £55
Arctic specific
Wheat (en) Tons 4 40 £58
Paper (en) Tons 7 60 £66
Gold (en) Bags 10 40 £71
Food (en) Tons Immediate 30 £69
Tropical specific
Rubber (en) Kiloliters 2 20 £54
Fruit (en) Tons Immediate 15 £51
Maize (en) Tons 4 40 £53
Tropical Wood (en) Tons 15 None £97
Copper Ore (en) Tons 12 None £59
Water (en) Kiloliters 20 80 £57
Diamonds (en) Bags 10 None £71
Toyland specific
Sugar (en) Tons 20 None £54
Toys (en)

25 None £68
Batteries (en)

2 30 £53
Sweets (en) Tons 8 40 £75
Toffee (en) Tons 14 60 £58
Cola (en) Kiloliters 5 75 £59
Candyfloss (en) Tons 10 25 £61
Bubbles (en)

20 80 £62
Plastic (en) Kiloliters 30 None £54
Fizzy Drinks (en)

30 50 £76

Initial cargo payment values are for delivering 100 pieces of cargo 1 tile. Payment goes up with inflation as the game progresses.

Late delivery penalties:

Examples (no inflation):
Deliver 200,000 liters of oil 20 squares in 10 days:
2 * £54 * 20 squares * 100% = £2160

Deliver 100 bags of mail 100 squares in 100 days:
£55 * 100 squares * (1 - 80*0.004 - 10*0.004) = £3520

HINT calculate easy:
Income = cargo units * cargo value * 0,4
Cargo value (en) comes from the Y-axis on the specific transported goods graph in-game
measure your real delivery time in days and plot on x-axis This result will give you an easy estimation of your income with 5% deviation

Notes:

Vehicle speeds

Internally OpenTTD works with a unit called "km-ish/h", which is equal to "mph/1.6". The conversion factor from km-ish/h to km/h is 1.00584, and the conversion factor from km-ish/h to mph is 1.6.

A tile is, for vehicle speed purposes 664.(216) km-ish, 668 km or 415 miles long. This is based on the following facts:

Now assume a vehicle going 1 km-ish/hour: (1 * 16 * 256) / (74 * 2) * 24 = 664.(216).

The net result is that 100 km/hour is ~3.6 tiles/day.

Aircraft

Road Vehicles

(Note: This does not apply when using the improved road vehicle acceleration model.)

Ships

Trains

(with the realistic train acceleration patch)

Curvature Max speed (km/h)
Railroad Monorail Maglev
0 (90° turn) 61 91 121
1 (2x45° turn) 88 132 176
2 111 166 221
3 132 198 264
4 151 226 301
5 168 252 336
6 183 274 365
7 196 294 392
8 207 310 413
9 216 324 432
10 223 334 445
11 228 342 456
12+ 231 346 461
Curvature Max speed (mi/h)
Railroad Monorail Maglev
0 37 56 75
1 54 82 109
2 68 103 137
3 82 123 164
4 93 140 187
5 104 156 208
6 113 170 226
7 121 182 243
8 128 192 256
9 134 201 268
10 138 207 276
11 141 212 283
12+ 143 214 286

"Curvature" means the average number of wagons of the train between turns. However, very sharp turns (curvatures 0 and 1) are not averaged out in longer trains.

/File/en/Manual/Game Mechanics/Speed-limits.png

See also: Realistic acceleration (en) and Corners (en).

See ground_vehicle.cpp, aircraft_cmd.cpp, roadveh_cmd.cpp, ship_cmd.cpp, train_cmd.cpp, vechicle.cpp for code.

As of OpenTTD 1.6.1, given power in hp, max tractive effort in kN, total weight of the train in tonnes, the number train parts (engines and wagons), the air drag value of the first engine in the train (NewGRF setting, defaults to min(192,max(1,floor(2048/max_speed))), meaning faster trains are built more aerodynamically), the combined weight of any train parts (engines or wagons) currently on an up-slope, the combined weight of any train parts (engines or wagons) currently on a down-slope, the slope steepness (game setting [1-10], default 3), and the current speed of the train in km/h, the acceleration of a non-maglev train can be calculated as follows:

force = min((max_te * 1000), floor((power * 746) / (current_speed * 5/18))) [N]

slope_force = weight_on_upslope * slope_steepness * 100 - weight_on_downslope * slope_steepness * 100 [N]

axle_friction = total_weight * 10 [N]

rolling_friction = total_weight * 15 * (1 + floor(current_speed / 512)) [N]

air_drag_coefficient = 14 * floor(air_drag_value * (1 + number_of_parts * 3/20)) / 1000

air_drag = floor(air_drag_coefficient * current_speed^2) [N]

acceleration = (force - (slope_force + axle_friction + rolling_friction + air_drag)) / (total_weight * 4) [256th of a km/h per half-tick]

Note: air_drag_coefficient is twice that if any part of the train is in a tunnel

Given the same values, the equilibrium speed, eg the speed the train would eventually settle on if the same conditions continued indefinitely, can be calculated as follows [Assuming a constant rolling_friction (ie the speed stays below 512 km/h), and ignoring the flooring of force and air_drag to an integral value]:

p = (slope_force + axle_friction + rolling_friction) / air_drag_coefficient

q = (-power * 746 * 18/5) / air_drag_coefficient

C = (27/2*q + ((27/2*q)^2 + 27*p^3)^(1/2))^(1/3)

equilibrium = min(max_speed, p/C - C/3, max(0, max_te * 1000 / air_drag_coefficient - p)^(1/2))

Crescita delle città

Vedi Crescita delle città.