News:

Simutrans Forum Archive
A complete record of the old Simutrans Forum.

Height map file does not show up as availalble. Too steep?

Started by jameskuyper, December 10, 2015, 03:55:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jameskuyper

I created a height map and placed it in simutrans/maps. I successfully loaded an earlier version of this map, so I'm reasonably sure that I put it in the right directory and that it should show up when I select "Load Height Map" from the new game dialog. It doesn't. I started up with "-log 1 -debug 3", and found precisely one message in the log file that seemed relevant:
QuoteERROR: karte_t::load_heightfield():     Heightfield has wrong image type P5 instead P6/BM
For help with this error or to file a bug report please see the Simutrans forum:
http://forum.simutrans.com
I have no idea what P5 and P6/BM refer to. The routine I used to create the ppm file doesn't appear to have any options with names that match those terms. I've attached the gzipped height map file.

Since I am deliberately trying to create a map with an unusually steep slope, I won't be surprised if the problem turns out to be due to the slope being too steep. But if that's the problem, I'd appreciate a definition of what "too steep" means in this context, so I can manipulate my height map to avoid triggering such a problem.

TurfIt

P5 means you've created a .pgm file instead of a .ppm which Simutrans expects.
P5 - binary PortableGreyMap - 8bit grey scale.
P6 - binary PortablePixMap - 24bit RGB.

prissi

BEtter use BMP files, RLE encoded the could be even very small.

jameskuyper

Quote from: TurfIt on December 10, 2015, 04:17:51 AM
P5 means you've created a .pgm file instead of a .ppm which Simutrans expects.
P5 - binary PortableGreyMap - 8bit grey scale.
P6 - binary PortablePixMap - 24bit RGB.
I created the first file by using IDL's WRITE_PPM routine with a simple 128x128 array of altitude levels, which explains why it came out in P5 format. I've now created an array containing three copies of the original array - in IDL terms it's dimensions are [3,128,128], which is supposed to be the right way to create a true-color image for use by WRITE_PPM. When I passed that array to WRITE_PPM, it produced the attached file. It displays in a reasonable fashion when I use several different types of image viewers. I no longer get an error message in the debug log file, but the map still doesn't show up as one of my height map options. Any ideas?
I'm still voting for the "excessively steep" option - but he absence of a corresponding error message confuses me.

TurfIt

The max pixel value must be 255 for Simutrans. The attached file has 179 specified in its header. A little hex edit to 255, and it shows up / loads into Simutrans...