SC4 Devotion Forum Archives

SimCity 4 General Discussion and Tutorials => Tips, Tricks and Tutorials => Topic started by: DanFraser on September 06, 2009, 03:54:38 AM

Title: Greyscale values help needed
Post by: DanFraser on September 06, 2009, 03:54:38 AM
I'm just bored doing a little program that helps me design a map.

I've found the colour values in another thread a bit further down

RGB=0: 252m below sea level
RGB=50: 102m below sea level
RGB=84: sea level
RGB=100: 48m abv sea level
RGB=150: 198m abv sea level
RGB=200: 348m abv sea level
RGB=255: 513m abv sea level

I've come up with a simple formula to translate the values to metres and it's this:

Quote(Value * 3) - 256 + 4 = Metres

I can't figure out why the +4 is needed to eactly match those values but it seems to be a constant so it doesn't matter.

How have these values to metres been figured out previously?

I'd also like to find out how to define a slope.  Say I have a flat seabed at 20m below sea level, and a slope tile along the coast then a shoreline 20m above sea level.  What value would the slope be in the greyscale image?  0?  Null (in programming terms)?
Title: Re: Greyscale values help needed
Post by: GrindPepper on October 31, 2009, 05:12:59 AM
Do you mean -

((Value * 3) - 256) + 4 = Metres

or

(Value * 3) - (256 + 4) = Metres

Both bring different results each value. Your description of 4 as a constant seems to indicate it's the first formula you mean, and besides, if it were the second option it would be logical to just put it is as 260.
Title: Re: Greyscale values help needed
Post by: ksmith on November 24, 2010, 08:51:52 AM
Quote from: DanFraser on September 06, 2009, 03:54:38 AM
I'm just bored doing a little program that helps me design a map.

I've found the colour values in another thread a bit further down

RGB=0: 252m below sea level
RGB=50: 102m below sea level
RGB=84: sea level
RGB=100: 48m abv sea level
RGB=150: 198m abv sea level
RGB=200: 348m abv sea level
RGB=255: 513m abv sea level

I'd also like to find out how to define a slope.  Say I have a flat seabed at 20m below sea level, and a slope tile along the coast then a shoreline 20m above sea level.  What value would the slope be in the greyscale image?  0?  Null (in programming terms)?

To determine the value for any given elevation based upon your chart the equation is (Elevation+252)/3
Therefore the Elevation of -20 would give you a value of 77.3333 rounding this off to a whole number of 77
and the Elevation of 20 would give you a value of 90.6667 rounding this off to a whole number of 91

To answer your question of the slope in between these two Eleavtions it would be range in values from 78 to 90