Author Topic: Dat file reference for: Buildings and Stops  (Read 1483 times)

0 Members and 1 Guest are viewing this topic.

Offline Ves

Dat file reference for: Buildings and Stops
« on: February 02, 2016, 11:45:20 PM »
Note: This guide applies to Simutrans-Extended version 12.x and above only.

Short comments on buildings:

Visitors, residents and workers
There is a new system to divide passengers into "commuting" passengers and "visiting" passengers which will travel by different rules set in If the resident/visiting- or commuting parameters are not set in buildings datfile, the values will be calculated based on the "level=" parameter and constants specified in The initial mechanism of a buildings job slots are the following:
  • Each building that is not a residential building has a defined number of jobs.
  • Commuting passengers travelling to that building take up one job slot each for a fixed period of time after their arrival (set in and represent a working day).
  • When all job slots are occupied, the building cannot accept any more commuting passengers.
Also, a buildings willingnes to accept visitors and commuters will (as of 3/1-2016 proposed to in this thread Potential feature discusion: economic integration) depend on each other like the following:
  • Consumer factories with no products to sell would not accept visiting passengers (i.e. customers).
  • Consumer factories with no (or insufficient) staff available would not accept visiting passengers.
  • Consumer factories (except those with a 0 visitor demand, such as a gasworks, which would continue to use the current time based system) would consume products in proportion to the number of visiting passengers arriving, rather than based on time elapsed (a consumer industry receiving 100% of its monthly visitor demand in a month would consume 100% of its specified monthly consumption, 50% at 50%, 200% at 200% and so forth).
  • Producing factories would produce only in so far as they have enough workers (i.e., will only produce at 100% of the normal rate if they have 100% or more of the number of workers that they need; at 50% of the workers, they will produce at 50% of the normal rate, etc.).
  • Producing factories that require inputs to produce goods would not accept any commuting passengers (i.e. workers) if they do not have enough input goods to produce anything.
  • Attractions with no staff would not accept visitors.
Signal boxes
As the new signals in simutrans require signal boxes to work as inteded, the signal boxes are coded as buildings with the "type=signalbox". To read more about how they work, read the Dat file reference for: Signals and Signalboxes

From version 11.x and earlier:

Airport control towers
In Simutrans-Extended, airports must have control towers to work, unless allow_airports_without_control_towers = 1 is set in Airport control towers are station extension buildings with a special flag set in their .dat files.

Traction specific depots
It is possible to make the depots only build a certain type of vehicles based on their traction type. For example it is possible to code a depot to only allow building steam engines and another depot maybe only may build diesel engines. Maintaining a fleet of both steam- and diesel engines will then require the player to build, maintain and organize different types of depots.


Notes to the dat parameters below:
All buildings can use all parameters, if not specified otherwise.
{E} = Simutrans Experiemental parameter
{M} = A modified parameter from Simutrans Standard
{S} (or nothing specified) = Original Simutrans Standard parameter and can be further investigated here: Create Standard DAT files.

.dat parameters for buildings:


