View Full Version : [MODCOMP] 16 height levels


ollj
Dec 27, 2006, 03:18 AM
"Level15" creates 15 heightlevels of different brightnesses out of the 3 heightmap-levels, Plains, Hills and Peaks, by adding their overlay brightness to textures of 5 more diferent brightnesses.

Download v3 (http://www.3ddownloads.com/Strategy/Civilization%204/Mods/Level15/Level15v3.rar)

5 texture brightnesses * 3 overlay brightnesses +1 oceanlevel = 16 final brightness-heightlevels.
(this is a work in progress preview, fixing terrain textures and XMLs takes a while.)

If ocean, plains, hills and peaks are not enough height detail this adds smoothness, you can easily see a change of 2 or more levels but a height change of a single level takes a closer look:
http://img214.imageshack.us/img214/5121/greenhillsmalljg0.jpg
(first version. A flat hill made out of 5 different PLAIN grassland textures)
http://img149.imageshack.us/img149/9277/grassdemooa7.jpg
(second version. blue marble textures.)
http://img403.imageshack.us/img403/7803/minimapstz9.jpg
(third version, endgame minimap)

The fake grassland-bumpmap and the civ4 minimap really helps the illusion of 15 different heights.
The checker shadow illusion (http://web.mit.edu/persci/people/adelson/images/checkershadow/checkershadow_double_med.jpg) is its archnemesis (the hill is much darker than civ4 standart grass).
The basic idea is that hills and plains just increase the brightness of the same texture below (they are overlay textures), and the textures below come in different brightnesses to add up to 15 different brightnesses in total.

concept and reality:
http://img84.imageshack.us/img84/7765/conceptcj4.th.jpg (http://img84.imageshack.us/img84/7765/conceptcj4.jpg)http://img220.imageshack.us/img220/7946/realitynl7.th.jpg (http://img220.imageshack.us/img220/7946/realitynl7.jpg)
The right column in the left image, and the upper left square in the right image, shows unchanged textures in comparison.

Large images of flat PLAIN-hills, For now only onlythey look good because of bad alpha maps in hills and peaks (in large):
http://img126.imageshack.us/img126/1296/mudhillav8.th.jpg (http://img126.imageshack.us/img126/1296/mudhillav8.jpg)http://img243.imageshack.us/img243/2343/sandhilllx4.th.jpg (http://img243.imageshack.us/img243/2343/sandhilllx4.jpg)http://img220.imageshack.us/img220/9868/greenhillwf5.th.jpg (http://img220.imageshack.us/img220/9868/greenhillwf5.jpg)

---how it works:
It adds copies of desertblend, grassblend, plainsblend, tundrablend and iceblend 5 times in different brightnesses (+0%, +5%, +10%, +15% +20% white) while all of them are 35% darker and have 35% more contrast (been brighter in earlier versions).
Hills and peaks are replaced with an absolute white texture and an alpha map that adds 25% white for hills and 50% white on peaks so they are just representated by brightness (and 3D heightmap).
- 35% brightness by default + 10% brighter (middle brightness) + 25% righter by hill (middle elevation) = normal brighness (only contrast suffers decrease, thats why we increased it from the start).

The result is 15 different brignesses for desert, grassland, plains, tundra and ice.
Darker versions have more contrast than brighter ones.
It does not work as good on textres that already have a high saturation, like BLUE ocean.

Target:
The actual version is "level15" but the target is "level16", it will create rivers that only flow downwards (I always wanted waterfalls), volumetric oceans of variable height (ice ages decreasing the ocean level), and might enable detailed terraforming (dig a hole here for a canal and stack the earth on a hill for a wall, let the ocean flow trough the canal but not past your hill) and continental drift (I want rivers to be dynamically created by rain from clouds that move upwards on hills that change during the game).

NeverMind
Dec 27, 2006, 05:20 AM
Cool! :goodjob: I would like to see this in the game as soon as possible.

kristopherb
Dec 27, 2006, 06:22 AM
awesome it looks cool
but does it work with blue marble?
have you added defence modifyeirs?
when the comp make's a map it is it used correctly,like the further away fromthe sea the higher?

Gaurav
Dec 27, 2006, 08:23 AM
File link?

ollj
Dec 27, 2006, 05:23 PM
Free hostings are slow on the hollidays.
Its just many testures with even more optical errors, too ugly for many minor update releases.

--but does it work with blue marble?
It just adds new terrains and changes hill and mountain textures, works with both and looks better with one.
How could I NOT use bluemarble textures to start with?
I switched to textures that are 90% like blue marble.

--Have you added defense modifiers?
Yes but that also added to many bugs because I did it at 4am so the first attempt was useless.

--When the comp make's a map it is it used correctly,like the further away from the sea the higher?
This modcomp basically adds the verbs "lower, low, medium, high and higher" to "plains, mountains and peaks.
It should be simple to make a map creation script that just smoothes "plains, hills, mountains" by slight up or down movement depending on how many plains,hills,mountains are next to it.
A plain field surrounded by mountains will become "high plains". A mountain peak surrounded by water and coast will become "low peak".
A high plain is still lower than a low hill and a high hill is still lower than a low peak.

So ive been working on textures, looks much better in blue marble, except for ice having too much contrast and too much brightness.
http://img239.imageshack.us/img239/3582/aaw9.th.jpg (http://img239.imageshack.us/img239/3582/aaw9.jpg) http://img239.imageshack.us/img239/8676/bbw3.th.jpg (http://img239.imageshack.us/img239/8676/bbw3.jpg) http://img207.imageshack.us/img207/3337/ckx0.th.jpg (http://img207.imageshack.us/img207/3337/ckx0.jpg)
Low hills and low peaks still do not blend correctly into the next lower level, leaving dark borders and a contrast-increasing optical illusion as seen on the middle image.
15 different height levels also enables a slow 15 tiles long incline, you can place 3 cities along that.

Anyways, I made a larger mountain (mapsize is medium) with 7-8 diferent height levels (final should be able to have twice the size with the same slow incline):
http://img127.imageshack.us/img127/9482/topti2.th.jpg (http://img127.imageshack.us/my.php?image=topti2.jpg)http://img134.imageshack.us/img134/4258/plainsdeserttj5.th.jpg (http://img134.imageshack.us/img134/4258/plainsdeserttj5.jpg)
http://img134.imageshack.us/img134/4986/grasskw3.th.jpg (http://img134.imageshack.us/my.php?image=grasskw3.jpg)http://img315.imageshack.us/img315/5088/plainstundraaw3.th.jpg (http://img315.imageshack.us/img315/5088/plainstundraaw3.jpg)
low Tundra hills surrounded by higher tundra plains look like larger bluemarble peaks (because more brightness on tundra looke like ice), I wonder how tundra peaks look like...
Is my monitor so bad or why does it look much better on a small image?

There are MANY issues especially with many alpha maps if the terrain brightness goes from -35% to +35% brightness.
You see much contrast on most objects, the same city or unit looks much much brighter on a low level than on a high level due to the checker color illusion.
This gets ugly with rivers and forests. Too ugly for a release.

ollj
Dec 28, 2006, 09:04 AM
Finally got it working, here is a closeup of Mt. Ollj, 35 plots wide:
http://img411.imageshack.us/img411/6189/lowor1.th.jpg (http://img411.imageshack.us/img411/6189/lowor1.jpg)http://img411.imageshack.us/img411/2095/desertjj7.th.jpg (http://img411.imageshack.us/img411/2095/desertjj7.jpg)
http://img301.imageshack.us/img301/8973/tundracg3.th.jpg (http://img301.imageshack.us/img301/8973/tundracg3.jpg)http://img132.imageshack.us/img132/2527/topiq8.th.jpg (http://img132.imageshack.us/img132/2527/topiq8.jpg)http://img136.imageshack.us/img136/1158/plainstf5.th.jpg (http://img136.imageshack.us/img136/1158/plainstf5.jpg)
http://img132.imageshack.us/img132/6067/highgh2.th.jpg (http://img132.imageshack.us/img132/6067/highgh2.jpg)http://img237.imageshack.us/img237/1338/grasszq2.th.jpg (http://img237.imageshack.us/img237/1338/grasszq2.jpg)

NeverMind
Dec 30, 2006, 06:24 AM
Thanks, ollj! Already downloaded. I will report as soon as i can play Civ. Not much spare time now, though. New Year is coming! :D

NeverMind
Jan 12, 2007, 02:27 PM
How it is going, ollj?

I've finally started my first civ game this year and i play it with this mod. It looks pretty cool so far. :)

ollj
Jan 17, 2007, 03:13 PM
Spend 2 more weeks with the sdk, trying to add more height types, right after the 2 clueless weeks before, where I tried the same without knowing much about modding.
Result is accepting that this workaround is the only and best way to add more height levels for now and propably for a long time.

Added water textures and land textures.
It sums up to 5 temperature levels with 2 moisture levels in 15 height levels:

dry: wet:
hottest: lava rock deep sea abyss
hotter: desert ocean
temperate: plains shelf
colder: grass swamp
coldest: tundra ice

Temperatures and moistures can be merged into 10 temperature-moistures by just linking swamp and grass and assuming that colder always equals wetter)
Then you can also place high shelf/swamp next to low grass/plains to add 5 more height levels.

Succeeded in giving peaks yields and in adding a "peakyieldchange" modifier to the sdk and python code that works like "hillsyieldchange"; hills removing one food and adding 1 hammer, peaks ... adding 1 gold (all depending on terrain and needing ballancing)

I paused on the terraforming and mapmaking code, waiting for a helping response.
Id like to start with something similar to the terraforming code of the "genetic era" mod but this includes lots of cvgamecore.dll editing and i took a break from that and tried some pythoon to make any techtree more colorfull (http://forums.civfanatics.com/showthread.php?p=4995523#post4995523).

Yield detail issue -> double yields halved by civics:
To emphatize the differences of twice as many terrain types I need more yields per tile in average.
Seems like I have to double the average yields per tile (and doube any yield bonus and decrease) or tile yields are too similar.
The idea is that civics halve all the doubled yields back to normal (with variations between the civics):
Every of the 5 choosen civics gives 3 times -10% on one of the 3 yields (one civic could give -30% food).
5 civics add up to 3 times -50% for the 3 yields.
In average the doubled yields are halved, -50%, (*2*5/10=1) to normal but one doubled yield could go up to -10% (*2*9/10==*1,8) for another doubled yield goes down to -90% (*2*1/10==*0,2)...
"Doubled yields halved by civics should add a lot of detail and strategy value to the game[/b] (and really confuse the AI) sadly there is a limit of yields per tile in the gamecore.dll and after 2 weeks of triing just to see that adding height types is impossible ive had it with the gamecore.dll for some time.

Arexack_heretic
Jan 20, 2007, 06:34 AM
Interesting.

Did you find out how height is added to tiles during mapgeneration?
I'm looking into that now, but just starting out on python.

tile-Height (not tobe confused with map-height) determines the way rivers flow, I understand, but is height added to landmasses depending on their size?

You mention that you are unable to introduce height terrains.
Is it not possible to do it in python?
[ If height > iHeight: terrain type is level1] or somesuch

---
I find you effort realy fascinating:

With a tile.height value|(iH), you can do things such as altering biotopes based on altitude.
(every +3km of alt.above sealevel = 1 degree colder.) IIRC.

In python feature generator something like:

lat = ((self.iHeight/2)-iY)-(iH/15)*(self.iHeight)
If lat >1: lat = 1
If lat < 0: lat = 0

kristopherb
Feb 14, 2007, 07:41 AM
Can map scripts (loaded from site)work with this cool mod?

why does it have to be a non-zip mod?

Fiend777Fits
Feb 26, 2007, 01:36 PM
this looks like a nice idea for mods. pre-made maps could use this definitely. but any map generator probably would fubar this. keep up the good work. with all the work that the cfc guys are doing on the sdk code, they probably should get you guys to make civ 5.

Jouda
May 01, 2007, 06:04 AM
any progress on this, guys?

primem0ver
Jun 05, 2007, 04:19 PM
Sometime in the next year I may write a map script that WONT mess it up. Actually this mod could come in quite handy because it will not just be a script, it will involve SDK code because I am developing a geologic evolution simulator outside of the game that I can use a simplified version in a new map generator class... but we will see if I find the time.

Fanatic Demon
Sep 06, 2007, 08:44 AM
Very intresting mod. I realy hope it will be posible to create the illusion of height difference or simulate it. It would be realy great to so this combines with some realistic global warming effects, where the sea litterly rises after full global warming strikes

Mylon
Sep 06, 2007, 02:11 PM
Ooo, nice concept. Now if you can add cliffs... Movement would be difficult to get involved since most units only move 1-2 tiles anyway. It's already easy to exploit the default game with a movement 2 unit by moving plains->forest to get the effect of having 3 movement points for only 2.

Seven05
Sep 06, 2007, 09:41 PM
It's pretty easy with a map generation script to achieve the results you're looking for without messing with the SDK at all. Well, maybe I should rephrase that, it isn't impossible :)

The first thing you need to do is generate your maps with a heightfield rather than doing what most currently do and simply assign the plot value (ocean, lanc, hill or peak). There are a lot of open source heightfield generators available, converting them to python would be tedious but not difficult. Translating that into the game's existing plot types and then your textures is considerably easier, the hard part would be the time needed to add all of those as new terrains in the XML but I think you've already done that.

Now, the good news is that there is a map script out there already that would be relatively easy to modifiy. I've done something similar using that map script and modified versions of cool, temperate and hot versions of the base terrains (excluding tundra and ice of course). Since the map script already simulates rainfall and places grasslands, plains and deserts accordingly and has the temperature data for ever plot readily available it was pretty easy to do.

The map script you want is called 'Perfect World' you can find it here on the CF forums under map scripts. For an example of how easy it was for me here is a code snippet of the terrain mapping (placing textures basically):
elif rm.rainMap[i] < self.desertThreshold:
if tm.tempMap[i] < 0.11:
self.terrainMap[i] = self.ICE
elif tm.tempMap[i] < 0.22:
self.terrainMap[i] = self.TUNDRA
else:
if rm.rainMap[i] < (random() * 0.5 + (1 - rm.rainMap[i])) * self.desertThreshold:
if tm.tempMap[i] < (random() * 0.25 + 0.75) * 0.35:
self.terrainMap[i] = self.COOLDESERT
elif tm.tempMap[i] > (random() * 0.25 + 0.75) * 0.70:
self.terrainMap[i] = self.HOTDESERT
else:
self.terrainMap[i] = self.DESERT
else:
if tm.tempMap[i] < 0.35:
self.terrainMap[i] = self.COOLPLAINS
elif tm.tempMap[i] > 0.65:
self.terrainMap[i] = self.HOTPLAINS
else:
self.terrainMap[i] = self.PLAINS
If you're curious the rainmap and temperature map both hold their values for each tile, there is also a heightmap readily available. Once you have the height, temperature and rainfall data for any given tile it's not to hard to get some very realistic terrain types. Each of those maps stores their data as a floating point value between 0 and 1 so simulating a mere 15 altitude levels is no problem :)

Anyway, take a look at his map script and let me know if you want to colaborate some of our work. I'm not in the mood to edit all of those textures so I'm willing to do your python work in exchange for a few textures :)