News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

Dat file reference for: Factories and Goods

Started by Ves, February 04, 2016, 04:31:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ves

Note: This guide applies to Simutrans-Extended version 12.x and above only.

Regions
This is a system that allows parts of the map to be defined as separate regions with their own names. Currently, this affects:

(1) town names;
(2) street/stop names;
(3) what city buildings may be built; and
(4) what industries may be built.

Regions are currently a simple system of overlapping rectangles. For defining regional city and street/stop names using a city or street list, just add a number in brackets like this: [ x ] (without whitespaces),
to the end of the filename immediately before the _[language] part: for example, citylist[1]_en.txt for the English language citylist for region no. 1 or streetlist[2]_fr.txt for the French language street/stop list for region no. 2. Where no region specific list be defined, the base list (i.e. that without any number in square brackets) will be used.

Short comments on Factories and Good
Factories shares many parameters with normal city- and player buildings, and some parameters in the reference below contains suggestions that you read the Dat file reference for: Buildings and Stops to get the full picture.
Otherwise, factories are coded in Simutrans Extended almost identical as they are in Simutrans Standard, although there are some differences:

Visitors, residents and workers
The visitor-, jobslot- and resident system is the same as for every other building. Therefore, read the buildings datfile reference: Dat file reference for: Buildings and Stops

From version 11.x and earlier:

Upgrading factories
Factory can close down when they become obsolete in Simutrans Extended. As an alternative to closing down, however, they can be upgraded to another factories. It is only possible for an factories to be upgraded when the factories that is being upgraded is exactly the same shape and size as that to which it is being upgraded. In future versions, however, there may be fewer such constraints, and upgrades that do not match the constraints can still be specified as upgrades, albeit they will not be used in the present version.

Good having multiple values
Good can have multiple values dependent on for how long they travel. It is specified so that the good generates a revenue up to a specified distance, then another revenue up to the next specified distance and so on. Makes it possible to eg make a good only feasable to transport either short or a long distance.


------

Notes to the dat parameters below:
All factories 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 factories:

obj=factory
name=
copyright=
intro_year=
intro_month=
retire_year=
retire_month=


climates:{S} A commaseparated list of climates that this factory 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

location:{S} Specifies where this factory may be built.
location=land = Built in countryside. Note, location=land with climates=water will force an industry on the shore
location=city = Built within city limits
location=water = Built on an open surface of water

distributionweight:{S} This parameter tells how often the factory should appear. The bigger value, the more often.
distributionweight=

max_distance_to_consumer:{E} This number, set in kilometres, specifies the maximum distance that this industry can be built from its consumer.
max_distance_to_consumer=

mapcolor:{S} Sets the mapcolor to show in the minimap according to this table: Color Table
mapcolor=

upgrade[X]:{E} (Where X is a number in sequence, starting from 0, and being no higher than 255) A list of the factories to which the current factory might be upgraded when it closes down.
upgrade[0]=Bookshop1860
upgrade[1]=Bookshop1920