level:{M} The "level" setting has a number of functions that many of them also can be overridden by other parameters and are dependent on which kind of building this is. It is mostly used together with multipliers specified either in or hardcoded in Simutrans:
  • Provides default values for jobs, population, cost, maintenancy, capacity, etc. for all buildings if those parameters are not specified, using multiplyers in
  • When a city wants to upgrade a city building, a building with a higher value of "level=" will be choosen.
  • Calculates the cost of a wayleave for building a way over or under a building (being one fifth of the value "cost_buy_land" multiplied by the building's level).
  • Determines the maximum size of building ("size" defined as a value of "level") over which a bridge or elevated way might be built using the value "max_elevated_way_building_level".

population_and_visitor_demand_capacity:{E} If this building is "type=res", then this will specify how many inhabitans that this building has. For any other "type=", it will specify how many visitors that this building may attract, eg a museum attracting audience, a school attracting students, a store attracting costumers, a station building attracting architecture interrested people etc. Default if not specified: set in based on "level=" value.

employment_capacity:{E} Specify how many "workers" (ingame job slots) this building demands for a fixed amount of time (set in This will generate "commuting passengers" that have other travel rules than "visiting" passengers, also specified in the
Although this is not a fully incorporated feature yet (as of 30/1-2016) the "employment_capacity=" of a building also may interfere with how many visitors the building accepts (eg a museum is closed for visitors when the staff is missing). If set to 0, there will be considered that no staff is needed (eg a monument or a statue) and then no penalties for visiting passengers. Default if not specified: set in based on "level=" value.

mail_demand:{S} How much mail this building will demand every month. Default if not specified: set in based on "level=" value.

noconstruction:{S} No excavation pit graphics showed when under construction.

noinfo:{S} This building will not have an info window.

type:{M} What kind of building this is. Dependent of what type it is, different parameters are possible or needed, eg "type=signalbox" requires additional parameters to work correctly.

City buildings:
type=resResidential building, peoples home
type=comCommercial building, where people work
type=indIndustrial building, also where people work
type=towCity townhall
type=monMonuments, like a statue people wants to visit
type=curCuriosities, buildings like schools
Player buildings:
type=stopCombined with "waytype=" it will become a stop a vehicle can use.
type=harbourWill make this into a harbour to place on the shore
type=dockSimilar to harbour, but to be placed on a flat shore
type=extensionThis will become a stationextension
type=depotVehicle depot, combined with "waytype="
type=hqYour company headquarter
type=signalboxSignalbox, to be used with the new signalling system. Read more about that here: Dat file reference for: Signals and Signalboxes

Dat-file parameters only for City Buildings:

climates:{S} A commaseparated list of climates that this building can be built in. Possible climates: desert, tropic, mediterran, temperate, tundra, rocky and arctic. Default if not specified: All climates.
climates= (Example: climates=desert,tundra,tropic climates=arctic

clusters:{S} (only "type=res", "type=com" and "type=ind") A comma separated list of clusters that this building belongs to. When to decide which building to build, the four orthogonally adjacent tiles are checked.  A building which matches any one of the clusters for any of the buildings on any of those 4 adjacent tiles will get a bonus to its chance of being built. It is recommended only to use this parameter on attached buildings and row houses. Default if not specified: Belonging to no cluster group.
clusters= (Example: clusters=1 clusters=3,5)

build_time:{S} (only "type=mon", "type=cur" and "type=tow") Defines how many inhabitants a city has to have for this building to be built. If set to zero, it will be built on the countryside.

chance:{S} (only "type=mon" and "type=cur") The chance that this building will be built when the number of inhabitants are reached.

Dat-file parameters only for Player Buildings:

Cost and maintenance:{E} Specified in 1/100 of ingame Simutrans Credits of the building cost and the monthly maintenance. Default if not specified: set in based on "level=" value.

allow_underground:{E} Whether this building may be built underground, overground or both. 0 means that it can be built only overground. 1 means that it can be built only underground. 2 means that it can be built either underground or overground. Default: 2

{S} (only "type=stop", "type=harbour", "type=dock" and "type=extension") With these three parameters one can decide wether this stop or extension can accept either passengers, post or good or a combination of them.

waytype:{S} (only "type=stop", "type=depot" and "type=extension") Specifies which waytype this building should be assosiated with. "type=stop" and "type=depot" wil only be buildable ON the waytile, while "type=extension" will be visible on the menu for that waytype.

capacity:{E} If "type=signalbox": The maximum number of signals that can be connected to this signalbox at any given time
If "type=stop", "type=harbour", "type=dock" or "type=extension": The maximum capacity of good or passengers this building can size. Default if not specified: set in based on "level=" value.

signal_groups:{E} (only "type=signalbox") A comma separated list that specify which signal group this signalbox belongs to (Read more about that here: Dat file reference for: Signals and Signalboxes).
signal_groups= (Example: signal_groups=16,24)

radius:{E} (only "type=signalbox") The maximum distance in meters from this signalbox that any signal connected to it can be placed

hq_level:{S} (only "type=hq") This determines in which order the head quarters are being built when pressing "upgrade head quarter" in Simutrans. The smallest head quarter that is first built by the player should have "hq_level=0", the second version, which usually simulate a bigger head quarter, should have "hq_level=1", the third "hq_level=2" and so on. As head quarters should be buildable from the beginning of the game, it is wise to combine "hq_level=0" with a very early "intro_year=". NOTE: This is not to be confused with the functions of parameter "level="!.

traction_type[X]:{E} (only "type=depot") (Where X is a number in sequence, starting from 0, and being no higher than 255). A list of the traction types that can be built in this depot. Default: - all traction types can be built. Note that unpowered vehicles can be built in any depot. Possible traction types: bio, sail, steam, diesel, petrol, turbine, electric, hydrogene, fuel_cell and battery.

is_control_tower:{E} (only "type=extension") Whether this building is an airport control tower. If the setting "allow_airports_without_control_towers" is disabled in, building this building connected to an airport will allow aircrafts to use the airport.

Graphic representation for all buildings: How to code Backimages

needs_ground:{S} Wether the Simutrans painting engine needs to paint the ground underneath the building. If building graphics covers the entire tile (or tiles), this parameter is not needed.

animation_time:{S} If this building contains animations, this parameter, specified in miliseconds, tells how often to shift frames.

seasons:{S} Number of season graphics this building has defined with a maximum of five: spring, summer, autumn, winter and snow

dims:{S} A comma separated list of three values (represented by A, B and C below) being number of tiles in east-west direction, number of tiles in north-south direction and number of rotations this building has. Read more about this here: Specify Dims and Backimage
dims=A,B,C (example: dims=1,2,4 dims=1,1,16)

Icon and cursor:{S} (Only "Player Buildings") Defines the icon and cursor using the same syntax as the main graphics. Note the ">" which makes the icon not zoom in and out when zooming ingame.

Graphical representation:{S} This is the same as in standard and the values and number of entries is dependent on the values given in "dims=". Read more about this here: Specify Dims and Backimage.
In general, one can look at the values in brackets [ ] as a six legged coordinate system (12 legged when also counting the use of frontimage) where each entry points to one specific graphic. This means that a 2x2 tile building with one rotation needs four entries, but a 2x2 tile building with four rotations would need 4x4=16 entries. If the building contains snow you would need 16x2=32 entries.
The order of the values are: [rotation][north-south][east-west][height][animation frame][season]=png-name.coordinate_vertical.coordinate_horisontal,pixeloffset_vertical,pixeloffset_horisontal


A short explanation and reference for the [rotation] value:
  • For all buildings there can be 4 rotations:
    [0] = Facing south
    [1] = Facing east
    [2] = Facing north
    [3] = Facing west
  • For "type=res", "type=com" and "type=ind", there can be additional 4 rotations, a total of 8 rotations:
    Note that those types only can be 1x1 tiles!
    [0] = Street on south side
    [1] = Street on east side
    [2] = Street on north side
    [3] = Street on west side
    [4] = Street on southeast side (corner)
    [5] = Street on northeast side (corner)
    [6] = Street on northwest side (corner)
    [7] = Street on southwest side (corner)
  • For "type=stop", there can be up to a total of 16 rotations:
    Note that "type=stop" only can be 1x1 tile!
    If "dims=1,1,2" it will become a "drive through" stop:
    [0] = North-South
    [1] = East-West
    If "dims=1,1,4" it will become a "sack" stop:
    [0] = Entrance south
    [1] = Entrance east
    [2] = Entrance north
    [3] = Entrance west
    If "dims=1,1,8" it will become a "drive through" stop but with more graphics defined:
    [0] = (N-S) Middle part
    [1] = (E-W) Middle part
    [2] = (N-S) South end
    [3] = (E-W) East end
    [4] = (N-S) North end
    [5] = (E-W) West end
    [6] = (N-S) Stand alone part
    [7] = (E-W) Stand alone part
    If "dims=1,1,16" it will be possible to add additional graphics for the lower parallel stop (eg simulate platform on opposite side of dubble track). The extra entries are:
    [8] = (N-S) Lower track, Middle part
    [9] = (E-W) Lower track, Middle part
    [10] = (N-S) Lower track, South end
    [11] = (E-W) Lower track, East end
    [12] = (N-S) Lower track, North end
    [13] = (E-W) Lower track, West end
    [14] = (N-S) Lower track, Stand alone part
    [15] = (E-W) Lower track, Stand alone part
A short Explanation of the [north-south] and [east-west] value:
  • If "dims=2,2,1" it will become a 2x2 tile building with no rotation:
    [0][0] = Topmost corner (north west corner) of the building
    [0][1] = Rightmost corner (north east corner)
    [1][0] = leftmost corner (south west corner)
    [1][1] = lowermost corner (south east corner)
    This could be expanded to "dims=16,16,4" and all tiles with graphics would then need an entry of its own using the same logic.
A short explanaining of the [height] value:
  • [0] = Graphics is painted directly on the base of the tile
    [1] = Graphics is painted 128 pixels in pak128 (64 pixels in pak64, 192 pixels in pak192 etc) above the base of the tile
    [2] = Graphics is painted an additional 128 pixels in pak128 (64 pixels in pak64, 192 pixels in pak192 etc) higher than [1]
    [3] = Graphics is painted yet an additional 128 pixels in pak128 (64 pixels in pak64, 192 pixels in pak192 etc) higher than [2] and this is the highest possible
A short explanaining of the [animation frame] value:
  • The animation frames are specified together with the "animation_time=" parameter and there can in principle be an infinite number of animation frames.
    [0] = First frame
    [1] = Second frame
    [2] = Third frame
A short explanaining of the [season] value:
  • The seasons are specified together with "seasons=" parameter:
    If "seasons=1":
    [0] = All seasons
    If "seasons=2":
    [0] = All seasons
    [1] = Snow
    If "seasons=4":
    [0] = Summer
    [1] = Fall
    [2] = Winter (used also for snow)
    [3] = Spring
    If "seasons=5":
    [0] = Summer
    [1] = Fall
    [2] = Winter
    [3] = Spring
    [4] = Snow
Example of a city building. Note the use of 2 "heights":
Code: [Select]








Example of a train platform. Note the use of "frontimage" which makes the Simutrans painting engine paint the graphics in front of eg vehicles:
Code: [Select]


Example of a church ("type=cur"), build by several individual modules and meassuring 2x2 tiles. Note the snow graphics and the [1] at the "season" entry. Observe that this example lacks all the "non snow" entries ([0] at the "season" entry) to make the snow disappear:
Code: [Select]




edit                   - Ves-Corrected some mistakes
edit 4/2-2016 - Ves-Added more info on graphics representation
edit 18/11-2016 - Ves-Added info about the two new traction types petrol and turbine

Moderator note: References to "Simutrans-Experimental" changed to "Simutrans-Extended" 13 February 2017.
« Last Edit: February 14, 2017, 12:40:58 AM by jamespetts »

Offline Milko

Re: Dat file reference for: Buildings and Stops
« Reply #1 on: February 03, 2016, 08:25:03 AM »
This guide in highlight  :)

Thanks Ves


Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 14762
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Dat file reference for: Buildings and Stops
« Reply #2 on: February 03, 2016, 09:53:49 AM »
Splendid, thank you for all this work: it is most useful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.