Game mechanics

From OpenTTD

Jump to: navigation, search

Here you can find information about how OpenTTD calculates in-game figures.

You always wanted to know how the station-rating was built up? How goods-distribution works? Here you can find it!

Contents

[edit] Player rating

Each part of the player 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)
Vehicle count>=1200 points for 0 vehicles100 points for at least 120 vehicles
Number of station parts player owns>=800 points for 0 parts100 points for at least 80 parts
Minimum profit of vehicles at least two years old>=£10,0000 points for loss or £0100 points for at least £10,000
Minimum monthly revenue earned in past 3 years>=£50k0 points for £050 points for at least £50k
Maximum monthly revenue earned in past 3 years>=£100k0 points for £0100 points for at least £100k
Units of cargo delivered in past year>=40,0000 points for 0 units400 points for at least 40,000 units
Number of types of cargo delivered in past quarter>=80 points for 0 cargo-types50 points for at least 8 cargo-types
Current cash in bank>=£10m0 points for $050 points for at least £10m
Current loan from bank£00 points for >£250k50 points for £0
Totals 0 points 1000 points
Company League Table ratings
RatingTitle
0 to 127Engineer
128 to 255Traffic Manager
256 to 383Transport Coordinator
384 to 511Route Supervisor
512 to 639Director
640 to 767Chief Executive
768 to 895Chairman
896 to 959President
960 to 1000Tycoon
2050 High Score ratings
RatingTitle
0 to 319Businessman
320 to 447Entrepreneur
448 to 575Industrialist
576 to 703Capitalist
704 to 831Magnate
832 to 959Mogul
960 to 1000Tycoon of the Century

[edit] Station rating

This section shows the factors that affect how much of an industry's product is delivered to to a station.

FactorConditionRating pointsRating %
Max speed of last vehicle entering station Above 85 km/h (52 mph) (Speed (km/h) - 85) / 4 0% to 17%
Age in years of last vehicle entering station 2 10 4%
1 20 8%
0 33 13%
Days since last cargo pickup (If a vehicle was ready to pick up a cargo but there was no cargo, it is regarded as a cargo pickup anyhow)
Multiply days by 4 if last vehicle was a ship.
32,5 to 52,5 25 10%
17,5 to 32,5 50 20%
10 to 17,5 95 37%
less than 10 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 stationBuilt26 10%
Small advertising campaignStation within 10 tiles of town center+64 +25%
Medium advertising campaignStation within 15 tiles of town center+112 +44%
Large advertising campaignStation within 20 tiles of town center+160 +63%
Road vehicle crashedStation within 22 tiles of crash -160 -63%
Train crashedStation within 30 tiles of crash -160 -63%

Divide the total rating points by 256 to get the percent rating. The maximum possible rating is 99%. Advertising campaigns give an instant, temporary boost to ratings of nearby stations.


Every 2.5 days station ratings are computed; ratings can't change by more than 2% per cycle.

[edit] 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 clearing ~200 trees and then replanting them. This sets the rating to -1000 (the minimum), and then raises it to 220.

Rating pointsRating
-1000 to -400 Appalling
-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 actionRequired ratingEffect on rating
Build a station -200 n/a
Destroy an 'edge' piece of road 0 / 48 / 96 -18
Destroy a 'centre' piece of road 0 / 48 / 96 -50
Destroy a city tunnel or bridge 128 / 192 / 384 -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 as Permissive / Neutral / Hostile.

Each month players' ratings automatically change:

  • Rating goes up by 5 if it is less than 200.
  • Rating goes up by 12 for each station that has transferred cargo in the last 50 days.
  • Rating goes down by 15 for each station that has not transferred cargo in the last 50 days.


Example:
A player has a rating of -300, (Very Poor), 2 active stations and 1 unactive 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.

[edit] Industry production

Here is how the game determines how much cargo an industry produces per month. This section lists production governed by the default smooth economy patch. Production is a multiple of 8 or 9 (sometimes 10 with forests).

Raw Material IndustryProduced CargoInitial production range
Coal MineCoal56 to 176
ForestWood48 to 152
Oil RigOil56 to 176
FarmGrain and Livestock40 to 112
Copper MineCopper Ore56 to 112
Oil WellOil48 to 152
Iron MineIron Ore40 to 112
BankValuables24 to 64
Gold MineGold24 to 80
Diamond MineDiamonds24 to 80
Fruit PlantationFruit40 to 112
Rubber PlantationRubber40 to 112
Water SupplyWater48 to 152
FarmMaize40 to 128
Lumber MillWood0
Cotton Candy ForestCotton Candy48 to 152
Battery FarmBatteries40 to 128
Cola WellsCola48 to 136
Plastic FountainPlastic56 to 160
Bubble GeneratorBubbles48 to 152
Toffee QuarryToffee40 to 112
Sugar MineSugar40 to 128

[edit] Production change

Each month the game randomly changes some industry productions.

[edit] Rules

  • There is a 4.5% chance for a production change each month.
    • Out of those 4.5% if industries are not connected (lack of any service or poor service - <60%) chance of increase is 33% - industries are gradually (mainly) decreasing production because they cannot sustain their operation (no or not enough revenue - to pay the workers etc.) - till their closure.
    • When there is interest for the industry/good transport service (>60%) there is a 67% (out of those 4.5%) chance for increase of production due to good service.
    • If the service achieves excellent or outstanding ratings (>80%), industry tries to fill the increased demand for cargo. Chance of increase is 83% (out of those 4.5%).
  • Production changes per month with smooth economy are random, between 3 and 23%, more for very low productions of 12-40 tonnes per month.
  • Maximum production is 2040 or 2195 units of cargo per month (= 8x or 9x 255).

