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

User avatar
tigerface
Engineer
Engineer
Posts: 93
Joined: 01 Jan 2007 17:29

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

Post by tigerface »

If only I'd learnt something more useful than fortran90 at university..
Attachments
screeny.png
(77.23 KiB) Downloaded 460 times
Formerly thanet-bomber.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

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

Post by DaleStan »

Yexo wrote:gcc-g++
gcc-mingw-g++
Usually, I recommend installing the package named gcc, which depends on these two. This should work, though.

And thanet, you're missing libpng.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

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

Post by Yexo »

thanet-bomber wrote:If only I'd learnt something more useful than fortran90 at university..
As DaleStan says try to install libpng, if after that is still doesn't work, use
./configure --without-libpng instead of ./configure.

Edit: I think this patch depends on libpng, so it might not work after you do ./configure --without-libpng, the rest of openttd does work however.
User avatar
tigerface
Engineer
Engineer
Posts: 93
Joined: 01 Jan 2007 17:29

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

Post by tigerface »

Still doesn't work. Thanks for your help guys but I think I'll have to wait 'til this is Windows compatible.
Formerly thanet-bomber.
lefrog1
Engineer
Engineer
Posts: 16
Joined: 14 Jun 2008 18:16

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

Post by lefrog1 »

This is a truly great patch! :bow: If only I could get it to work on my pc!!!! :cry: If anybody fancies doing a 'southern' England map for me, I would really appreciate it!!!! :D It may be time to invest in a better computer...........
MGSteve
Traffic Manager
Traffic Manager
Posts: 133
Joined: 11 Aug 2002 15:07
Location: Walsall, England

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

Post by MGSteve »

Has someone got a Windows EXE compiled with this patch that they can send me?

Doesn't matter if you can't get the maps or scripts to work as I'm working out a way around it for Windows.

But I need an EXE and I can't compile it on my system.. :)

Cheers.

Either upload it or email it to s.t.e.v.e. at ukwebsystems.com

Remove the dots in steve from the email address before sending!

thanks.
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

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

Post by PhilSophus »

How about looking for one, yourself, first? Isn't there a binary in this post? Isn't the newest one, but as there are not this much new features for the scenario editor :wink: that should be okay. And you can load the scenario in any newer trunk version than that it was created with.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
MGSteve
Traffic Manager
Traffic Manager
Posts: 133
Joined: 11 Aug 2002 15:07
Location: Walsall, England

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

Post by MGSteve »

PhilSophus wrote:How about looking for one, yourself, first? Isn't there a binary in this post? Isn't the newest one, but as there are not this much new features for the scenario editor :wink: that should be okay. And you can load the scenario in any newer trunk version than that it was created with.
Sorry, my mistake - I must have missed that one when I was looking through.

Thanks.
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

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

Post by Terkhen »

I'm trying to get this patch working, but I have a problem with the shell scripts. The README file tells me to run "create_files.sh". I couldn't find it so i ran "get_zip_files.sh" instead. It works fine until it tries file "srtm_21_04.zip", getting a response from server error. What can i do to finish getting files?. Thanks.

Edit: I tried it again and it seems to be downloading it correctly now. Thanks and sorry for the post!
CB0T
Engineer
Engineer
Posts: 6
Joined: 27 Apr 2009 04:16

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

Post by CB0T »

Ohh Thanks! :D
User avatar
Comm Cody
Tycoon
Tycoon
Posts: 1060
Joined: 07 Mar 2008 22:21
Location: In a galaxy far far away.

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

Post by Comm Cody »

Worst Bump Ever. :roll: Before you post look at the date of the last post.if it more than a month and your post has nothing to to and is like this>>(ROFL GIMME GIMME WHEEEE :bow: :bow: :bow: :D 8o :)) )<< note this is a example of a no no post. Don't Post it. Ever!
Something goes here, hell if I know.
CB0T
Engineer
Engineer
Posts: 6
Joined: 27 Apr 2009 04:16

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

Post by CB0T »

