Menu

LEX File Exchange
EA Support Files
SC4 Wikipedia
Network Addon Mod
Dependencies
Chat
Welcome to SimCity 4 Devotion. Please login or sign up.

August 16, 2022, 08:44:38 PM

Login with username, password and session length

Downloads

Mapmaking experimentations - What do you think about that ?

Started by Izidor44, October 12, 2011, 06:50:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Izidor44

Hello Gentlemen,

Still trying mapmaking experimentations, I would like to share the last prototypes with you. You will probably have some advices en suggestions to make about !

The main problem was to respect correct terrain elevations and to clearly see what is the "impact" of the terrain scale value in SC4T, while importing greyscale maps.

So, I started with a small test : a small region in SC4T, where the elevation is imported from a simple color gradient image (starting from 0 to 255 greyscale value)



After creating this region, I then measured the lowest and highest elevation, and noted where was the shoreline. I did this action with every terrain scale value elevation, from 100 to 5000.

The results were :

SettingMinShoreMax
1002,00187 px347,24
2502,00129 px496,08
5002,0086 px744,12
Default2,0085 px759
10002,0053 px1240,21
15002,0037 px1736,26
20002,0029 px2232,35
Import.dat2,0025 px2475,15
25002,0023 px2728,43
30002,0020 px3224,51
35002,0018 px3720,59
40002,0016 px4216,68
45002,0014 px4712,76
50002,0013 px5208,81


Setting : the terrain scale value set before importing
Min : the lowest elevation on map, corresponding to the blackest line of pixel (Grey value 0, left border)
Max: the highest elevation on map, corresponding to the whitest line of pixel (Grey value 255, right border)
Shore : the location on map of the shoreline, "187 px" means that the shoreline is on the 187th pixel row of the map, starting from the left side


The next step was to calculate, for each grey value (from 0 to 255), which elevation in meters is corresponding.

I extrapolated this calculation :

Elevation = (max. elevation in meters / 256) x grey value + 2

So, for example, with the default setting, grey value 84 means :

(759/256) x 84 + 2 = 251 meters above see floor... ...which means lowest land

I did a whole spreadsheet in Excel, when you can see the elevation in meter for each greyscale value, in each importing scale.


So, let's start a real experimentation with realistic map. I selected the DEM datas for the region of the Ruma's National Park in Kenya :

http://maps.google.fr/maps?hl=fr&ll=-0.553428,34.289703&spn=0.752523,1.319733&t=p&z=10&vpsrc=6

I then opened the DEM map in Microdem and selected a 56 x 56 km area where the lowest elevation is 1 130 meters (water level of the lake) and the highest is 2 269 meters.
Delta is : 2 269 - 1 130 = 1 139 meters

Let's open GIMP now !



At this stage, blue y value means "sea" , 0 grey value means "lowest land" and 255 grey value means "highest land".

My maximum elevation will be 1 139 meters above see level, which means 1 390 meters above see floor.

With a 1.500 meter setting, 205 greyscale value is corresponding to 1 392 meters above sea floor. Shoreline will be at 37 greyscale value.

After isolating the blue areas, I modified the color settings of the ground terrain in order to have all values ranging from 37 to 205.

Then, I simply edited the sea zone with a crude "decrescendo" of greyscale value (from 35 to 0).



Imported in SC4T and equalized a few time :



I tested some spots on the map, with Microdem and Google Earth opened, in order to compare with SC4T values. It did pretty well.

So, what do you think about this ?

whatevermind

This is awesome!  First time I think I've seen anyone work out the math behind this for SC4.  Makes it much easier and faster to set up the grayscales for creating accurate regions.

On a side note, where do you get your DEM data?  I've been looking for a good replacement source for data outside the US since they reworked the Seamless server to only cover parts of N. America.

dobdriver

That's very cool Izi especially for 8bits, so cool I decided to have a crack, now I left out a few tiny islands and didn't worry about rivers or creeks, and the two small islands I didn't split. It is also 14 tiles square but has a extra 42 pixels/side added that accounts for the 1024 pixels/km. The max elevation is 1131m above sealevel. Also because I use a different colour palette in terraformer it takes a few metres of elevation to get out of the green.





I think you should upload that somehere.

One thing I have just discovered is city borders cost 80KB for the equivalent quality image. Ouch!

cogeo

Some comments:

The elevation calculation is controlled by the ImageImportScaleFactor property (default 3.0) in the "Terrain Properties" exemplar. The formula is:

Elevation = ImageImportScaleFactor x GrayValue

Sea level is by default set to 250.

The above pose a number of limitations:
- The maximum elevation a gray-scale image can represent (using the default settings) is 3.0 x 255 = 765 meters, or 515 meters above sea level.
- A gray-scale image can only represent values that are multiples of 3.0m, often resulting in a "steps" effect.
- You can play with the settings (basically with ImageImportScaleFactor), to represent higher elevations, but this causes two other problems, first is exacerbates the steps effect and second the land/water threshold is affected too, eg a value of 83 with ImageImportScaleFactor set to 3.0 would be water, but with ImageImportScaleFactor set to a higher value it will be land.

Check my West Macedonia maps on the STEX/LEX, the set includes a number of plugins for importing the maps correctly, which make use of the above features.

dobdriver


Yes the in-built plugins in terraformer are very accurate (to within +/- 0.01m or 1cm) when loading a pure white(0%) greyscale map.

You're right Cogeo about the stepping effect, a 4000m map looks god awful in 8bits. The first 8bit maps I made only stretched to 1000m and the only solution is to go to 16bit greyscales, for which basically photoshop or photoshop elements is required. The gimp one day might support 16bits and they have been working on it for sometime now. Who knows?

Terraformer's only downfall in that department is that it flat tops everything over 6000m (mapper can produce up to the full 6553.6m), although that is not such a problem as SC4 itself has its' own difficulties at these elevations with textures tearing and dragging oneself up and down mountains does give one a feeling of mountaineering.

Izidor44

Hi mappers,

Thanks first for posting here !

@ whatevermind : here is the goldmine http://www.usgs.gov/
@ dobdriver : any chance to share your SC4T color settings with us ?  ::)

Effectivelly, in my opinion, the 5 first elevation settings are affordable (100, 250, 500, standard, 1000) in map making with my poor ol' 8 bit technology.

Beyond this, maps looks like "stairs" and completelly unrealistic. It means that it ranges mapmaking possibilities to area under elevation of 1000-1200 meters above sea level. It leaves a large choice of possbilities anyway. But it could be frustrating when you try to map a flat coastal area with a big volcano, for example.

Dob, I'm particularly jealous when looking my SC4T map and yours. Have you seen how smooth are your plateaus, in the bottom right quarter of the picture ? It perfectly illustrates the 8 bit limits and possibilties  :'(

Cheers,

PS : I really miss city borders on maps. For me, I like where, in an upload, there's a global isometric view of the region (made with Region Census, for example), and a more "real map" picture showing the cutting, no ?

Izi