Help with Natural Wonders (Terrain Features file)

Halcyan2

Emperor
Joined
May 12, 2012
Messages
1,380
Hi there. I have been exploring the Features file (in the Terrain subdirectory) and had some questions about Natural Wonders:


#1. What is the best way to select Natural Wonders for a custom map?

Obviously you can use a Map Editor to customize things. But if you want a randomly generated map and want to minimize spoilers (such as manually changing/adding/removing natural wonders), what is the best technique?

My best guess right now is to modify <OccurrenceFrequency> so that the Natural Wonders you want have a really high value (e.g. 1000) while the ones you don't want have a low value (e.g. 1 or 0). Anyone have luck with this method?


#2. How can I make Natural Wonders farther away from City States?

Would I want to change the order of map generation so city states are placed before natural wonders?

I've also read that the code uses a ripple value, such that Natural Wonders and city states are at least 5 plots (ripple value 4) from major civ starting placement. Whereas natural wonders have a ripple value of just 1 to city states. If this is the case, where can I change the ripple value of natural wonders for city states (I want to make it 4, just like with normal civs)?


#3. What is <SeeThrough>?

My best guess is that it is what makes a natural wonder obstruct vision. I would guess that a tile with just hills or just a forest/jungle would have a value of 1 (blocks vision if on flat terrain, but you can see past it if on a hill), while a hill with forest/jungle would have a value of 2 which blocks vision even on a hill. So I think the Natural Wonders would then be equivalent to hill with forest/jungle in terms of visibility blocking.

I am a little uncertain though because there have been many reports that Lake Victoria blocks vision, even though it lacks the SeeThrough value that most Natural Wonders have. Same with the GBR.

My second guess is that it helps natural wonders (like mountains) be seen far away. If this is not the case, any idea where in the code this is?


#4. What is <InfluenceCost>?

I would guess that it is used to determine city tile expansion. Good tiles (like Oases and Flood Plains) have a -1 value. However, I find that many Natural Wonders are expanded to last, even though they should have a -3 value.


#5. How does <AddsFreshWater> work?

Lake Victoria has this but apparently (correct me if I'm wrong) is simply allows the city to build fresh water buildings (like Gardens) and does *not* allow for the irrigation of adjacent tiles (lots of reports that you can't irrigate next to Lake Victoria).

Anyone know how to change it so that it allows irrigation?

Many Natural Wonders use code to change the underlying terrain to mountain <ChangeTiletoMountain>. Would a similar, <ChangeTiletoLake> tag work as well (for Lake Victoria and possibly Old Faithful and Fountain of Youth)?


#6. Krakatoa / GBR placement

One thing I hate about Krakatoa is how it is often placed in the middle of the ocean with no land tiles within reach. What is the best way to change this?

In the past, I recall reading about how the Great Barrier Reef has code such that there must be land within 3 tiles away. However, I can't seem to find the code that does this (in the Features file, it simply has 2 short lines). Do you know where it is?

Alternatively, maybe I could try upping the required number of shallow water tiles.


#7. Number of Natural Wonders

I know that you can change the # of natural wonders for each map size, but I've also read that there is still a max number. Any idea what it is?


Thanks for your help!
 
Spoiler quote :
Hi there. I have been exploring the Features file (in the Terrain subdirectory) and had some questions about Natural Wonders:


#1. What is the best way to select Natural Wonders for a custom map?

Obviously you can use a Map Editor to customize things. But if you want a randomly generated map and want to minimize spoilers (such as manually changing/adding/removing natural wonders), what is the best technique?

My best guess right now is to modify <OccurrenceFrequency> so that the Natural Wonders you want have a really high value (e.g. 1000) while the ones you don't want have a low value (e.g. 1 or 0). Anyone have luck with this method?


#2. How can I make Natural Wonders farther away from City States?

Would I want to change the order of map generation so city states are placed before natural wonders?

I've also read that the code uses a ripple value, such that Natural Wonders and city states are at least 5 plots (ripple value 4) from major civ starting placement. Whereas natural wonders have a ripple value of just 1 to city states. If this is the case, where can I change the ripple value of natural wonders for city states (I want to make it 4, just like with normal civs)?


#3. What is <SeeThrough>?

My best guess is that it is what makes a natural wonder obstruct vision. I would guess that a tile with just hills or just a forest/jungle would have a value of 1 (blocks vision if on flat terrain, but you can see past it if on a hill), while a hill with forest/jungle would have a value of 2 which blocks vision even on a hill. So I think the Natural Wonders would then be equivalent to hill with forest/jungle in terms of visibility blocking.