level:{M} The "level" setting has a number of functions that many of them also can be overridden by other parameters. It is mostly used together with multipliers specified either in simuconf.tab or hardcoded in Simutrans:

       
  • Provides default values for jobs, population and mail if those parameters are not specified, using multiplyers in simuconf.tab
  • Calculates the cost of a wayleave for building a way over or under a building (being one fifth of the simuconf.tab 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 simuconf.tab value "max_elevated_way_building_level".

regions:{E} The regions parameter sets in what regions that an industry may be built. These are the numbers for regions specified in simuconf.tab. If this parameter be not specified, the industry can be built in any region. This parameter applies to all buildings.
regions=1,2,5

Production and consuming of goods:

Incoming good:{S} These parameters specify which raw materials the industry needs to produce. All the four parameters are required for each type of goods that the industry requires. Each set of parameters is associated with an index number given within square brackets, starting from 0 (represented by X below).




inputgood[X]=The name of the good.
inputcapacity[X]=How much of this good that can be stored at the factory.
inputfactor[X]=How much, in percent, input good is needed in relation to what is produced.
inputsupplier[X]=Specifies the number of suppliers. If 0, then each industry, which delivers the desired goods is selected as a supplier.

Outgoing good:{S} These parameters specify the goods manufactured by the industry. All three parameters are required for each type of goods that the industry produces. Each set of parameters is associated with an index number given within square brackets, starting from 0 (represented by X below).



outputgood[X]=The name of the good
outputcapacity[X]=How much of this good that can be stored at the factory
outputfactor[X]=How much, in percent, input good is needed in relation to output good

Example of definitions of incoming and outgoing good:
InputGood[0]=Bretter
InputCapacity[0]=32
InputFactor[0]=87   
InputSupplier[0]=2 
InputGood[1]=Stahl
InputCapacity[1]=16
InputFactor[1]=13
InputSupplier[1]=2

OutputGood[0]=Moebel
OutputCapacity[0]=80
OutputFactor[0]=222


productivity:{S} Defines the minimum amount of goods produced at the factory.
productivity=

range:{S} Defines the range, in which the actual production rate of the industry lies.
Minimum production rate = "productivity"
Maximum production rate = "Productivity" + "Range"
range=

electricity_amount:{S} Maximum consumption of electricity per production unit.
electricity_amount=

electricity_proportion:{E} The proportion of electricity, expressed in percent, that the factory takes relative to its production. 100 is equivalent to the Simutrans-Standard values. This allows different factories to take different amounts of electricity for an equivalent amount of production. Default: 17%
electricity_proportion=

electricity_boost:{S} Increase of production in 1/1000 if elictricity is supplied. Default 1000.
electricity_boost=

passenger_demand:{S} How much passengers this factory demands per production unit and time. Note (as of 28/1-2016) that this setting may be removed, replaced or modified from Simutrans Extended due to not yet complete factory boost mechanism.
passenger_demand=

passenger_boost:{S} Increase of production in 1/1000 if passengers arrived. Default 0.
passenger_boost=

mail_demand:{S} How much mail this factory demands per production unit and time.
mail_demand=

mail_boost:{S} Increase of production in 1/1000 if mail arrived. Default 0.
mail_boost=

population_and_visitor_demand_capacity:{E} Specifies the number of visitors that this factory needs. Although this is not a fully incorporated feature yet (as of 28/1-2016) this setting will eventually probably interfere with the factory boost mechanism.
population_and_visitor_demand_capacity=

employment_capacity:{E} Specifies the number of "workers" that this factory needs. Although this is not a fully incorporated feature yet (as of 28/1-2016) this setting will eventually probably interfere with the factory boost mechanism.
employment_capacity=

max_distance_to_suppplier:{E} This parameter sets the maximum distance in kilometres that the industry may be from any of its suppliers. However, this distance is disapplied for any input goods in respect of which no supplier can be built in the industry's current region.
max_distance_to_suppplier=


If this factory grows bigger (without using fields)

expand_probability:{S} Probability to expand. If bigger than 10.000, then it will always expand while producing.
expand_probability=

expand_minimum:{S} Minimum expansion of production.
expand_minimum=

expand_range:{S} Production increases with a random number between this value and 0.
expand_range=

expand_times:{S} Maximum number of times this factory may expand.
expand_times=


Factories that uses fields: How to create a field object
(NOTE: Not to be used when the four "expand_xxx=" parameters are defined)

Definitions concerning all fields:{S} Maximum and minimum number of fields, as well as how likely a field will be created while the factory is producing (100 represents a probability of 1%, 10000=100%):
max_fields=
min_fields=
probability_to_spawn=

The individual field definitions{S} Every field needs the following 5 parameters to work correctly. Each set of parameters is associated with an index number given within square brackets, starting from 0 (represented by X in the example below).





fields[X]=Specify an existing field object to use. How to create a field object
production_per_field[X]=How much "production" this field will add to the factory.
storage_capacity[X]=How much storage capacity that this field will add to the factory.
spawn_weight[X]=How likely it is that this field object will be created.
has_snow[X]=Wether this field has snow graphics defined (yes=1 no=0)

Example of field section:
max_fields=50
Min_Fields=10
probability_to_spawn=500

fields[0]=Parking_modern_0_empty
production_per_field[0]=0
storage_capacity[0]=8
spawn_weight[0]=90
has_snow[0]=0

fields[1]=Parking_modern_1
production_per_field[1]=0
storage_capacity[1]=5
spawn_weight[1]=100
has_snow[1]=0

fields[2]=Parking_modern_2
production_per_field[2]=9
storage_capacity[2]=0
spawn_weight[2]=50
has_snow[2]=0



Factories that uses smoke: How to create a smoke object
Factories can be programmed to show smoke eg from a chimney when they are working.

smoke:{S} Specifies the name of the smoke object to use.
smoke=

smoketile:{S} Specifies which tile's front corner of the factory graphics is the starting point for the smoke. Specified as a coordinate, example 0,3
smoketile=

smokeoffset:{S} Specifies the actual point in pixels of the smoke as an offset from the starting point. Also specified as a coordinate (eg 36,66), where the first value gives the x-Position, the second value gives the y-Position which is then lowered by 100.
smokeoffset=

smokespeed:{S} Specifies the speed of the smoke.
smokespeed=


Graphic representation for factories:
Factory graphics are coded in the same way as normal buildings, only that there is a maximum of 4 rotations but no size limitations and no icon and cursor. The parameters are the following:
Reference: Dat file reference for: Buildings and Stops

needs_ground=
animation_time=
seasons=
dims=
backimage[0][0][0][0][0][0]=
frontimage[0][0][0][0][0][0]=



-------------------------------------

Notes to the dat parameters below:
All good 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 good:

obj=good

name:{S} The name of the good. Although its completely liberal what good to incorporate in a pakset, the three mandatory good must be created. Those are: "name=passagiere", "name=post" and "name=none". The "none"-good is not a real good (cant be transported) and can have all other parameters set to 0 and this is by design from Simutrans.
name=

metric:{S} What to call one "unit" of this good, like barrels, tonnes, or in any other creative way.
metric=

catg:{S} A number from 0 to 7 representing which category this good belongs to. With the exception of "catg=0", all goods within the same category can get transported by the same vehicles. If "catg=0" is specified it will be considered a "Special good" and you need specialized vehicles to carry the good, which is identified by the "name=" parameter.
Note that "name=passagiere", "name=post" or "name=none", also are threated as special good, hence "catg=0" is needed for those good too.
catg=

weight_per_unit:{S} How much one "unit" of this good weight in Kg. If "metric=tonnes" or other weight specific metric is used, make sure to type the corresponding weight in Kg's here.
weight_per_unit=

mapcolor:{S} Sets the mapcolor to show in the minimap according to this table: Color Table
mapcolor=


The revenue entries:{E} Each pair of parameters is associated with an index number given within square brackets, starting from 0 (represented by X below). The "value[X]=" defines the amount in 1/100 of ingame Simucredit you are paid per kilometer up until the distance set in "to_distance[X]=", also specified in kilometers. The next set of entries defines the value up to that number of kilometers and so on. The last entry should have the value "to_distance[X]=0", as this will simulate the infinite length.
value[X]=
to_distance[X]=


Example: This goods will yield 60c/km for the first 16km, 50c/km for the next 32km, and 47c/km thereafter.
value[0]=60
to_distance[0]=16

value[1]=50
to_distance[1]=32

value[2]=47
to_distance[2]=0



The class entries:{E} This section is only used together with "name=passagiere", "name=post".

number_of_classes: The amount of classes this good has. Maximum 255.
number_of_classes=

class_revenue_percent[X]: This is a modifier to calculate how much revenue this particular class generates. If "class_revenue_percent[X]=100" it means that this class generates 100% of the revenue stated in the "value[X]=" section.
class_revenue_percent[X]=

Example:
number_of_classes=5
class_revenue_percent[0]=60
class_revenue_percent[1]=100
class_revenue_percent[2]=133
class_revenue_percent[3]=150
class_revenue_percent[4]=200




(Should this "Speed bonus" section be removed:)
speed_bonus:{S} This specifies in percent how much revenue is increased if you use fast convoys. Usefull for time sensitive good like passengers and fresh food etc.
speed_bonus=



Edit:
7/3-2018 - Ves: Added and clarifyed some missing infos and added class values
8/6-2020 - Ves: Added "Regions" and "max_distance_to_supplier"

jamespetts

There are now two new parameters:

regions=

and

max_distance_to_suppplier=

The regions parameter sets in what regions that an industry may be built. These are the numbers for regions specified in simuconf.tab. If this parameter be not specified, the industry can be built in any region. This parameter applies to all buildings.

The max_distance_to_supplier parameter sets the maximum distance in kilometres that the industry may be from any of its suppliers. However, this distance is disapplied for any input goods in respect of which no supplier can be built in the industry's current region.
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.