Importing HeightMaps in OpenTTD?

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

Moderator: OpenTTD Developers

User avatar
Ladis
Engineer
Engineer
Posts: 60
Joined: 04 Dec 2004 15:15
Location: Prague

Post by Ladis »

MeusH wrote:Thank you! Could you tell me what what software were you using? I'll modify the png anyway because I knew there will be loads of islands/pyramides
To convert it into 16 colours just use Irfan..
But I didn´t find the best software for creating those maps. So I still use win painting.
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Irfan? Ifranview?
win painting? MS Paint?
User avatar
Ladis
Engineer
Engineer
Posts: 60
Joined: 04 Dec 2004 15:15
Location: Prague

Post by Ladis »

MeusH wrote:Irfan? Ifranview?
win painting? MS Paint?
Yes, sorry :)
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Can anyone explain why enum{ FOO, BAR, BAZ, ...}; is so evil, and must be enum{ FOO=0, BAR = 1, BAZ = 2, ...};? (specifically, the fios constants in hal.h)
Does it really matter what values those constants get? And are there really any compilers anywhere that provide some *OTHER* values? (Read: Doesn't the standard specify that the first and the second are always exactly equivilent?)

More on-topic, it appears that the PNGMap patch got slightly out of date. I've rectified this problem:

No changes other than bringing things up to date.
Attachments
release.zip
(1.12 MiB) Downloaded 410 times
source.rar
(1.96 MiB) Downloaded 377 times
pngmap9_3305.patch
(26.03 KiB) Downloaded 382 times
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
User avatar
LordOfThePigs
Route Supervisor
Route Supervisor
Posts: 435
Joined: 01 Jul 2004 10:28
Location: Jura/Switzerland

Post by LordOfThePigs »

Hey, I'm trying to make a scenario for switzerland and I have produced a height map. However the palette is not in the correct order. For some reason Paint Shop Pro 9 keeps changing the palette order when saving the png file.

What software can I use to get the palette order right (as in reorder the palette from darker to lighter).
Attachments
final_octree.png
The height map for switzerland in 2048x1024 format
(152.34 KiB) Downloaded 447 times
Sometimes I'm told "Brilliant"...
Sometimes I'm told "Charming"...
And Often I'm told "Shut Up"!
User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post by webfreakz.nl »

MSpaint?
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

LordOfThePigs wrote:Hey, I'm trying to make a scenario for switzerland and I have produced a height map. However the palette is not in the correct order. For some reason Paint Shop Pro 9 keeps changing the palette order when saving the png file.

What software can I use to get the palette order right (as in reorder the palette from darker to lighter).
Yeah, this one caught me out too. When you bring up the save dialog, select PNG format, and click Options. You will see that Psp has "optimise palette" selected by default. This is what is scrambling the palette. Select "Non-optimised palette". Solved problem for me.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Post by jvassie »

Any updates LordOfThePigs? It'd be wicked to have an accurate scenario of Switzerland to go with the Swiss Set! :)

Any how, do you still check on progress with us? :wink:

James
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

LordOfThePigs wrote: Paint Shop Pro 9 -
What software can I use to get the palette order right (as in reorder the palette from darker to lighter).
PSP9 is fine. If you are 100% sure your palette is in ascending brightness order, then you can simply go "Greyscale", followed by "Reduce colours to 16". Then save as PNG (with non-optimised palette).
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
cccp
Engineer
Engineer
Posts: 12
Joined: 14 Aug 2001 23:26

Post by cccp »

Here is a really long overdue update... I just finished final exams and finally have some time.

Changes:
Works with any color depth - Indexed, Grayscale, and 24-bit RGB color PNGs will work now. Also, any transparency/16-bit color is discarded, so pretty much any valid PNG file should load just fine. All color is converted to grayscale, ranging from black at height 0 (water) to white at height 15 (highest mountain). So no more messing around with problematic palettes! :D

The "Are you sure you want to load...?" dialog was removed since it's possible to close the file browser to cancel.

Future plans:
A separate window showing the loaded image and map preview, with adjustment options (probably similar to SV0 Creator's interface).
Maybe eventually something like the map generator could use it as well...


Let me know if there are any problems... so far I've tested it on OS X and Win2K, though there aren't any OS-specific changes. Also, I'm open to suggestions for the map load window interface and features... it's all still in the planning stages.


Edit: Some small bug fixes
Fixed incorrect loading of 4-bit images, slightly modified the error messages, and changed the grayscale conversion to use a bit shift instead of division (probably almost no difference either way).
Attachments
pngmap10_fixed_win.zip
Windows binary based on the r3351 source, with the fixed patch.
(680.77 KiB) Downloaded 510 times
pngmap10_fixed.patch
Fixed patch, updated for r3345
(26.49 KiB) Downloaded 470 times
Last edited by cccp on 29 Dec 2005 09:31, edited 2 times in total.
thor
Engineer
Engineer
Posts: 7
Joined: 20 Dec 2005 22:29
Location: Denmark

Playing scenarios PNGMAP10_win_158 in the official release

Post by thor »

Hello!

How to??

I have created a Denmark.scn in pngmap10_win_158 (thank you for the last 16-bit interpreter - it works!) and wanted to run it on OTTD 0.4.0.1 - All I get is a GAME LOAD FAILED.

QUESTION:
My scenario is a 2048*2048, and rich on detail - can I count on the possibility of in the future running it on official releases, or shall I forget the hole thing? I would very much like to share this scenario with everyone else when I'm finished working on it.

/Thor
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Re: Playing scenarios PNGMAP10_win_158 in the official relea

Post by MeusH »

thor wrote:My scenario is a 2048*2048, and rich on detail - can I count on the possibility of in the future running it on official releases, or shall I forget the hole thing? I would very much like to share this scenario with everyone else when I'm finished working on it.
If the developer team likes it, and it has a lot of features, it may be added. However, there s one Denmark map already
thor
Engineer
Engineer
Posts: 7
Joined: 20 Dec 2005 22:29
Location: Denmark

Re: Playing scenarios PNGMAP10_win_158 in the official relea

Post by thor »

I realize that there is allready a Denmark scenario. I think its 256*256 which I find TOO small for a game that will last you more than 5 hours.

Is there a list of developers-accepted SCN, and are there any "official" guidelines for creating SCNs?

/Thor
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Make them so good that I like it :P
Frankly, scenario must be working in a pure nightly, and have features. No empty flatlands
JayBro
Engineer
Engineer
Posts: 1
Joined: 15 Feb 2006 20:05

Post by JayBro »

Oh my god, this is so cool... and easy!

I think I am going to create an Middle Earth, or a portion of it, have not seen it here, might be fun...

But first some testing...

Big hooray for cccp... :lol:
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

It seems to me that this thread belongs in OpenTTD Development? Maybe that's just me, though.

Second, unsurprisingly enough, in 958 revisions, attrition has, in fact, caught up to us. It applies and compiles just fine; but it has a habit of segfaulting at inappropriate times.

It's bedtime now, though. I'll look into it sometime in the next 24 hours, assuming no one beats me too it.
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
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

And it seems to work now.
Attachments
pngmap11_r4317.patch
(26.6 KiB) Downloaded 391 times
OTTD-PNGMap11-r4317.zip
(1.18 MiB) Downloaded 446 times
source.rar
(1.85 MiB) Downloaded 344 times
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
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

I fixed it to compile without WITH_PNG once before, so surely it'll still work, right? No. Of course not. :roll:

Fixed.

The changes here are to properly wrap the SLD_PNG bits in main_gui.c with an #ifdef WITH_PNG/#endif, and to add a break; to the relevant case.

BTW: The change in PNGMap 11 was to assert that edge tiles were MP_VOIDs instead of trying to set them to MP_CLEARs.
Attachments
PNGMap12_r4351.patch
(26.65 KiB) Downloaded 476 times
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
User avatar
BoominGranny
Engineer
Engineer
Posts: 85
Joined: 18 Apr 2006 02:16
Location: Wellington, New Zealand
Contact:

Post by BoominGranny »

i appreciate all the programming effort that has gone into this - this thing rocks.

if anyone is interested nasa has heightmaps here:
http://www2.jpl.nasa.gov/srtm/dataprod.htm#Gallery

im sure somewhere nasa has other planets too :)
GiZ
Engineer
Engineer
Posts: 5
Joined: 22 Apr 2006 12:07
Location: Hannover, Germany
Contact:

Turorial

Post by GiZ »

Hello i am new to this site :)

So, i wanted to import an HMAP either...but i can't see really through all this update things and what exactly i have to do... could there be anyone so nice to write a little Tutorial or so, where it is mentioned, what i have to download an how can i use it for importing HMAPs ? Would be very nice :roll:

Thanks so far, GiZ
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 5 guests