whoward69
DLL Minion
I've just deleted the source to force it to re-download and it's identical to the baseline copy I took of 2.13 (or .12 or .11 or whatever it was!)
The log from test 2 (post #47) implies the issue is with a unit trying to upgrade, and test 4 seems to confirm that. I'm guessing that the GEM code that tries to spend money upgrading units is calling into the DLL in ways that the main code doesn't expect ... I shall investigate further.
...
<Row Value="0" Name="GLOBAL_CS_UPGRADES"/>
Not hard at all (in fact it's in the next version of my DLL mods - which is waiting for Firaxis to release the code for 1.0.2.21)
The rule for deciding whether or not the AI (major or CS) razes a (non-capital) city is "am I now unhappy?" If the answer is yes, the AI will always raze the city.
The problem with this for City States is that they always grow their pop such that their happiness hovers around the -1 to 2 region. For them, capturing a city, unless it is very small (pop 1 or 2) AND has a luxury they don't already have, will always make them unhappy.
The simple solution, is to change the logic for CS to test for being "very unhappy" (-10 or more) and only raze cities then. In game play terms, this means that when a CS captures a city it will almost always keep it, if it quickly captures a second it will sometimes keep it, sometimes raze it and a third in quick sucession is almost always razed. However, if the CS goes back to a period of peace and has time to build happiness buildings, when the next war comes it will probably be happy again and capture a third city. For me, this is a much better approach.
Anyone wanting to do this themselves, the code is in CvPlayerAI::AI_conquerCity() near the end, and you need to change
Code:if ([COLOR="red"][B]IsEmpireUnhappy()[/B][/COLOR] || (GC.getMap().GetAIMapHint() & 2) || (GetPlayerTraits()->GetRazeSpeedModifier() > 0 && getNumCities() >= 3 + (GC.getGame().getGameTurn() / 100)) )
to
Code:if ([COLOR="Red"][B](isMinorCiv() ? IsEmpireVeryUnhappy() : IsEmpireUnhappy())[/B][/COLOR] || (GC.getMap().GetAIMapHint() & 2) || (GetPlayerTraits()->GetRazeSpeedModifier() > 0 && getNumCities() >= 3 + (GC.getGame().getGameTurn() / 100)) )
W
This is great. And exactly what i've been looking for since, well, since i started playing. I don't know jack about mods though. If I attempt to change this myself, do I risk messing up my game?
Is it possible that you gain a hurry factor for the first building(in a city), by building a city on jungle, like when you build it on a forest?
It's possible (simple change to the code) but as you don't get production bonus for chopping down jungle (IIRC) I didn't add it
Another Amazing update whoward! I've just downloaded v6 but since this the first time I've tried to install a DLL file, how does one go about installing them?
The CS razing logic should be more complex in order to represent the niceties of the real world:
Ok, I will check this soon and let you know...
Feel free to take this code and use it as the basis for your own mod to implement these ideas
<Row Name="GLOBAL_NO_CONQUERED_SPACESHIPS" Value="[B][COLOR="Red"]0[/COLOR][/B]"/>