More Work With Planet

Last week I started working with Torben Mogensen’s planet heightfield generator. This week I’m going to continue on that vein a little longer.

First off, we’ll start with a method to create a seamap image for our new world. Let’s start by creating a new color file.
0 0 0 0
1 255 255 255
2 255 255 255
3 0 0 0
4 0 0 0
5 255 0 0
6 255 255 255
7 255 255 255
8 0 0 0
9 0 0 0

Copy and paste the code snippet above into a flat text file named sealand.col.

Here I’m going to make a short digression into what all of this opaque text means. Each column consists of a color number and three numbers representing, in order the red, green and blue values referenced by the color number. The color numbers range from 0 to 65535 and the rgb values having different ranges depending on the output image type. If the output image is 8-bit as is required for BMP output, then the range of values for the red, green and blue channels is 0 to 255. If the  output image is is 16-bit, which, as far as I can tell, can only be handled by the XPM file format(-x option), then the red, green and blue channels can range from 0 to 65535.

In retrospect I notice that Mr. van Vliet’s 16bit.col file has color numbers and values that extend up to 65536. This doesn’t seem to break the program, but I don’t know if it effects the output. According to Mr. Mogensen, the break between sea and land occurs at a color number of ({maximum color number} + 6)/2.

The rows, therefore, each represent a numbered color value. The first row is usually set to black(all channels zero), the second to white(all channels set to the maximum value for the format). The third row, numbered 2 is the chosen background color. The fourth row, numbered 3, is the color desired for graticule lines. The fifth row, color number 4, is the chosen color for continental outlines, and the sixth row, numbered 5, represents the color for other contour lines.

The seventh row and after, numbered 6 through the highest color number, represent increasing altitudes. Color values are interpolated for color numbers between entries.

In the case of the sealand.col file, ocean areas are represented in white and land areas are represented in black. This could readily be inverted by setting colors 6 and 7 to (0,0,0) and 8 and 9 to (255,255,255) if necessary. Easy-peasy.

Currently I’m trying to figure out how to adapt the Default.col, Burrows.col and Olsson.col to Wilbur. I think the Mars.col might be worth adapting as well.

One problem with random generation of planetary terrain is the lack of control over the hydrosphere fraction. John Olsson’s is capable of approximate hydrosphere control(it’s done using the histogram of a not necessarily equal-area projection, so it’s not terribly accurate). There’s a couple of tricks with planet.

The first one is simply to generate the 16-bit heightfield as per the previous post. Then you can project that to an equal-area map using Flexify, Matthew’s Map Projection Software, Flex Projector or G.Projector. Then you can just adjust the sea level, in Wilbur perhaps, checking the histogram as you go till it approximates your desired level closely enough. This one works well for me because I’ll likely be changing things a bit anyway.

Another method that I used at one time is to try generating a number of maps in Peters projection(a case of the cylindrical equal-area projection). Planet returns the ocean cover fraction to stderr which should show up on the console. Then I save the map image along with a text file describing the parameters and ocean fraction(in other words, the hydrosphere) in a library folder. In my case I subdivided my “Planets” into a set of lesser folders by approximate hydrosphere. For example, “Planets/1,” “Planets/2,” …, “Planets/9,” “Planets/0,” with the, “1,” folder holding maps with a hydrosphere between 0 and 10%, “2,” folder being >10 to 20%, and so forth, with the, “9,” folder holding maps with hydrospheres from >80 to 90% and the, “0,” folder representing >90 to 100%. Usually ten percentage points was close enough for the kind of work I was doing and I could just set my planet’s hydrosphere value based on the value for my map. When I was just trying out settings at random, it seemed like a shame to throw away all those perfectly good maps.

Just wanted to get this out there. Now onto other things…

The Astrographer.

Advertisements
This entry was posted in Mapping, World Building and tagged , , , , , , , , . Bookmark the permalink.

One Response to More Work With Planet

  1. Pingback: Smoking GRASS | Astrographer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s