Town Control

Feature XX Towns/Cities

This specification is at Draft stage. There is no current effort to actually implement it. The goals of this feature is the control of town growth and town appearance (influence house types to build).

Contents

Testcases

Many people envisioned altenative townbehaviours. The goal of a NewGRF should be to cover them, so they can be done via NewGRF rather than patches.

VarAction2 Variables

40 Larger town effect
41 Town index
42 Distance and size of nearest town: DDDDPPPP
PPPP Population (Note: it's quite easily possible to have towns bigger than 65535. WORD wouldn't suffice)
DDDD Distance (squared euclidian)
43 Same as 42, but for nearest "larger" town. Identical to 42 if there are no larger towns.
44 Number of industries associated to the town: SSSSTTTT
TTTT Total amount
SSSS Serviced amount
45 Same as 44, but only primary/raw industries.
46 Same as 44, but only secondary/processing industries.
47 Same as 44, but for stations. (sum of all players)
60 Land info of nearby tiles (relative to townsign). Can be used to detect desert and such, also within a certain area -8 .. 7.
61 Cargo delivered last month to any station in the town (Parameter = translated cargo bit).
Returns FFFFFFFF if the cargo is not present at all.
Else it returns: xHHHAAAA
AAAA Amount last month
HHH History of last 12 months.
Bit 0 is set if some cargo was delivered/transported last month.
Bit 1 is set if some cargo was delivered/transported two months ago.
...
Bit 11 is set if some cargo was delivered/transported 12 months ago.
62 Same as 61, but with towneffect instead of cargobit. The amounts are multiplied with the town-effect-multiplier as well.
63 Same as 61, but for produced cargo of any house or industry in the town.
64 Same as 62, but for produced cargo of any house or industry in the town.
65 Same as 61, but for transported cargo of any house or industry in the town.
66 Same as 62, but for transported cargo of any house or industry in the town.
67 Number of industries that accept/produce a given cargo (Parameter = translated cargo bit): AAAAPPPP
AAAA Total amount of industries accepting this cargo.
PPPP Total amount of industries producing this cargo.
68 Same as 67, but with towneffect instead of cargobit.
82 Population
94..9C Town radii
B6 Number of buildings
D4 Remaining months of Road Reconstruction
D5 Remaining months of Funded Buildings

Callbacks

All callbacks are generic callbacks, and are chained across all Grfs. That is if one Grf returns "callback failed", the next Grf is tried. If all callbacks fail, the default behaviour kicks in.

Bits Value

0 - 1 0 Show delivered cargo amounts if climate defaults require this.
1 Hide the amounts, unless another Grf wants to display them.
2 Show the amounts.
3 Show the amounts including an additional text from register 100.
2 4 The cargo is required regulary for growth.
3 8 The cargo is required in big amounts for growth.
4 10 The cargo requirement is very important.
5- 7

(reserved)
8 - 12

Same as bit 0-4, but for transport instead of delivery.
13 - 14

(reserved)

Persistent storage

Persistent storage for towns has been implemented. See http://newgrf-specs.tt-wiki.net/wiki/Storages#Persistent_storage_accessed_by_GRFID