6 months only. Not 6 years. :bow: :D :) :( :o :shock: :x
andypoth
Engineer
Engineer
Posts: 5
Joined: 16 May 2009 19:47

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

Post by andypoth »

Right, I have been trying for the last four days to get this to work, without any success. I'm using a Mac running Leopard and have installed using MacPorts all of the utilities (z-shell, ImageMagick, gcc, libpng etc.)mentioned, but whenever I run make I get a load of error messages (see attached text file). I have tried to figure this out myself but am completely stuck. I have copied the shell-script and other files in the archive into several different locations but get the same outcome each time,

What do I do? Would I have more success using Ubuntu (which I have running in VMWare Fusion)instead, and how would I start?

Thanks in advance guys.
Attachments
errors.txt
(7.99 KiB) Downloaded 114 times
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

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

Post by cirdan »

Are you sure you have libpng properly and fully installed (both the library and the development headers)? You seem to be missing the latter (png.h).
andypoth
Engineer
Engineer
Posts: 5
Joined: 16 May 2009 19:47

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

Post by andypoth »

Thanks for that - I thought I had the library and header but obviously didn't as after installing them I was able to compile with no problem.

Sadly I'm now stuck at the next step! I have a heightmap, GB_Southeast.png - I have altered get_zip_files.sh to reference this file and have put in the correct latitudes and longitudes for the boundaries. I then run the script (with zsh get_zip_files.sh) and end up with two files, GB_Southeast_info.real and GB_Southeast_water.png, and lots of error messages in the terminal, they're in the attached file.

Any ideas what I'm doing wrong or have overlooked this time?

Thanks

Andy
Attachments
shellscript.txt
(2.21 KiB) Downloaded 125 times
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

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

Post by cirdan »

One of the lines in the output you attached says

Code: Select all

command not found: seq
Do you have a working 'seq' command? (In linux, it usually comes with the coreutils package.)
andypoth
Engineer
Engineer
Posts: 5
Joined: 16 May 2009 19:47

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

Post by andypoth »

Nope, didn't have a seq command on the mac so I changed tactic and decided to use Ubuntu through VMWare. That works fine and I now have my maps!

Thanks for all the help!
ryangs
Engineer
Engineer
Posts: 19
Joined: 11 Feb 2009 11:28

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

Post by ryangs »

andypoth wrote:Nope, didn't have a seq command on the mac so I changed tactic and decided to use Ubuntu through VMWare. That works fine and I now have my maps!

Thanks for all the help!
Here's a pretty simple solution to that problem that I'm using:

http://scruss.com/blog/2008/02/08/seq-for-os-x/

I've certainly ran into a enough other roadblocks trying to get this to work. I had to force uninstall and re-install libiconv through macports, then re-configure, because iconv was giving me a linking error.
ryangs
Engineer
Engineer
Posts: 19
Joined: 11 Feb 2009 11:28

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

Post by ryangs »

I think there might be a bug with placing towns. I'm not seeing any towns with population less than 2000. I have checked that these towns exist in the towns_1k.txt list, but they are not placed, even when I specify "1k" as the smallest town size in the GUI.

Edit: In fact, there seem to be some major bugs in the town placement code. Say I've specified small as 2, 1k; medium as 4, 5k; large as 7, 10k; and city as 10, 50k. Not only do towns under 2000 not show up, some things that should be big are ending up small, and vice-versa. That is to say, towns that have larger populations in reality (and in the txt file), end up smaller than other towns that are, in reality, smaller.

Has anyone else noticed this?
ryangs
Engineer
Engineer
Posts: 19
Joined: 11 Feb 2009 11:28

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

Post by ryangs »

Well, I found the problem. Pretty simple. Line 157 of realistic_towns.cpp. Before:

Code: Select all

if(city.pop/1000 > pop_check[realistic_settings.pop_sel[0]] & num_pop < ncities[0]){
After:

Code: Select all

if(city.pop/1000 >= pop_check[realistic_settings.pop_sel[0]] & num_pop < ncities[0]){
Just fix that after checking out the source and applying the patch, and all of a sudden, you'll find those towns under 2,000 that you've been looking for.

Edit: But it's not quite fixed, these 1k towns are generated with population 0. Looking into it. This whole thing seems to be an off-by-one error, but I don't know if by changing that > to >= I've taken the first step to fixing it or am just making it worse.
Last edited by ryangs on 27 May 2009 20:37, edited 1 time in total.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 46 guests