[edit] Examples

A coal mine has 70% of its output transported: Percent of transported cargo is over 60% (very good service), so there's 3% chance for 3-23% (random) increase. Of course due to unforseen circumstances, the production can also go down (1.5% chance) for 3-23% (13% on average).

((1 + (3.0% - 1.5%) * 13%) ^ 12) - 1 ~ 2.36%, the coal mine will grow an average of 2.37% after the first year.
1.0236 ^ 20 - 1 ~ 59.6% after twenty years.
1.0236 ^ 50 - 1 ~ 321.8% after fifty years (x4.21 times).
1.0236 ^ 100 - 1 ~ 1035% after one hundred years (x11.3 times).

Industry with rating of more than 80%:
((1 + (3.75% - 0.75%) * 13%) ^ 12) - 1 ~ 4.78%, will grow approximately 4.78% after first year, 2.54 times after twenty years, 10.3 times after 50 years and 106.8 times after 100 years (note: over maximum).

It takes about 65 years to go from 100 to 2100 with bigger than 80% industry rating and about 130 years with a rating of 60-80%.

Unfortunately, in real life circumstances you will find industries changing their production rate very randomly and mentioned formula is true only with many examples and their average. For example, statistically out of 10 industries 6 will not manage to go from 100 to 2100 even with the best service during 65 years. And about 1 out of 9 industries will even lower their production when being served at 60-80% for 50 years.

However, practice shows that the latter statistic doesn't hold true, especially with trains (variable lengths) that wait no longer than 1 month at the station. So - for more responsiveness from industries - adapt the number of wagons to production (lowest should be two wagons - for the lowest productions). Full load orders are usually used for such cargo trains.


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

[edit] Delivery payment rates

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.

CargoUnitsEarly Delivery
Time (days)
Late Delivery
Time (days)
Initial cargo
payment (pounds)
Passengers Immediate24£39
ValuablesBags132£91
LivestockItems418£53
GrainTons440£58
GoodsCrates528£75
CoalTons7None£72
SteelTons7None£69
Iron OreTons9None£62
WoodTons15None£61
OilKiloliters25None£54
MailBags2090£55
Arctic specific
WheatTons440£58
PaperTons760£66
GoldBags1040£71
FoodTonsImmediate30£69
Tropical specific
RubberKiloliters220£54
FruitTonsImmediate15£51
MaizeTons440£53
Tropical WoodTons15None£97
Copper OreTons12None£59
WaterKiloliters2080£57
DiamondsBags10None£71
Toyland specific
SugarTons20None£54
Toys 25None£68
Batteries 230£53
CandyTons840£75
ToffeeTons1460£58
ColaKiloliters575£59
Cotton CandyTons1025£61
Bubbles 2080£62
PlasticKiloliters30None£54
Fizzy Drinks 3050£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:

  • For each day after the Early Delivery time that you deliver the cargo, you are penalized 0.4%.
  • For each day after the Late Delivery time that you deliver the cargo, you are penalized an additional 0.4%.
  • Maximum penalty is -88%.


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


Notes:

  • The exact formula is much more complicated. See economy.c.
  • Distance is measured between the stations, not from the industries or by vehicle distance traveled. It is computed by adding the differences in x and y tiles, not straight-line distance.

[edit] Vehicle speeds

The game has many rules to make vehicles move fairly realistically. A vehicle travelling at 100 mph (160kph) will cross 5.6 tiles per day.

This means that for vehicle speed purposes, a tile is 429 miles (686km) on a side!


Aircraft:

  • By default aircraft fly at a quarter of their listed speed (this can be changed in patch settings).
  • Aircraft accelerate at about 200 km/h/day. It varies per aircraft.
  • Broken down planes fly at 345 km/h.
  • Airport taxi speed is 154 km/h.


Road Vehicles:

  • Road vehicles accelerate at 37 km/h/day.
  • Road vehicles go around corners at half their max speed
  • Road vehicles accelerate an additional 74 km/h/day downhill.
  • When going uphill, road vehicles slow down 10% 4 times per tile. This balances out with acceleration at 34 km/h for all road vehicles.


Ships:

  • Ships accelerate at 37km/h/day.
  • A "stopped" ship resumes it's last speed instantly.


Trains: (with the realistic train acceleration patch)

  • Trains are not affected going up or down hills if they are powerful enough.
  • Trains are limited to entering and exiting a depot at 61km/h.
  • Trains can make one 45° turn without slowing down.
  • When making two or more 45° turns in the same direction, the max speed is limited as follows:
Tiles between
double bend
Max speed (km/h)
RailroadMonorailMaglev
0 (90° turn)6191121
188132176
2111166221
3132198264
4151226301
5168252336
6183274365
7196294392
8207310413
9216324432
10223334445
11228342456
12231346461
  • Train acceleration and max speed is affected by engine power, current speed, total train mass, and track incline.
  • Non-Maglev train acceleration = 37 *(0.55 * Power / Speed - 1.3 * Mass + 60 * #cars + 0.0035 * Mass * Speed + 0.24 * Speed^2 - 60 * Mass of cars on slope) / Mass (km/h/day)
  • Maglev train Acceleration = 37 * (0.022 * Power - 0.24 * Speed^2 - 60 * Mass of cars on slope) / Mass (km/h/day)
  • Braking is twice acceleration except when entering a depot or a station.
  • Speed limits only apply when all of the turns occur within the length of the train:

image:speed-limits.png

See also: Realistic acceleration and Corners.

See aircraft_cmd.c, roadveh_cmd.c, ship_cmd.c, train_cmd.c, vechicle.c for code.

Personal tools