Reproducible map generation

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

User avatar
Lordmwa
President
President
Posts: 896
Joined: 20 May 2006 19:30
Location: West Sussex, England

Re: Reproducible map generation

Post by Lordmwa »

Thanks a lot

All fully working now and it looks great!

I had assumed where it said "none" in the table about signs that it meant no value, I substituted all of those for 0 and with a few errors to tweak it worked perfectly!
The TT forums trivia tournament! Come along and join in the fun
http://www.funtrivia.com/private/main.cfm?tid=90722

Lechuza
Engineer
Engineer
Posts: 16
Joined: 30 Oct 2014 01:33

Re: Reproducible map generation

Post by Lechuza »

McZapkie wrote: If you are creating real based map, you can use GIS date for inland water, it can be found for example here:
http://www.diva-gis.org/gdata
Now we can use GIS data, if converted into bitmap, to apply as mask layer and decrease slightly brightness of the original heightmap.
Raw data of combined rivers and inland reservoirs, converted to bitmap, looks like that:
http://149.156.194.203/~mczapkie/Train/ ... lwater.png
I'm trying to create a new North American map. How do I convert the GIS data to bitmap? I couldn't find a way to open what I downloaded from that website :oops:

McZapkie
Tycoon
Tycoon
Posts: 1182
Joined: 18 Jan 2014 18:10

Re: Reproducible map generation

Post by McZapkie »

Lechuza wrote: I'm trying to create a new North American map. How do I convert the GIS data to bitmap? I couldn't find a way to open what I downloaded from that website
I don't remember exactly, but probably I just used software from that website:
http://www.diva-gis.org/download
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.

User avatar
aDe
Engineer
Engineer
Posts: 66
Joined: 07 Jan 2003 15:59
Skype: ade.se
Location: SE
Contact:

Re: Reproducible map generation

Post by aDe »

Excellent work!!!

I have created a small tool to make this even more useful.

You can automatically download towns based on latitude and longitude and export right down to the exact format needed for this patch.

There's also a tool to convert a water map to a format that works with this patch.

It's a very early prototype so it might break but please feel free to toy with it. You may need to use Chrome for it to work right.

http://ade.se/ttd/scenario-import-tool/

EDIT: If it doesnt work at all, try refreshing the page. There is some kind of load timing issue sometimes.

Let me know how it goes!
Last edited by aDe on 01 Dec 2014 17:07, edited 1 time in total.

McZapkie
Tycoon
Tycoon
Posts: 1182
Joined: 18 Jan 2014 18:10

Re: Reproducible map generation

Post by McZapkie »

Interesting!
So it is importing cities from internet server, from a given area?
What API is stand for?
Thanks for water import, seems to be very useful,
however it hangs up when attached file is converted:
r256.png
rivers 2096x2096, 8bit
(250.96 KiB) Downloaded 8 times

User avatar
aDe
Engineer
Engineer
Posts: 66
Joined: 07 Jan 2003 15:59
Skype: ade.se
Location: SE
Contact:

Re: Reproducible map generation

Post by aDe »

McZapkie wrote:Interesting!
So it is importing cities from internet server, from a given area?
Yes, exactly. It's from GeoNames
McZapkie wrote: What API is stand for?
It's the server/adress it uses to get the towns. I found two that are useful, both from GeoNames. The "full" one gives the most results.
McZapkie wrote: Thanks for water import, seems to be very useful,
however it hangs up when attached file is converted:
I think it's because of the white background, try inverting the colors, and it should be better. It may be too much data, I will try it and see if I can get it to work.

User avatar
aDe
Engineer
Engineer
Posts: 66
Joined: 07 Jan 2003 15:59
Skype: ade.se
Location: SE
Contact:

Re: Reproducible map generation

Post by aDe »

It works for me after inverting the colors, here is the output:
Attachments
water-data.zip
Water data text file
(563.24 KiB) Downloaded 100 times

User avatar
kamnet
Moderator
Moderator
Posts: 7260
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Reproducible map generation

Post by kamnet »

Any chance of a fork/rework of this to account for More Height Levels now available?

sunshare
Transport Coordinator
Transport Coordinator
Posts: 279
Joined: 10 Oct 2014 00:43

Re: Reproducible map generation

Post by sunshare »

Who are encouraged to put cities on this map of europe of 496x4906?

thanks !
Attachments
Europe_4096_x_4096-4.tar
(6.85 MiB) Downloaded 98 times

McZapkie
Tycoon
Tycoon
Posts: 1182
Joined: 18 Jan 2014 18:10

Re: Reproducible map generation

Post by McZapkie »

aDe wrote: I think it's because of the white background, try inverting the colors, and it should be better.
"Blueprint" image works perfectly.
I just misunderstood sentence about ignored alpha.

