[BTS] Global Warming has stopped happening after it "strikes" on a mountain tile.

arcvoodal

Chieftain
Joined
Jan 14, 2009
Messages
46
The very first time global warming struck it pointed to a mountain tile. No global warming has taken place since (about 150 turns now I think). Many nukes have been launched since (and as far as I know once global warming starts it cannot be stopped no matter how much global health is reduced etc).

I do not know where to check some kind of log that would show me the error if the game is failing to run some script or code.

I am running the neoteric world mod, however this mod does not touch global warming as far as I know, especially where global warming strikes (I assume it striking a mountain caused the code to break). I personally changed a value in the xml but shouldn't be stopping it or causing it to strike a mountain.

I believe it is vanilla game behavior causing this bug

xml looks like this:

XML:
<!-- GW Mod Variables -->
    <Define>
        <DefineName>FROZEN_TERRAIN</DefineName>
        <DefineTextVal>TERRAIN_SNOW</DefineTextVal>
    </Define>
    <Define>
        <DefineName>COLD_TERRAIN</DefineName>
        <DefineTextVal>TERRAIN_TUNDRA</DefineTextVal>
    </Define>
    <Define>
        <DefineName>TEMPERATE_TERRAIN</DefineName>
        <DefineTextVal>TERRAIN_GRASS</DefineTextVal>
    </Define>
    <Define>
        <DefineName>DRY_TERRAIN</DefineName>
        <DefineTextVal>TERRAIN_PLAINS</DefineTextVal>
    </Define>
    <Define>
        <DefineName>BARREN_TERRAIN</DefineName>
        <DefineTextVal>TERRAIN_DESERT</DefineTextVal>
    </Define>
    <Define>
        <DefineName>COLD_FEATURE</DefineName>
        <DefineTextVal>FEATURE_ICE</DefineTextVal>
    </Define>
    <Define>
        <DefineName>TEMPERATE_FEATURE</DefineName>
        <DefineTextVal>FEATURE_FOREST</DefineTextVal>
    </Define>
    <Define>
        <DefineName>WARM_FEATURE</DefineName>
        <DefineTextVal>FEATURE_JUNGLE</DefineTextVal>
    </Define>
    <Define>
        <DefineName>POWER_HEALTH_CHANGE</DefineName>
        <iDefineIntVal>-2</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>DIRTY_POWER_HEALTH_CHANGE</DefineName>
        <iDefineIntVal>-2</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>GLOBAL_WARMING_PROB</DefineName>
        <iDefineIntVal>100</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>NUCLEAR_WINTER_PROB</DefineName>
        <iDefineIntVal>20</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>GLOBAL_WARMING_FOREST</DefineName>
        <iDefineIntVal>25</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>TREEHUGGER_DEFENSE_BONUS</DefineName>
        <iDefineIntVal>2</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>GLOBAL_WARMING_UNHEALTH_WEIGHT</DefineName>
        <iDefineIntVal>10</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>GLOBAL_WARMING_BONUS_WEIGHT</DefineName>
        <iDefineIntVal>5</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>GLOBAL_WARMING_POWER_WEIGHT</DefineName>
        <iDefineIntVal>5</iDefineIntVal>
    </Define>
    <Define>
        <DefineName>GLOBAL_WARMING_NUKE_WEIGHT</DefineName>
        <iDefineIntVal>50</iDefineIntVal>
    </Define>
 

arcvoodal

Chieftain
Joined
Jan 14, 2009
Messages
46
I hate to disappoint you but the last patch this game received was in 2009. So if there is a bug with the game the only way it will be fixed is if there is a mod that does it.
Is it possible to run scripts in-game? Perhaps just rerun the script that makes global warming trigger, is such a thing possible?
 

PPQ_Purple

Purple Cube
Joined
Oct 11, 2008
Messages
5,163
Is it possible to run scripts in-game? Perhaps just rerun the script that makes global warming trigger, is such a thing possible?
You would have to create a custom mod that contains the script and than figure out a way to manually trigger it. I would not say it can't be done but am unsure exactly how. But it's a question for the modding forum.
 

