1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

End of Winter mechanics

Discussion in 'Civ4 - Fall from Heaven' started by TravellingHat, Dec 21, 2007.

  1. TravellingHat

    TravellingHat Chieftain

    Joined:
    Jan 4, 2007
    Messages:
    252
    Location:
    UK
    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?
     
  2. Kael

    Kael Chieftain

    Joined:
    May 6, 2002
    Messages:
    17,400
    Location:
    Ohio
    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):

    Code:
    if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_THAW):
    	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.
     
  3. Nikis-Knight

    Nikis-Knight Chieftain

    Joined:
    Dec 22, 2005
    Messages:
    5,633
    Location:
    Orange County, CA
    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. ;)
     
  4. TravellingHat

    TravellingHat Chieftain

    Joined:
    Jan 4, 2007
    Messages:
    252
    Location:
    UK
    Ah right - thanks for the quick response guys. So the frozen sea is out then. Oh well, it was a nice idea.
     
  5. Arqane

    Arqane Chieftain

    Joined:
    Aug 3, 2007
    Messages:
    71
    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.
     
  6. Lasgalen Lothir

    Lasgalen Lothir Chieftain

    Joined:
    Mar 15, 2007
    Messages:
    5
    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).
     
  7. Nikis-Knight

    Nikis-Knight Chieftain

    Joined:
    Dec 22, 2005
    Messages:
    5,633
    Location:
    Orange County, CA
    It takes long to load, but plays about the same after that. Load it up and read a book for a short while. :)
     
  8. Kael

    Kael Chieftain

    Joined:
    May 6, 2002
    Messages:
    17,400
    Location:
    Ohio
    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.
     
  9. westamastaflash

    westamastaflash Lord Commander

    Joined:
    Nov 1, 2007
    Messages:
    911
    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...
     
  10. vorshlumpf

    vorshlumpf Chieftain

    Joined:
    Dec 5, 2003
    Messages:
    1,096
    Location:
    Victoria, BC, Canada
    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.
     
  11. mdfairch

    mdfairch Chieftain

    Joined:
    Jan 5, 2007
    Messages:
    42
    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.
     

Share This Page