[WIP] GeoRealism Engine - a terrain generator

primem0ver

Emperor
Joined
Jun 16, 2006
Messages
1,158
Location
Peoria, AZ
The GeoRealism Engine

This is a new feature I am hoping to add to the game. This mod is in the early stages of development. I am looking for feedback, suggestions, comments, and help.

A little background
I am what you would call a "map fetishist". I am obsessed with maps and it annoys me that map based games use fractal algorithms because except for placing the location of land plots, such algorithms do not produce maps that are geographically and scientifically accurate. I am reviving an old project that I started for Civ 4 while working with the Caveman2Cosmos people. This will be a DLL mod and therefore not mixable with current DLL mods. However, I am going to make it easy as possible for anyone wishing to use this in their own DLL code to transfer the code and used files.

A little history
I never gave up on the concept though I got tired of my work progressing so slowly due to some bad algorithms. I recently came across it again and have vastly improved the "lab" program (written in C#) that is allowing me to develop the algorithms necessary to do this correctly. As a result I have been able to create new algorithms that are much more effective.

Refinement of project
I have decided to target Civ V since there are enough good mods out there now to enable me to play the way I like to (thanks CCTP, legions, and a few others) and because I have determined that it is possible do such a mod for Civ V (I was a bit skeptical at first).

Goals of this Mod:
  • Keep in separate dll to keep changes to core DLL minimal and easy to import into current DLL mods. (If possible)
  • Refine the current concept of climate and add biomes to the game. (Biome information may be kept private until a given technology is acquired in game).
  • Add several new "terrains" and "features" to the terrain which make it much more realistic in terms of the variation in yields.
  • Create maps that are geologically and geographically realistic in terms of topography and climate.
  • As implied by the above two features, the result will give a much more diverse terrain.
  • Allow the identification of geographic and topographical characteristics/features and optional labeling (imagine names for mountain chains, oceans, lakes, bays, seas, gulfs, etc...).
  • Keep compatible with all map scripts that are designed to create entire worlds (and possibly smaller sections of such worlds)
  • Make is so that anyone that wants to add a new map script for any mod that incorporates this code does not have to worry about terrain, feature, or resource placement. (This engine will eventually take care of ALL of those aspects of the terrain). The only need for any map script designed for this mod is to place land and water on the map. (So basically, ocean, coast, and flat lands. This mod will eventually take care of hills and mountain placement).

Steps to complete climate part of engine:
  1. Build algorithm lab that imports maps so that algorithms do not have to be tested in game - COMPLETE (was completed before but I have significantly enhanced its functionality)
  2. Add algorithm for recognizing different types and locations of bodies of water. ALMOST DONE
  3. Add algorithm for recognizing surface currents
  4. Add Civ V map style to import and calculation functions (I am still developing using Civ 4 maps since the map type doesn't affect the outcome).
  5. Add algorithm for simulating air mass systems
  6. Add algorithm for calculating the environmentally relevant statistics for each plot.
  7. Create XML files that include relevant climate and feature data - DONE BUT NEEDS TO BE UPDATED AND MODIFIED FOR CIV V
  8. Add algorithm for determining climate based on above statistics
  9. Add algorithm for adding vegetation features to the land based on determined biome and plot statistics.

When the climate portion is done, I will do the topography/feature engine. Keep in mind that topography affects climate so later changes will affect the outcome of the above changes. Also... map scripts will need to place mountains and hills before the topography part of the engine is completed.

Keep in mind that the summer is the only part of the year that I have to devote a lot of time to development of this engine. (I am a teacher). During other parts of the year, progress will be slow. If this doesn't get completed before Civ 6 comes out (and I start playing it), then it should be easy to adapt the map importer to accept Civ 6 maps.

Added NOTE:

A I near completion of the water body finding algorithm I am reminded of another goal of this mod: to do my best to keep the time it takes to create a map down. Please keep in mind that the algorithms to do the desired tasks are complicated and will take some processing time. So I will report the times involved so that it is known how much time will be added to creating the map using this mod. As I report these times it is important to know the relevant specs about my system:

Processor: Pentium i7-4770 @3.4GHz
RAM: 16GB DDR3 @? - I'll figure out the speed later.
OS: Windows 7.
 
I owe Nutty some thanks in conceptualizing how this could work in Civ V.

IMPORTANT
From what I can tell, there is no way to technically add new terrain to the game which is very unfortunate and in my opinion a mistake on the part of the designers. However, Civ 5 added terrain variation by defining "styles" to the terrain (i.e. African, Asian, European, and American). I believe that this can be used to create the appearance of new types of terrain. It is important to understand though that terrain styles will no longer be used. Instead, terrain styles will be used to add new terrains. There are two approaches I can used which I will discuss below (item 2 in the terrain model). However, for now just understand that there will be a significantly larger variety to "terrain" types and feature types so the terrain will still look varied. However, remember that terrains will no longer be "styled" to "appear" different based on which "continent" is represented. (Honestly, I think "styles" were a misguided attempt at creating diversity based on location rather than climate. The truth is however is that while such diversity exists because of species isolation, there is a much bigger reason for the differences in appearance: climate. An oak tree is an oak tree no matter where it is located so it is not the location that matters; rather it is the biome or climate that matters since oaks do not grow in all climates.

Terrain Model

The terrain model used in this system will be more in depth than the one currently used. Here is a list of concepts from the bottom up that explain how yields and resources will be determined.
  1. Plot type (this exists in game... plains, hills, mountains, coast, ocean)
  2. Five soil classes will replace the traditional "terrain" concept. As planned now, these soil classes will be further divided into soil terrains (4 each corresponding to the 4 different styles) which include the real to life combination of soil type and micro-vegetation type (see table below). "Micro-vegetation" is any vegetation that is shorter than half a meter tall. Since I am only allowed 5 terrain slots in the traditional terrain yield system for Civ V, I will either need to modify the traditional yield system or make some micro-vegetation types (which don't coincide with larger vegetation) a feature to make all soil terrains realistic in their yields. The model I am proposing here is consistent with the latter.
  3. All features except for natural wonders and the one or two geologic features that exist, will basically represent the "Macro-vegetation" (as it already does.).
In the final analysis, the soil terrain and features assigned to a plot (other than natural wonders) will be based on an XML file that defines "Bioterrains." A Bioterrain will consist of a terrain, and a feature (including no feature). Each biome will have a specific set of bioterrains in the real world are known to exist in the corresponding biome. Natural wonders that are dependent on biomes will of course be assigned to the Earth biome they exist in. Items that may require additional explanation are starred.*

Soil Class Table (Replaces terrains)

Soil Class | Replaced Terrain | Description | Base Yield | Associated Soil Terrains
Micro-vegetation rich|Grass|non-forested terrains that are rich in micro-vegetation|1, 0, 0|grass*, boreal grass, monsoon, and swamp|
Organic wet-dry|Plain|soils that grow in areas with a distinct wet and dry season|1, 1, 0|plains, savannah, Mediterranean, wooded floor
Production bearing|Desert|ssoils that are rich in minerals/micro-vegetation that increase production|0, 1, 0|desert*, forest floor*, marine forest floor*, volcanic soil
Mineral rich|Tundra|soils that are rich in minerals/micro-vegetation that have monetary benefits|0, 0, 1|arid, barren*, jungle floor*,tropical highland
Glaciated|Snow|Soils that are covered with snow/glaciers year round|0, 0, 0|continental glacier, alpine glacier*


*Terrain Explanations*

  • Grass: contrary to the minds of those that created Civilization, grass is not a significant source of food for humans. However, regions that have a lot of grass do generally contain lots of wild fruit and vegetable bearing bushes. So any "grass" terrain that would normally exist will also get the "edible flora" feature to increase its food value to 2. Forests and jungle do NOT exist on "grass" plots. (See description of forest floor below)
  • Desert: The only product that a desert is really good for (and in huge quantities) is glass. That is the only reason I can conceive of why the writers of civilization would say that a desert can create a profit (hence the money yield). However, I consider glass a building material, not a source of wealth which is why I put it in the "production bearing" category rather than the mineral rich category. Arid regions can produce certain forms of rock that are a luxury item but since this system will consider "arid" a separate soil terrain, there is no need for "desert" to be in the fourth category.
  • Forest floor (of any type): "grass" does not generally exist in the forest because of a lack of sunlight. In addition, areas that have forest have typically leached soils so the growth of food is limited. This type of terrain will only exist where forest exists. I will have to come up with a way to change these values when the forest is cut down.
  • Jungle floor: Jungle soil is some of the poorest soil in the world in terms of food producing minerals. This is because the soil is constantly leeched by rains and the jungle flora itself. Removing the jungle does not get rid of the rain. Instead it makes the problem worse by removing the source of nutrients that existed (the jungle itself). However, the plants that exist in a tropical jungle region are a source of herbal remedies and highly useful plants which is why this soil terrain produces gold. Stats will need to change if the forest is cut down.
  • Barren: basically this is rocky ground that has very little soil. It is common in arid regions, especially in high altitude arid regions where the temperature change is less dramatic between seasons and night vs day.
  • Alpine glacier: This is a feature that would of course exist in high mountains only. Whether or not implementing this as a separate soil terrain is necessary or even possible will probably need to be discussed.


Proposed Additional Features. Will require 3D artists!

Please note that the yield changes are also proposed and up for debate. Also note that some of the yields do not reflect the features themselves, but rather the terrain they are associated with. This is necessary if I don't change the way the yield system works.
Soil Class | Description | Yield change
Coniferous forest*|forests containing evergreen trees|N/A
Mixed forest*|forests containing both evergreen and broad-leaf trees|N/A
Boreal forests|the snowy forests that used to exist in Civilization|N/A
Edible flora|contains berry bushes and vegetables that are associated with grass regions (may not require graphic)|1, 0, 0
Chaparral flora|flora associated with non-desert "arid" regions|0,-1, 1
Swamp vegetation|includes trees and taller swamp life visible above the water|0, 0, 1
Monsoon flora|includes grasses and plants associated with monsoon regions|1, 0, 1
Savannah flora|includes grasses and shrub/bush-like trees associated with savannah regions|1,-1, 1
Volcanic soil|(no graphic). Includes yield changes associated with volcanic soil|3, 1, 2
Long grass*|Grass associated with the midwest that is helpful with farming (think hay)|0, 1, 1
Straw grass*|Grass associated with Mediterranean and sometimes highland regions|0, 1, 0
Cacti|Flora that occasionally appear in desert|1, 0, 1
Mollisol*|A particularly rich soil type (sometimes called black soil) which occurs in plains with well balanced wet and dry seasons|2, 0, 0
Peat*|Similar to black soil but very rich in acidic organic matter. Occurs in and around marshlands|1, 0, 0


*Feature Explanations*

  • Coniferous forest: I think it is rather unfortunate that this was removed from the game. I understand that it was "necessary" to produce the different "tree" appearances for continental styles but I think they are more useful as varying forest types
  • Mixed forest: Generally appears in humid subtropical climates. These types of forests contain both coniferous and deciduous (broad-leaf) trees.
  • The grasses: The different grass types have the same appearance but have different yield values associated with the climates they belong in.
  • Mollisol: similar to the properties of a flood plain except that deserts and a river are not required for their existence.
  • Peat: this doesn't really work as a feature. It will be the only resource that this mod adds to the game in and of itself.
 
Sounds interesting, what sort of art are you after? I have a bit of experience in resource/feature art. Ive been away from Civ 5 for a while, reading this piqued my interest, so I'd be willing to help if able.
 
Sounds interesting, what sort of art are you after? I have a bit of experience in resource/feature art. Ive been away from Civ 5 for a while, reading this piqued my interest, so I'd be willing to help if able.

For the terrains, mainly just re-texturing. (Although it seems that the variations have been done with overlays. So less transparency and not splotchy, but rather a nearly complete overlay). I need different base or overlay and texture color and art for the different terrain types involved. Some decent art already exists for some of these among the "alternate" graphic mods for continental variation that I have seen. I can give more specific on exactly what is needed when I get past the ocean steps. These are actually the most difficult part of creating this engine.

For the features it will be new models as well so this is where a majority of the time will be spent. I am not sure about the coniferous (pine) trees. I am not sure if the current models for trees can be used for coniferous trees or not, but my guess is no since pine trees are not the same shape as deciduous/broadleaf trees. Boreal forest will be the pine trees model with a re-texture that adds snow on the tips. Mixed forest will mix both broadleaf and coniferous in the landscape.

Here are some ideas about the rest of the features. Keep in mind that when I say "shrub" or "bush", these need to be pretty small compared to the trees which are already small. Feel free to comment if any seem too difficult.

Edible flora. Nothing really needed. However, an occasional smattering of small bushes might add something.

Chaparral flora. Dominated by shrubbery and bushes. Mostly brownish-some green. The occasional green tree (bush like). Here is a picture that gives a good idea of what it should look like.


Swamp flora/vegetation. This should be a modification of the marsh graphic that adds trees. Dominated by slightly spaced out trees, with a smattering of reeds. Here is a picture to give you an idea of what the trees should look like.


Monsoon flora. Like edible flora we don't need a graphic for this. However, if one were made it would basically be the same as savannah only the grass would be green rather than yellow-brown and without the tall, roof-like trees(see below).

Savannah flora.
Tall yellow brown grass, and clumps of short bush like trees and an occasional tall tree (tall tree is optional). The best picture is located here. But it is too big so here is a smaller picture:


Volcanic soil.
Graphic isn't necessary, but it would probably be simple and helpful. Just a simple semi-transparent or peppery overlay that makes the soil look darker in spots. A recoloring of flood plains to dark greys should work as long as it doesn't hug the river.

Tall/Straw Grasses.
Probably only one graphic for both since they look similar. Basically savannah without the bushes or trees. (Probably easiest to create this first then add bushes for savannah)

Cacti/Desert flora. Mainly cacti, about 3/4 the size of the trees for regular tree landscapes. A smattering of brown and olive green shrubbery. Here is a good picture for the colors/look but not quite so condensed.


Mollisol. This will be similar to volcanic soil but it lighter, slightly more brown, and will require an overlay more like the terrains. So fewer "holes" in the texture and less splotchy.

Peat. This will be a resource. Basically it will look like small clumps and piles of decomposed, brown humus.

I am guessing it will be a while before I need these so no big rush.
 
I think some some water features and resources as well such as coral reef would be appropriate. Some new water resources would probably be good as well. Kelp and frozen methane.
 
Hi primem0ver.

Your project is awesome, I hope to see it completed!

I'm not a 3D Artist but I thought to put together all the existing mods replacing terrain or features that I found:

Loderunner's Terrain Textures

tarcisiocm's New Terrain Textures

Khose Galkin's The Lord of the Rings (Terrain Add)

FramedArchitect's Alpha Centauri (Map)

FramedArchitect's Faerun Art Assets

Resources (I suppose some of them could be used or reskinned as features or terrains):

Horem's Art Resources.

Barathor's More Luxuries

Skaz881's Resource reskins

If I find other mods, I'll edit this post.
I hope this list has been of helpful.

Keep up the good work!

EDIT: added Barathor's More Luxuries (like ThorHammerz suggested), Skaz881's Resource reskins and FramedArchitect's Faerun Art Assets
 
Thanks for the list guys. I will take a look at them when I get to it.
 
Important note about this project and a question for anyone who wants a say!

The evaluation of plot statistics and the size of bodies of water currently assumes that the world on which the map is based has a spherical shape. Much of what must be determined must be based on that assumption (otherwise there would be no real differences in the climates at the poles versus those at the equator).

In order to determine the location of gyres (large, circular bodies of currents), I must find the location of most water bodies so that I can calculate current direction. So while the step of determining the size of a water body seems trivial, it must be done.

While calculations of climate must assume a globe, as far as the player is concerned, the reported water body size (which determines whether a body is a bay, a gulf, a sea, or an ocean) technically does not have to be based on a "sherical" map and could be based on a "cylindrical" map. Indeed, it may throw some people off to report a "medium sized" body of water in the north a bay or sea while the same sized body at the equator is considered an ocean. The reason for this is that plots in the north are technically smaller than ones at the equator on a spherical map.

So the question for everyone is this... how would you like the water body size reported to the player (which would be used in naming/labeling)? Based on a cylindrical map, based on a spherical map, or give the player the choice when the map is created?
 
About naming/labeling, I'd say, if possible, let the player choose or, in alternative, Spherical (I always try to put more realism in Civilization).

The reason is that both systems have their justifications.

Spherical: Realism. It's reasonable to expect that who'll use this map (including myself) care about realism and that he/she doesn't want, for example, to see the North Sea turned into the North Ocean.
After all, it's only matter of naming, nothing changes in strategy or gameplay.

Cylindrical: although for all the various calculations the map is spherical, from the player perspective every hex give the same amount of resources and consume the same movement point, so two water bodies with the same number of hexes have the same strategical importance to the player (without considering geopolitical position, of course).
Maybe someone will consider odd to see the two water bodies, maybe near each other, called one "sea" an the other "ocean".

Both are valid points of view, in my opinion, so, more choice, the better.
 
Top Bottom