f1rpo

plastics
Joined
May 22, 2014
Messages
1,502
Location
Germany
I am running the neoteric world mod, however this mod does not touch global warming as far as I know, especially where global warming strikes (I assume it striking a mountain caused the code to break).
The XML that you've posted is from the Global Warming mod component, which is apparently included in Neoteric World:
Improved Global Warming
Prolonged Nuclear exchanges now cause nuclear winter and pollution to drop from the skies. Terrain will no longer change to desert immediately. When global warming first strikes, it removes forests/jungers -> Removes ice -> Tundra to Grassland -> Grassland to plains -> Plains to Desert. Or alternatively the opposite way around in some areas, Ice freezes over etc.
Select Rising Seas on Custom Game menu for this improved global warming.
I can't find source code for the Neoteric World DLL, but it doesn't sound like BobeBrown customized the GW mod, so it probably looks something like this:
I don't see how an event at a mountain tile could prevent further events. The game only reports GW events on actively visible tiles, so it could be that events have occurred in the Fog of War. However, seeing that you've already increased GLOBAL_WARMING_PROB to 100, something does seem to be way off. :undecide:
Still, my best bet would be that the formulas just don't work well for your particular game settings or for how the game has played out. Setting an even higher GLOBAL_WARMING_PROB might do the trick (a GW defense value -effectively- gets subtracted, so going above 100 can make a difference), maybe in combination with changes to the ..._WEIGHT variables.

I see nothing in the GW mod to prevent mountain tiles from being selected – I think those tiles can, technically, have any terrain type –, so this indeed looks like a (minor) bug - but not in the original GW code, which has a check for positive tile yield.
 

arcvoodal

Chieftain
Joined
Jan 14, 2009
Messages
46
Ah okay thank you. I don't use the "rising seas" option. I will just have to keep an eye on it and see if it does it for my next game too.
 

f1rpo

plastics
Joined
May 22, 2014
Messages
1,502
Location
Germany
Normally, Rising Seas only enables the submersion of coastal desert tiles:
Code:
if (pPlot->getTerrainType() == eBarrenTerrain)
{
    if (isOption(GAMEOPTION_RISING_SEAS))
    {
        if (pPlot->isCoastalLand())
        {
            if (!pPlot->isHills() && !pPlot->isPeak())
            {
                pPlot->setTerrainType(eShallowsTerrain);
                bChanged = true;
            }
        }
    }
}
The rest of the GW mod would apply in any case. So the post I've quoted might be wrong on that. Kind of annoying not to know what the actual code is. Oh well.
 

arcvoodal

Chieftain
Joined
Jan 14, 2009
Messages
46
Okay so it appears global warming does still take place but only happened 3 times in the whole game. I will need to remove the GWmod from neoteric world. To do that I assume I will need to recompile the CvGame.cpp which isn't avaliable in neoteric world right? I doubt its feasible to offset the code by editing the xml values to compensate for the nerfed global warming weights. Also impossible to restore the behaviour that it turns the tile to a desert and not just change it based on what it was. Guess that feature of the game is just forever lost then.
 
Last edited:

f1rpo

plastics
Joined
May 22, 2014
Messages
1,502
Location
Germany
It's true that the changes are hardcoded in CvGame.cpp, but you'd have to recompile all the C++ source code for Neoteric World (into a new GameCore DLL), not just that one file. I've compared the The Neoteric World DLL with the one from RevDCM 2.721, and, although they have the exact same file size, the (binary) contents differ, so it does seem that BobeBrown made some minor DLL change(s) of his own. The DLL-based features listed in the Neoteric World thread all seem to be from RevDCM, so I've no clue what those changes might be and whether they're dispensable.

Well, the original GW system was pretty terrible, so GW that hardly ever strikes might still be an improvement.
Okay so it appears global warming does still take place but only happened 3 times in the whole game.
Personally, I'm OK with GW not being a factor in many games. The K-Mod version of the GWMod that I've been using produces a lot of GW events when a large portion of the world industrializes at about the same time, i.e. when pollution happens everywhere, not just on the territory of one or two civs that are far ahead, and when there is late-game warfare that delays the end of the game. Iirc it's even a stated goal of K-Mod that GW should have a big impact less often than not. Of course, for all I know, the game you've just played may have been just the type of game where a lot of GW should've been expected.
 

