Patch: Create realistic heightmap, water & town placement

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

mitchell600
Engineer
Engineer
Posts: 12
Joined: 03 Jul 2008 08:35

Re: Patch: Create realistic heightmap & automatic town placement

Post by mitchell600 »

Ok now this...
The links for what i all need?
Becas its quita mess for me up above...
I got now 6.1 and an older version 2.3 ore it whas 2.5
What i have to do in a clearer way??

Mitch ;)
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Patch: Create realistic heightmap & automatic town placement

Post by CommanderZ »

You may:

a) Get according source code, apply the patch and compile it

b) Get BuildOTTD and it will do it for you

c) Ask the author if he has a working compiled executable for your platform
mitchell600
Engineer
Engineer
Posts: 12
Joined: 03 Jul 2008 08:35

Re: Patch: Create realistic heightmap & automatic town placement

Post by mitchell600 »

Hmm nvm im no computer nerd :P
I stil dont know how to get that tool to make 5 mil population citys..

Image

Mitch ;)
wolkottept
Engineer
Engineer
Posts: 26
Joined: 27 Aug 2007 16:25

Re: Patch: Create realistic heightmap & automatic town placement

Post by wolkottept »

Hi Mitch,

Sorry, I guess you misinterpret the GUI text. In TTD you have four types of towns/cities (Small, Medium, Large, City). That is the first column in the table.

With the minimum population options in the third column you select the towns who have in reality a population of more then for example 2 million inhabitants (data is available in towns.txt) to be of the type city. The fourth column indicates the estimated number of towns that will be created of a certain type. (Towns that are too close will be merged into a single town).

The size of the town will be of the specified start size (indicated by the numbers (0,1,2,3) in second column). All towns that are grouped in for example, the city type will have roughly the same size. You could increase the start size by adjusting the numbers in the second column. It is also possible to create large "Small towns" and small "Cities) by adjusting the numbers like (3,2,1,0).

Regards,
Pascal
mitchell600
Engineer
Engineer
Posts: 12
Joined: 03 Jul 2008 08:35

Re: Patch: Create realistic heightmap & automatic town placement

Post by mitchell600 »

My question whas how to instal this tool???
I dont got it..

Mitch ;)
wolkottept
Engineer
Engineer
Posts: 26
Joined: 27 Aug 2007 16:25

Re: Patch: Create realistic heightmap & automatic town placement

Post by wolkottept »

Mitch,

I guess you haven't read the SVN pages (see: http://wiki.openttd.org/index.php/SVN#H ... ce_code.3F)

In summary (commands for linux, for windows see the above wiki link):

- Make an empty directory on your PC
- Do a checkout of the source, it has to be revision 11047, because that is where the patch is made for (svn co -r 11047 svn://svn.openttd.org/trunk/ . )
- Download and copy the patch to the directory
- Apply my patch to the original source (patch -p0 < realistic_map_and_towns_wolkottept_r11047_0v02.diff)
- Compile the sources (see the above wiki link)
- Run OpenTTD
wolkottept
Engineer
Engineer
Posts: 26
Joined: 27 Aug 2007 16:25

Re: Patch: Create realistic heightmap, water & town placement

Post by wolkottept »

I updated the patch such that water information can included too. Furthermore, a shell script is available to automatically generate the necessary PNG input files.

The initial post is updated to reflect the changes.
mitchell600
Engineer
Engineer
Posts: 12
Joined: 03 Jul 2008 08:35

Re: Patch: Create realistic heightmap, water & town placement

Post by mitchell600 »

Hmm to hard for me.
I dont understand anything from it :S
What if somebody makes a file that u install into the game so its there?
Mitch ;)
User avatar
ostlandr
Chairman
Chairman
Posts: 882
Joined: 12 May 2007 01:09
Location: Northeastern USA

Re: Patch: Create realistic heightmap, water & town placement

Post by ostlandr »

Wow! And to think I was planning to spend time drawing an isometric grid over a paper map, and manually plotting the town locations.

I think I'll take another crack at compiling patches.
Who is John Galt?
User avatar
Regiovogel
Engineer
Engineer
Posts: 48
Joined: 03 Feb 2008 23:25
Location: Nürnberg, Germany

Re: Patch: Create realistic heightmap, water & town placement

Post by Regiovogel »

Hi,

would anybody please be so kind to provide a win32 binary with this patch? BuildOTTD quits with the very informative message "Compile failed", so I have no idea why it failed ;) (yes, I selected r11047)

Any hints?
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: Patch: Create realistic heightmap, water & town placement

