For importing map features
from external txt file
, I utilised Zydeco patch, which was developed here:http://www.tt-forums.net/viewtopic.php?f=29&t=69007
Now it is possible to import not only towns, but also objects, signs, industries, water, trees, rocks and other landmarks.
It is rather rough, unfinished and not an elegant way of data input, but it works.Note - it is not a alternative scenario format, rather tools for (re)generating scenario with slightly randomisation.
Name of command is changed to
It works only in scenario editor context.
Import files must to be located in .openttd/scenario directory.
External files contain header and list of objects, each object is described in separate line with the following format:
<object name>,<object type>,<object size/importance>,<latitude>,<longitude>,<object layout>
Header consist of three lines:
line with 4 coordinates of map edges
line with 3 probabilities of village founding low probability, very small town probability and village to industry conversion probability (discussed later)
line with 10 industry IDs for village to industry conversion.
Example of such file:
# header above, city or object list below:
Object fields lined up are as follows:<object name>
Name of town, or other object - it can be printed on the map if building failed, therefore you can easily seek for it. You can also force printing this sign for industry or other objects by using non zero <object size/importance>
- capital letter, one of: L,M,S,V,T,N,Y,F,R,W,D; where it stands for:
L: Large city
M: Medium city
S: Small city
V: Very small city (or Village)
T: objecT (antenna,
D: Demolition<object size/importance>
is an integer, usually 0 or 1 (or more in case of area objects - forests, water, demolition).<latitude>
- as in import_towns patch, but you can use map coordinates instead of real coordinates
- in this case you need to put -X instead of longitude and -Y instead of latitude, additionally max. map edges must to be negative.For example
will place power plant (without Powerplant1 sign if succeeded) at tile with X=1822 and Y=3.
is a number for object layout, type etc.
Below is an comprehensive list of parameters meaning:
<object_type> <object_size/importance> <object_layout>
L,M,S 0/1: town/city 0...4 town layout, 5: layout from game settings
V 0/1: small/large probability 0...4 town layout, 5: layout from game settings
T 0/1: place sign 0: antenna, 1: lighthouse
N none none
Y 0/1: place sign 0: coal mine, 1: power plant, etc...
F forest size (0 for 1 tree) tree type
R number of rocky areas none
W size (0 for 1 tile) 0: river, 1: canal
D demolition area size 0: square, 1: diamond
Comment about V: size is like S, small, but founding probabilities are defined in second header line of import files,
as a two numbers from 0 to 100 (100 means 100% chance).
It was done to cope with huge number of cities without relevant population data.
V cities, if failed, are not verbosed as sign.
Additionally, probing area depend on city size+importance - for example, large city, if founding failed, is probed again for other 4x4 tiles,
medium town - 2x2 tiles, very small city or village - only one trial.
Another feature related with villages (V,0) is optional founding industry instead of small towns.
Third probability value (0...100%) is responsible on that - if greather than 0, some industries would be inserted instead of villages,
and type of industry is randomly choosen from list of 10 industry IDs (you can specify given ID repeatedly to increase its weight).
In above header example, because I have more than 40000 records with small towns and villages, probability of V,0 object is set to 1% - only 400 small cities would appear, and quarter of them will be founded as industries instead of towns.
It should generate aprox. less than 300 small towns, 70 farms, 20 forests and 10 sawmills - quite enough for 2048x2048 map.
Part of the map generated with help of above tools:
Clipboard01.jpg [180.53 KiB]
Downloaded 10 times
Clipboard02.jpg [213.46 KiB]
Downloaded 10 times
Example of input files and 2048x2048 heightmap as well as modified source files for landscape and console_cmd are attached below.
Recommended order to import_land is: plf.txt plr.txt plw.txt plo.txt plt.txt pls.txt
Note - pls.txt contains both static industries created during map generation and cotroll strings (with '>>>' prefix) for industry builder gamescript - it will be described later.
PS. please delete second obsolete post.