Any chance of a fork/rework of this to account for More Height Levels now available?
I will rework, when height levels would appear in official version, because map created with trunk/newer version cannot be opened with standard one (personally I'm using it usually for map generation for my multiplayer server)
But code is free to modify/fork/rework - probably some string mallocs should be corrected to be compatible with trunk.

User avatar
aDe
Engineer
Engineer
Posts: 66
Joined: 07 Jan 2003 15:59
Skype: ade.se
Location: SE
Contact:

Re: Reproducible map generation

Post by aDe »

McZapkie wrote: "Blueprint" image works perfectly.
I just misunderstood sentence about ignored alpha.
Great!

The only issue for me right now is all the "Sign" signs being printed whenever there is a sloped tile and water cannot be placed. Is there any way to turn that off? Or to delete all signs somehow?

McZapkie
Tycoon
Tycoon
Posts: 1182
Joined: 18 Jan 2014 18:10

Re: Reproducible map generation

Post by McZapkie »

aDe wrote: The only issue for me right now is all the "Sign" signs being printed whenever there is a sloped tile and water cannot be placed. Is there any way to turn that off? Or to delete all signs somehow?
I will turn signs off if they are empty.
But I cannot provide windows binary, because my windows start to produce "This application has requested the Runtime to terminate it in an unusual way." Microsoft patch claimed as problem solver doesn't works.

PS. console_cmds.cpp source is attached, compiled with 1.4.1 version, no signs if line begin with empty ,W
console_cmds.cpp
(72.53 KiB) Downloaded 88 times

User avatar
aDe
Engineer
Engineer
Posts: 66
Joined: 07 Jan 2003 15:59
Skype: ade.se
Location: SE
Contact:

Re: Reproducible map generation

Post by aDe »

Thank you! I'll see when I can get a compile going, don't have the environment set up right now.

What are you compiling for? I have a mac aswell...

McZapkie
Tycoon
Tycoon
Posts: 1182
Joined: 18 Jan 2014 18:10

Re: Reproducible map generation

Post by McZapkie »

I can compile only for linux Ubuntu (my MinGW is broken, or windows are).
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.

McZapkie
Tycoon
Tycoon
Posts: 1182
Joined: 18 Jan 2014 18:10

Re: Reproducible map generation

Post by McZapkie »

Updated version of console_cmds.cpp, working with 1.5.0beta witch MHL patch, is attached below:
console_cmds.cpp
console_cmds v26122014
(71.74 KiB) Downloaded 90 times
Note, it is not a diff patch, original file must to be overwrited, therefore I recommend to compile separate instance of openttd.
aDe wrote: I have created a small tool to make this even more useful.
Would you be so kind and make some improvements?

1. water converter:
instead of

Code: Select all

,W,0,
, better is

Code: Select all

,W,1,
Both make one water tile, but W,0 make it regardless of flat or slope tile, W,1 is a 1x1 lake and can be only placed on flat.
Because heightmap is usually rough, valleys are not perfectly fitted to rivers, W,0 would make many unwanted "waterfall artefacts".
With W,1 you must only find real waterfalls (easy to spot) and change 1 to 0.

2. city extractor:
a) map edges coordinates are north, east, south, west, would you set similar order in your import tool?
b) There is bug, if small city threshold is above 0, cities below this threshold are listed without any size identify letter, for example:

Code: Select all

Parczew,S,0,51.64021,22.90057,1 #above small cities limit
Ozimek,,0,50.67944,18.2137,1 #below small cities limit
It can be easily improved, because my patch support very small cities with letter "V" and probability of occurrence (these three 1,1,1)
therefore export should produce:
#small cities probability
0,0,1
#dummy entries for unused settings
1,1,1,1,1,1,1,1,1,1
Ozimek,V,0,50.67944,18.2137,1 #below small cities limit
By default, very small cities and villages are exported to txt, but not imported to openttd.
If somebody want to import for example half of them, he can change probabilities to 0.5, 0.5, 1.
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.

User avatar
aDe
Engineer
Engineer
Posts: 66
Joined: 07 Jan 2003 15:59
Skype: ade.se
Location: SE
Contact:

Re: Reproducible map generation

Post by aDe »

Thanks McZapkie, I have fixed the issues you mentioned.

The water placement parameter is now an option checkbox.

The villages changes have been added and the smaller than small city bug fixed.

McZapkie
Tycoon
Tycoon
Posts: 1182
Joined: 18 Jan 2014 18:10

Re: Reproducible map generation

Post by McZapkie »

Thank you very much for fixes.
Is it possible to fix coordinates order (north, east, south, west) too?
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.

User avatar
aDe
Engineer
Engineer
Posts: 66
Joined: 07 Jan 2003 15:59
Skype: ade.se
Location: SE
Contact:

Re: Reproducible map generation

Post by aDe »

McZapkie wrote:Thank you very much for fixes.
Is it possible to fix coordinates order (north, east, south, west) too?
Did you mean the order of the text boxes for input? I changed those now.

McZapkie
Tycoon
Tycoon
Posts: 1182
Joined: 18 Jan 2014 18:10

Re: Reproducible map generation

Post by McZapkie »

I see still old version online. Refresh does not work.

EDIT: now I see new version, but unfortunately there is empty output instead of these Swedish cities.

McZapkie
Tycoon
Tycoon
Posts: 1182
Joined: 18 Jan 2014 18:10

Re: Reproducible map generation

Post by McZapkie »

aDe, your converter works now pretty well.
It helped me much witch generating of new version of Poland 2048x2048 for MHL patch:

149.156.194.203/~mczapkie/Train/tmp/tt/ss/pl-experimental/Poland-TatraMHL.png
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.

Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot] and 20 guests