arcvoodal

Chieftain
Joined
Jan 14, 2009
Messages
46
Yeah I think GW is kinda lame, but I wanted to solve that by cranking it up to 11 instead of down to 0 lol. I like the idea of the rising seas aspect, but the terrain is something I want to change straight to desert (I have merged a terraforming and tree-nursery improvement into the mod). That stage is so late that for me just casually playing single player I don't try min-max win, just want spiciness and a different kind of city management in the form of choosing which tiles to restore and which to consider lost (I made it expensive to terraform).

Honesty, I have made so many changes of my own copy of the Neoteric world mod, such as restored civics and techs to vanilla. added a bunch of wonders using models posted on the site, changed unit models, ripped the sound effects from civ6 and convert them to replace civ4 sounds for gunfire, artillery, and the yelps of units getting hit, borders can't expand more than 2 tiles from coast (I believe it was you that showed me how to make that code, thanks!). My god, the list of changes I have made is ridiculous. I have considered just starting it over and copy-pasting the most of the assets and redoing the compiling and merging of BUFFY etc. Don't know how to do all that yet, but it will allow me to tweak the AI decision making and use the new version of "better espionage".

Alas, I won't be able to upload it because the base will still be neoteric world which isn't mine, nor will most of the code be either, and it uses assets from civ5 and civ6. But I will share what I am allowed to once it is all done. But that is into the future when I have learned javascript and then learned the syntax of python better, as well as understanding C++ or whatever else this game uses. Unfortunate since there aren't actually many things left I want to change, its very close already to all I want civ4 to be for me.
 

f1rpo

plastics
Joined
May 22, 2014
Messages
1,502
Location
Germany
I have considered just starting it over and copy-pasting the most of the assets and redoing the compiling and merging of BUFFY etc. Don't know how to do all that yet, but it will allow me to tweak the AI decision making and use the new version of "better espionage".
If you're determined, then I reckon that you'll be able to fix problems that may arise from using the RevDCM 2.721 DLL. And, right, then you can make your own DLL changes and could also e.g. merge the latest version of RevDCM (though that would probably also entail merging XML and Python changes) or even Legends of Revolution. Edit: Just tried launching Neoteric World with the DCM 2.721 DLL. No errors upon launch.
Alas, I won't be able to upload it because the base will still be neoteric world which isn't mine, nor will most of the code be either, and it uses assets from civ5 and civ6. But I will share what I am allowed to once it is all done.
Expanding on Neoteric World should not be a problem according to the "Modiquette" thread. I think several large mods include unit models that have been converted from Civ 5; so that also doesn't seem to be a hindrance, at least not in practical terms. Copying audio files from other games sounds more problematic.
But that is into the future when I have learned javascript and then learned the syntax of python better, as well as understanding C++ or whatever else this game uses.
Visual C++ 2003 to be exact.
 
Last edited:

arcvoodal

Chieftain
Joined
Jan 14, 2009
Messages
46
Yeah appears there were changes made to 2.721 judging by the comments:

I cannot find the link to that actual version. Could you please post it for me?
 
Last edited:

f1rpo

plastics
Joined
May 22, 2014
Messages
1,502
Location
Germany
The DLL and other assets are here, the DLL source here. It says 2.72, but I assume that it includes the 2.721 hotfix:
Yep you are correct, a last minute typo occurred when cleaning up the civics screen for the case when the Revolutions mod is turned on. Wait about 15-30minutes and I will upload a new version 2.721 to fix the typo.
Or, rather, I doubt that the hotfix involved the DLL at all.
Yeah appears there were changes made to 2.721 judging by the comments: [...]
BobeBrown's post explicitly says that he re-compiled it, no hint as to which changes he made, if any. Additional civics would probably be XML-only.
 
Top Bottom