View Full Version : What does iTerrainGrainChange do (in Civ4WorldInfo.xml)


jpinard
Aug 05, 2007, 01:05 AM
What do the foolowing entries do in the Civ4WorldInfo.xml?

* iTerrainGrainChange
* iFeatureGrainChange

Thanks :)

Sto
Aug 05, 2007, 03:34 AM
I'm not on my pc so i can't give the peace of code ... But both of them are used with featureGenerator and TerrrainGenetor in CvMapGenerator.py . This is two values used for fractals to make the terrain realistic . Make one or two tests with them : More the value is high -> more the peaces of terrain of the same type or the groupement of forest for an example is little . I think you want to set them for a big sizes of map . So , just test some values to check the size of desert and forest , you will see how these values are involved . You can also take a look in my scripts (http://forums.civfanatics.com/showthread.php?t=151629) at generateTerrain() and genrerateFeature() with the scripts i've added some big size of maps ( continents for an example) . I calculate the grain in function of the size ( but some tests by yourself should be easier ) .

Tcho !

jpinard
Aug 05, 2007, 01:14 PM
So it affects the clumping of terrain features?

Does this mean sections of forests will be larger? And clumped areas of deserts will be larger?

Sto
Aug 05, 2007, 02:03 PM
So it affects the clumping of terrain features?

Does this mean sections of forests will be larger? And clumped areas of deserts will be larger?

an example : you set 40% of forest -> 40 % of the plots where you can have forest (except equator ) will have forest . The grain change the size of the forest . i don't remember the initial value or iFeatureGrain , let's say 3 . On a tiny map you will have some little forest of maximum 5*5 tiles of forest . But if you left 3 for a huge map you will have some huge forest without seperation of 50*50 , and bigger the size is , bigger the size of the forest will be . That's why there are these grainChange . this is made to unconcentrate the values of fractals (mathematical objets) .

So higher the grainChange is , smaller the section of forest or desert will be (but this does not affect the percentage of forest or desert you will have ) .

To test that , just launch a huge map (lakes is a good example to test that) , one time with FeatureGrainChange to 0 and one time with 10 . You will see the difference for the forest quickly .

Tcho !

PS : sorry , this is difficult for me to give clear explainations in english .

jpinard
Aug 05, 2007, 10:48 PM
Sto - for having English as a second language you're doing terrific. I appreciate your effort :)

I thought a higher grain # would increase the clumped area. For example, on a Gigantic map a grain of 1 gave a 50 tile forest. A grain of two would give a 75 tiel forest.

But if I'm understanding your thread correctly it's the opposite. Smaller grain ona larger map equals a greater dimensions of said terrain-type?

Willem
Aug 06, 2007, 03:03 AM
I was experimenting with those numbers earlier tonight, on a Huge map setting. When I reduced them from 1 to 0, I noticed that I was getting larger areas of each terrain type. However I didn't really see any difference when I increased it to 2. However I didn't examine the map in great detail so the effect may have been more subtle than I noticed at the time.

Sto
Aug 06, 2007, 03:57 AM
But if I'm understanding your thread correctly it's the opposite. Smaller grain ona larger map equals a greater dimensions of said terrain-type?

Yes that's it !

I was experimenting with those numbers earlier tonight, on a Huge map setting. When I reduced them from 1 to 0, I noticed that I was getting larger areas of each terrain type. However I didn't really see any difference when I increased it to 2. However I didn't examine the map in great detail so the effect may have been more subtle than I noticed at the time.

Don't forget that what you change is not iTerrainGrain (i think 3 buy default) but iTerrainGrainChange that is added to iTerrainGrain . The fractal for terrain and for feature is used the same way . To Make a test , just change iFeatureGrainChange and look at the forest ... you will have a better result .

Tcho !