1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

3.17 Global Warming Mechanics

Discussion in 'Civ4 - General Discussions' started by Refar, Jun 24, 2008.

  1. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    I took a look at the new Global Warming code. Here's how it works (Unless of course me missing something or just beeing a moron).

    The XML tags:
    All found in GlobalDefines.XML. New ones are highlighted (At least i think those are new).
    Code:
    <Define>
    	<DefineName>GLOBAL_WARMING_TERRAIN</DefineName>
    	<DefineTextVal>TERRAIN_DESERT</DefineTextVal>
    </Define>
    <Define>
    	<DefineName>GLOBAL_WARMING_PROB</DefineName>
    	<iDefineIntVal>20</iDefineIntVal>
    </Define>
    <Define>
    	<DefineName>[B][COLOR="SeaGreen"]GLOBAL_WARMING_FOREST[/COLOR][/B]</DefineName>
    	<iDefineIntVal>50</iDefineIntVal>
    </Define>
    <Define>
    	<DefineName>[B][COLOR="SeaGreen"]GLOBAL_WARMING_UNHEALTH_WEIGHT[/COLOR][/B]</DefineName>
    	<iDefineIntVal>20</iDefineIntVal>
    </Define>
    <Define>
    	<DefineName>[B][COLOR="SeaGreen"]GLOBAL_WARMING_NUKE_WEIGHT[/COLOR][/B]</DefineName>
    	<iDefineIntVal>50</iDefineIntVal>
    </Define>
    Other variables involved:
    #LAND - The number of land Plots on the map.
    #PLOTS - The number of plots in the map (Width x Height)
    #FOREST - The number of forest/jungle tiles on the map.
    Actually features with (getGrowthProbability() > 0) are counted. For default
    game those are Jungle and Forest. Might be different in mods.
    #BADLAND - Land plots not giving any yield (Desert, Frozen land).
    #BAD_HEALTH - The global :yuck: caused by buildings. The :yuck: from overpopulation, features or other possible sources does not count.
    ??? I do not know yet, if the 2:yuck: from power does count here or not. I assume it does. ???
    #NUKES_EXPLODED - The number of Nukes ever exploded. This count for any kind of nuclear explosion - ICBM, Tactical Nuke and Plant Meltdown.

    Derived Variables:
    The code on Global Warming is within CvCity.cpp; doGlobalWarming();

    GW_DEFENSE = #FOREST / #LAND * GLOBAL_WARMING_FOREST
    GW_VALUE = #BAD_HEALTH * GLOBAL_WARMING_UNHEALTH_WEIGHT / #_PLOTS + #NUKES_EXPLODED * GLOBAL_WARMING_NUKE_WEIGHT / 100

    Global Warming Probability:
    On every turn there will be GW_VALUE indipendant random tests, each with a
    probability to cause Global Warming:

    PROB1 = ( GLOBAL_WARMING_PROB - GW_DEFENSE ) / 100

    This results in a chance of no GW at a given turn:
    PROBtotal_no_GW = (1 - PROB1)GW_VALUE

    And hence the chance of at least one GW event on any given turn:
    PROBGW_strikes = 1 - (1 - PROB1)GW_VALUE

    With the standard XML values:
    GW_DEFENSE = #_FOREST / #_LAND * 50
    GW_VALUE = - #_BUILDING_BAD_HEALTH / #_PLOTS * 20 + #_NUCLEAR_EXPLOSIONS * 1/2

    PROBGW_strikes = 1 - (0.8 + #FOREST/#LAND * 0.5)GW_VALUE

    Effect of Global Warming
    If Global Warming strikes a random land PLOT, which is not a city will be choosen.

    There is no regional, player, team or other bias in choosing the target plot for Global Warming. It does not matter who, where or why caused the nuclear explosions, built the polluting buildings, chopped or preserved the forests.

    If PLOT has a feature (Forest, Jungle, FloodPlain, Oasis), this feature will be removed, but the terrain type does not change. (Unless the feature is Fallout, in which case nothing happens at all)

    If PLOT has no Feature and can give any yield (i.e. is not desert or fozen), then it will be turned into GLOBAL_WARMING_TERRAIN, which is - per standard XML - desert.

    Note on probability: This de facto reduces the Probability of Global Warming with increasing amount of useless land plots on the map. Since if a plot is choosen to be victim of Global Warming, that can not be worked anyway, nothing happens. So actually
    PROBGW_strikes = 1 - (1 - PROB1 + PROB1*#BADLAND/#LAND)GW_VALUE
    Depending on how high PROB1 actually is and how much "bad land" we have it might result in 5 ~ 10 % (Or even more in really extreme cases) less visible GW.

    Same thing with fallout. Should be negligible in most games, but could become interesting in a huge Nuclear War, where the Fallout will actually help preserve the terrain under it. Tho of course, as soon as you clear the Fallout after the war, the plots will become affected by Global Warming again.

    Notes:
    Nukes now count only half. This means that a single explosion (say a meltdown) will not cause GW by itself. However this is only true if there are no other sources of GW.

    The :yuck: from buildings is weighted by map size (Number of plots). To give a idea of its impact let assume a Standard Size map

    1 :yuck: * 20 / 4368 = ~0.005
    So ~110 :yuck: from buildings would have the same effect as one Nuke, giving us a half of a GW_VALUE point.
    Also since there is integer divison involved and assuming no nukes, the first ~220 :yuck: are free (as long as #BAD_HEALTH * GLOBAL_WARMING_UNHEALTH_WEIGHT / #_PLOTS < 1).
    One city with all possible pollution sorces and no Recycling Center can "provide" 17 :yuck: (i might be mistaken by +/- one or two here).

    Green World
    To completely avoid Global Warming we would need
    A) Never get GW_VALUE >= 1. As mentioned above this could still allow one nuke explosion and/or some very minor building :yuck: or
    B) Have enought forests to make PROB1 drop to 0. At standard XML values this would require 40% of the landmass to be covered with Forest or Jungle.

    Modding
    Setting GLOBAL_WARMING_PROB = 0 will still remove all GW (Tho the method examining all plots and cities will still run... Would be a bit faster, to put a check there and skip the rest if == 0).

    GLOBAL_WARMING_FOREST is a positive modifier - increasing the value will make less Forests/Jungles needed to avoid GW. Say a GLOBAL_WARMING_FOREST = 100 would make only 20% of forested Landmass needed to count as a green planet.

    Also note again - while talking FOREST we actually mean all Features that can grow.

    GLOBAL_WARMING_UNHEALTH_WEIGHT and GLOBAL_WARMING_NUKE_WEIGHT are negative modifiers - reducing those will result in less Global Warming events.
     
  2. r_rolo1

    r_rolo1 King of myself

    Joined:
    May 19, 2006
    Messages:
    13,818
    Location:
    Lisbon, Portugal
    I really can't say if I like less of this version or of the previous one.... with lumberjack and nuke plant AI instincts, I'm not sure this is for the best.....

    But atleast is a more refined mechanism.
     
  3. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    I kind of like the idea of taking air pollution :)yuck:) and (de)forestation into account. And like you said - it is a more refined mechanism with somewhat mod-/use-able tweaking variables...

    But i just finished a game, and i really did not like the effect.

    Even with nukes baned (and no meltdowns i know of) there was no way to prevent GW. You can't influence AI city building, Ecology and recycling centers seem not to be too high on AI priority as well...
    And with the AI chopping everything they get they hands on, keeping enought worldwide forest coverage for a significant amount of GW_DEFENSE is utterly impossible (Let alone hitting the green threshold...).

    I think it needs a different valuation/policy for AI terrain Improvements.

    And the effect is still completely irreversible of course... Be it feature removal (even with Forest Preserves the Regrowth is laughably slow) or straight desertification...
     
  4. r_rolo1

    r_rolo1 King of myself

    Joined:
    May 19, 2006
    Messages:
    13,818
    Location:
    Lisbon, Portugal
    The problem is the normal one with new features: the AI does not know how to deal with it.....

    I already stated once that IMHO GW should be tile sensitive: ice to tundra or sea, tundra to plains, plains to either desert of Grassland ( depending on nearby water ) and Grassland gone to desert if no water nearby......

    With forests being the ultimate GW stopper, I still am trying to understand why we can't plant forests ... or atleast make the preserve forest spawn bigger ( I agree that the current effect is negligible ). ... Or Firaxis wants that all games to end in a barren wasteland? Lot of love for MadMax it seems.....

    And BTW why no global cooling?
     
  5. Woody1

    Woody1 Prince

    Joined:
    Feb 19, 2002
    Messages:
    468
    Location:
    Texas
    Even with the new changes, I'm still setting GLOBAL_WARMING_PROB to 0. I don't think global warming adds anything to gameplay. It's just some environmental bent that Firaxis wants to shove in their games. Maybe they're funded by Al Gore. ;-)
     
  6. r_rolo1

    r_rolo1 King of myself

    Joined:
    May 19, 2006
    Messages:
    13,818
    Location:
    Lisbon, Portugal
    ^^Doubt it... We can't plant forests :p
     
  7. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    The idea to refine the global warming mechanism is fine, but some of the basic assumptions aren't working well in this game.

    In a game where the player is trying to build a great civilisation, he or she will not like a game element that will utterly and irreversibly destroy said civilisation. This destruction is slow and many players might not notice a lot of it as they finish the game before global warming has a large effect. But that doesn't mean that it adds to the game.

    The mechanism could truly add to the game if the effect on tiles was reversible for a high cost and the methods to prevent global warming would be more successful.

    So:

    1) Harmful effects on a tile can be reversed for a high cost (global warming creates a special tile modification).
    2) Methods of prevention of global warming are more effective
    3) Effects that strengthen global warming slowly decrease over time: 3 nukes that were launched 150 years ago should barely effect global warming now.

    edit: Thanks for the mechanics, Refar.
     
  8. Woody1

    Woody1 Prince

    Joined:
    Feb 19, 2002
    Messages:
    468
    Location:
    Texas
    Yes, I wouldn't mind so much if the effects were something you could deal with, similar to cleaning up radiation. The AI would also have to be able to deal with it, too.

    Still, even if you could reverse the effects, I'm not sure what it adds to gameplay. Seems like it just adds to micro-management.

    For gameplay to be enhanced, there would have to be a strategic reason for it. Perhaps a +1 happiness and +1 health boost for the "least polluting civ", and a -1 happiness and -1 health for the "most polluting civ". (Or maybe for all civs above average or below average.) Certain civics could magnify the boost or penalty (e.g. environmentalism), or negate it (e.g. statehood).
     
  9. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    I was kind of surpised, seeing enviromentalism not having a effect at all too.
     
  10. Duuk

    Duuk Doom-Sayer Supporter

    Joined:
    Dec 16, 2005
    Messages:
    1,902
    Gender:
    Male
    Location:
    Detroit, Michigan, USA
    If the GW effect was to turn a tile into fallout (or other 'eco-disaster'), I'd be fine with it.
     
  11. r_rolo1

    r_rolo1 King of myself

    Joined:
    May 19, 2006
    Messages:
    13,818
    Location:
    Lisbon, Portugal
    Fallout is a feature, not a terrain type, unfortunately... otherwise we could simply replace desert per fallout :(

    But the new mechanism for GW might allow that change (if it removes features, maybe it could add it? :dunno: )
     
  12. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    You're right. Even with my suggested changes, it wouldn't really add to gameplay. I would suggest that the damage to terrain is really costly to repair but also doesn't occur very often just to avoid CIV3 Whac-A-Mole type anti-pollution gameplay. The cost could be something like a worker + big sum of gold. The gameplay enhancement would be in trying to prevent global warming. That could be interesting if some effective methods were offered by the game.

    Your happiness and health suggestions for being the most/least polluting civilisation sound great. That would make global warming into a global competition which would be a game enhancement. You'd get the choice between the happiness/health benefits for being the 'least polluting civ' combined with the cost of building expensive recycling centres or happiness/health costs for being the 'most polluting civ' combined with no cost of building expensive recycling centres. Since civilisation is a game of interesting choices, this would add another interesting choice.
     
  13. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    I think reaching the "green threshold" could be "strategic reason" enought - it would give a really compeling reason to keep some forest around (other than National Park).

    However with the current numbers and more important with the Chop-crazy AI it's just impossible...

    Perhaps if we could convince Solver to tweak the AI to leave some more forests intact :mischief:

    Not from XML onl. Would need recoding.
     
  14. qwertz

    qwertz Prince

    Joined:
    Sep 25, 2007
    Messages:
    469
    Location:
    Switzerland
    thx for explaining the new mechanism. the concept sounds better than the old nukes=GW idea, but I think it still needs quite some work to make it really fit in the game.:(


    BTW, does this mean the forges can cause BC-GW? getting 220 forges on a standard map would be a bit difficult, but theoretically possible :lol:
     
  15. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    Yes, in theory they could. But you would need a whole lot of Forges for that :lol: Also early in the game there are more Forest/Jungles to counterweight the effect.
     
  16. mungbean

    mungbean Chieftain

    Joined:
    Apr 10, 2007
    Messages:
    30
    Variety of suggestions based on real-world effects that would probably also be good for gameplay:

    It seems like your pollution should start affecting your diplomatic status. For example, if one empire is full of polluting crap that is almost single-handedly causing GW, eventually everyone else should hate them for screwing up (or having screwed up) the planet. This could be a relative thing (i.e. if everyone is doing it, the penalty might be lower; if you are not near a GW threshold, and there are markedly differing civs, penalty might be higher). It might be harder for the AI to consider this effect in their city planning (that might be reasonable considering that this didn't happen in real life either).

    I think environmentalism should help and some health buildings should help (help: public transport, recycling center; do not help: aqueduct, hospital).

    The damage should also be self-correcting albeit very slowly (similar to war weariness but always on).

    If GW is bad enough there could be some other bad consequence (either "crack like an egg", or some penalty that is hard to get around - roughly speaking everyone dies).

    Fusion could enable construction of nukes with no possibility of GW. This is probably not very interesting unless playing a NextWar type variant.

    The above seem like good gameplay (might make culture victories interesting if while you are doing it you have to contend with the world possibly burning up; a modicum of realism; makes wars more likely near the end of the game when no one has religious differences anymore.
     
  17. Gath

    Gath Warlord

    Joined:
    Feb 26, 2008
    Messages:
    221
    I think they should also do a calc that determines how polluting each civilization is and use that as a modifier to determine the location of the global warming.

    So if Russia is 40% of the pollution and Spain is 20% of worldwide pollution then Russia gets a 40% chance of the GW happening in their territory, and Spain 20%. Right now it just feels like a negative event you have no control over.
     
  18. r_rolo1

    r_rolo1 King of myself

    Joined:
    May 19, 2006
    Messages:
    13,818
    Location:
    Lisbon, Portugal
    ^^I think that is the idea.....
     
  19. mungbean

    mungbean Chieftain

    Joined:
    Apr 10, 2007
    Messages:
    30
    Wouldn't that make it local warming?
     
  20. qwertz

    qwertz Prince

    Joined:
    Sep 25, 2007
    Messages:
    469
    Location:
    Switzerland
    Than it wouldn't be GLOBAL warming.


    edit: too late :(
     

Share This Page