I am a little uncertain though because there have been many reports that Lake Victoria blocks vision, even though it lacks the SeeThrough value that most Natural Wonders have. Same with the GBR.

My second guess is that it helps natural wonders (like mountains) be seen far away. If this is not the case, any idea where in the code this is?


#4. What is <InfluenceCost>?

I would guess that it is used to determine city tile expansion. Good tiles (like Oases and Flood Plains) have a -1 value. However, I find that many Natural Wonders are expanded to last, even though they should have a -3 value.


#5. How does <AddsFreshWater> work?

Lake Victoria has this but apparently (correct me if I'm wrong) is simply allows the city to build fresh water buildings (like Gardens) and does *not* allow for the irrigation of adjacent tiles (lots of reports that you can't irrigate next to Lake Victoria).

Anyone know how to change it so that it allows irrigation?

Many Natural Wonders use code to change the underlying terrain to mountain <ChangeTiletoMountain>. Would a similar, <ChangeTiletoLake> tag work as well (for Lake Victoria and possibly Old Faithful and Fountain of Youth)?


#6. Krakatoa / GBR placement

One thing I hate about Krakatoa is how it is often placed in the middle of the ocean with no land tiles within reach. What is the best way to change this?

In the past, I recall reading about how the Great Barrier Reef has code such that there must be land within 3 tiles away. However, I can't seem to find the code that does this (in the Features file, it simply has 2 short lines). Do you know where it is?

Alternatively, maybe I could try upping the required number of shallow water tiles.


#7. Number of Natural Wonders

I know that you can change the # of natural wonders for each map size, but I've also read that there is still a max number. Any idea what it is?


Thanks for your help!

1) I'm a little uncertain of what you mean. But, yes, alongside the conditions present on the map, you can control the chance of a NW appearing by adjusting OccurrenceFrequency. A value of 0 will prevent it from being placed.

2) In AttemptToPlaceNaturalWonder. Line 6016

Code:
self:PlaceResourceImpact(x, y, 5, 1)					-- City State layer

Change the last "1" to a "4" to get the effect you described. (Note: if you dramatically increase the number of natural wonders on a map, you may start to block-out city-states from being placed.)

3) That's sorta how it works. I haven't really looked too much into this, though. I believe SeeThrough controls how you can see the object relative to the surrounding SeeThrough values. If there are higher SeeThrough values between you and the object, it's blocked from vision; if they're equal, you have normal vision; if they're lower, you can see the object from further away (like mountains). SeeFrom probably applies a modifier to all those calculations depending on the type of tile your unit is on.

Also, there's a mod for Lake Victoria by Calypso, if you want to check it out:
http://steamcommunity.com/sharedfiles/filedetails/?id=160194319

4) Correct. Though (I'm not going to get too much into it here), even with a base of -3, other things are factored into deciding where to expand to, such as distance from the city. You can tinker with lowering the base cost further or by lowering PLOT_INFLUENCE_NW_COST in GlobalDefines.xml.

5) Not sure about that one. I assumed AddsFreshWater allows farms to be built, along with the special buildings if the city is adjacent to the tile. Lake Victoria already has this set to "true". I haven't tested this myself, but are you sure it's still not working? Perhaps it was included in the hotfix some time after the mod was released and when people were reporting the issue.

6) Perhaps you'll like this lil' mod I created:
http://steamcommunity.com/sharedfiles/filedetails/?id=173704558

Within the file, just search for the word "MOD" (case-sensitive) and it'll jump to each of my modifications if you want to see what's going on in there. I label everything so users can find the changes easier and to make the devs job easier if they decide to check it out and implement some form of it into the game.

7) I'm not aware of a max number, I guess it would be the max number that exists. :D But, in terms of functionality, as you increase the number of NW's squeezed onto a map, you'll quickly decrease the available plots for more of them and they'll start blocking each other out. They have a pretty high ripple radius; when a natural wonder is placed, it blocks out other ones from being placed near it in a radius equal to the height of the map divided by 5. Increasing major civ counts also takes space away, as you said, in a 4 tile radius around the start tile.

You can find that in AttemptToPlaceNaturalWonder() within AssignStartingPlots.lua, line 6012.

Also, you can adjust the NW totals for each map size in PlaceNaturalWonders(), line 6047.
 
Back
Top Bottom