View Full Version : End of Winter mechanics


TravellingHat
Dec 21, 2007, 07:10 AM
A question for the mod team:

If End of Winter is on, will it gradually upgrade any tundra/snow according to its latitude (so extreme northerly/southerly climes will never naturally warm up)? If I have snowy regions on the equator, for example, will they over time become tundra, then plains? Also, does it have any effect on floating ice?

I ask because I'm think of designing a very wintery map which I'd like to gradually warm up, and (if floating ice is affected) quite like the idea of frozen seas that will, in time, thaw out, opening up previously isolated lands.

Edit: also, what determines whether upgraded tiles become plains or grasslands?

Kael
Dec 21, 2007, 07:37 AM
The "Thaw" mechanic is a process that runs as soon as the game starts. Its all right here (from the onGameStart python function in CvEventManager.py):


if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_T HAW):
iDesert = gc.getInfoTypeForString('TERRAIN_DESERT')
iGrass = gc.getInfoTypeForString('TERRAIN_GRASS')
iPlains = gc.getInfoTypeForString('TERRAIN_PLAINS')
iSnow = gc.getInfoTypeForString('TERRAIN_SNOW')
iTundra = gc.getInfoTypeForString('TERRAIN_TUNDRA')
for i in range (CyMap().numPlots()):
pPlot = CyMap().plotByIndex(i)
if pPlot.getFeatureType() == -1:
if pPlot.getImprovementType() == -1:
if pPlot.isWater() == False:
iTerrain = pPlot.getTerrainType()
if iTerrain == iTundra:
pPlot.setTempTerrainType(iSnow, CyGame().getSorenRandNum(90, "Bob") + 10)
if iTerrain == iGrass:
pPlot.setTempTerrainType(iTundra, CyGame().getSorenRandNum(90, "Bob") + 10)
if iTerrain == iPlains:
pPlot.setTempTerrainType(iTundra, CyGame().getSorenRandNum(90, "Bob") + 10)
if iTerrain == iDesert:
pPlot.setTempTerrainType(iPlains, CyGame().getSorenRandNum(90, "Bob") + 10)


The new SDK function I needed for this to work is setTempTerrainType. It accepts 2 arguements, the new terrain type you want to switch to, and the amount of turns you want it to remain that terrain type.

As you can see from the code, tundra becomes snow, grasslands becomes tundra, plains becomes tundra, desert becomes plains. It doesnt do anything with water plots or plots with features on them (which is why you may notice that forests and jungles are still on grasslands or plains).

For your purpose you need to build your map in its final (warm) state and then let the thaw mechanic freeze it for you.

Nikis-Knight
Dec 21, 2007, 07:37 AM
No, it's simpler than what you thought.
For one thing, floating ice is unaffected, so that's out, sorry.
How it works is that is generates a map as normal, then converts each featureless tile one step towards snow, along with giving it a random number between 10 & 100. The number is the turn in which it returns to normal.

So the option works with premade maps without adding any snow or tundra--in fact if you do it will end up like that again. And what determines the final step is whatever the map generator chose them to be to begin with.

However, since tiles with features are unaffected, I think, starting in areas with several flood plains is a bit unbalancing.

edit: Hi, Kael. ;)

TravellingHat
Dec 21, 2007, 07:51 AM
Ah right - thanks for the quick response guys. So the frozen sea is out then. Oh well, it was a nice idea.

Arqane
Dec 21, 2007, 02:22 PM
Wouldn't it be fairly simple to add the code so that Ocean/Shore becomes Ice? Same deal, just copy/paste with whatever the string for Ocean and Ice is.

Lasgalen Lothir
Dec 21, 2007, 04:29 PM
I tried using the End of Winter option on your scenario, Nikis-Knight, but it seemed to either break it or cause it to load extremely slowly (like 10-15 minutes before I canceled it out).

Nikis-Knight
Dec 21, 2007, 05:09 PM
It takes long to load, but plays about the same after that. Load it up and read a book for a short while. :)

Kael
Dec 21, 2007, 08:05 PM
Wouldn't it be fairly simple to add the code so that Ocean/Shore becomes Ice? Same deal, just copy/paste with whatever the string for Ocean and Ice is.

Its not a technical challenge, just processor cost. Ice isn't a terrain, its a feature. So I couldn't use the existing mechanic, I would need to add a new counter and ability to add temporary features. Since Ice would be the only place we would use that counter it doesnt seem worth it. We have a few ideas for the tempterrain mechanic.

Besides there wouldn't be much game play value in adding the new mechanic since most people aren't out sailing in the first 100 turns anyway. It would be entirely cosmetic, so not really worth the processor.

westamastaflash
Dec 21, 2007, 08:08 PM
Since Ice would be the only place we would use that counter it doesnt seem worth it. We have a few ideas for the tempterrain mechanic.

But what about floodplains? It's a bit unbalancing if someone starts with 3 or 4 floodplains since they don't seem to change with end of winter...

vorshlumpf
Dec 21, 2007, 11:10 PM
I'd like to see ice on land, too. Frozen forests would be neat.

As mentioned, there is a bit of an imbalance right now since some tiles are affected and others aren't.

mdfairch
Dec 23, 2007, 02:33 AM
Its not a technical challenge, just processor cost. Ice isn't a terrain, its a feature. So I couldn't use the existing mechanic, I would need to add a new counter and ability to add temporary features. Since Ice would be the only place we would use that counter it doesnt seem worth it. We have a few ideas for the tempterrain mechanic.
How does it work in the age of ice scenario? I suppose the body of water being affected there is very small, so it's a rather different case.