Post by Wolf01 »

Now we have the rivers feature, is possible in any way to place realistic rivers instead of canals?
wolkottept
Engineer
Engineer
Posts: 26
Joined: 27 Aug 2007 16:25

Re: Patch: Create realistic heightmap, water & town placement

Post by wolkottept »

Wolf01 wrote:Now we have the rivers feature, is possible in any way to place realistic rivers instead of canals?
Last year there was a patch with water (not canals) at various levels, but I was not able to find this patch. Then it will also be possible to create land below sea-level. Only flooding might be a problem. From the PNG files it is not possible to discriminate between lakes, rivers, canals etc. without any additional analysis. So it will be either place rivers or place canals.

If somebody has a suggestion, please let me know.
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Patch: Create realistic heightmap, water & town placement

Post by CommanderZ »

There are rivers in trunk - just get latest nightly and try it into scenario editor.
wolkottept
Engineer
Engineer
Posts: 26
Joined: 27 Aug 2007 16:25

Re: Patch: Create realistic heightmap, water & town placement

Post by wolkottept »

CommanderZ wrote:There are rivers in trunk - just get latest nightly and try it into scenario editor.
CommanderZ, thank you very much for this great tip. I updated the code to one of the latest revisions (quite some work). The water bodies are now placed as rivers on the map.

Furthermore, the code in general and histogram information in the generation window has improved (see the first post).
wolkottept
Engineer
Engineer
Posts: 26
Joined: 27 Aug 2007 16:25

Re: Patch: Create realistic heightmap, water & town placement

Post by wolkottept »

Fixed a bug in the script that generates the three PNG files and info file. It is now possible to create maps below the equator.
User avatar
RBC
Engineer
Engineer
Posts: 48
Joined: 19 Jun 2008 07:52
Location: Eibenstock (Germany)

Re: Patch: Create realistic heightmap, water & town placement

Post by RBC »

hi wolkottept!

I've followed your work quite for a while, but I was unable to compile the patch. (BuildOpenTTD or MSVC 2005)
Today it works in Opensuse 11.0 ;)

Amazing work, congratulations. :bow:

One thing I have noticed:

The water placement is not very well in some cases.
for example realistic rivers are not fluently drawn as 'a' river, but as water dots in the map.

And also in some cases there are waterfalls on the coast. (see attached pic)

A solution for the rivers is maybe to modify the water picture in paint and redraw with a bigger black pencil the rivers manually.
Attachments
screenshot#2.png
screenshot#2.png (52.42 KiB) Viewed 1904 times
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Patch: Create realistic heightmap, water & town placement

Post by CommanderZ »

or it could interpolate by looking also in sorrounding pixels of the river map.
wolkottept
Engineer
Engineer
Posts: 26
Joined: 27 Aug 2007 16:25

Re: Patch: Create realistic heightmap, water & town placement

Post by wolkottept »

True, the water placement seems not to go perfect, but unfortunately the SRTM input data does not differentiate between canals, rivers, lakes, sea etc. With the conversion from SRTM via PNG to eventually placement on the map resizing of the images is done. Most of the scaling is based on resampling and not scaling (interpolation), which is slower. Resampling pick a specific pixel instead of combining multiple pixels into one. Due to this resizing some of the RAW data gets lost, which could be maintained with better resizing functions.

The resampling probably results in a scattered river. The problems at coast line are caused by the decision not to place rivers on non-flat tiles with 3 corners at the same level, but place water on non-flat tiles with 2 corners at the same level.

Some solutions (suggestions are welcome)
- Change the scaling from resampling to resizing
- Make assumptions on the surrounding information
* Search for typical patterns that could be a river in the real world
* Search for coast lines
- Lower the land that is close to the coast instead placement of river tiles

I am not in favor of adjusting the input files, because this requires a lot of manual work and that is what I would like to prevent with this patch in the first place.

Other suggestions for the patch are also very welcome.
yorick
Engineer
Engineer
Posts: 80
Joined: 23 Mar 2008 08:53

Re: Patch: Create realistic heightmap, water & town placement

Post by yorick »

Does anyone have a precompiled win32 binary of the tool used for converting?
I can't seem to be able to build it myself :(
User avatar
tigerface
Engineer
Engineer
Posts: 93
Joined: 01 Jan 2007 17:29

Re: Patch: Create realistic heightmap, water & town placement

Post by tigerface »

I cant get it to build either, I've tried three methods now and still no luck. Any help getting BuildOTTD to actually compile this would be very welcome!
Formerly thanet-bomber.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 4 guests