AI suggestions

It also might be that I have not tweaked it enough yet, but the changes made so far will mean you get far less WW if you are basically having a fairly decisive win (winning most battles that you choose to fight, even if the war as a whole drags on). If however, you are trying to stage an invasion of enemy territory using sheer weight of numbers, but crappy units (so LOSING most battles even though you eventually are winning the war) it'll still be almost as bad as ever (but that was a deliberate choice sincle I felt it modelled somethign closer to reality better)

Something else to consider that I just thought of. "Mercenary" type units (Warlords, Thieves, Assassins, Bandits, etc.) shouldn't cause War Weariness; maybe anything with no nationality (assuming that gives WW now), or POSSIBLY with the invisible tag (thoughts?) since those are all under-the-table units so-to-speak. Also be sure to check units attacked BY enemy controlled units of that type, as I'd say that wouldn't cause it either.

Offhand, future units that are completely computer operated shouldn't cause WW if lost. (I think this was mentioned elsewhere..?)
 
Maybe some weapons which were used mainly as demoralizing weapons (like the V1) could cause extra war weariness.
 
I've been looking at the code for settling, and there are already (some) safeguards against settling when the (soft) city limits are already causing you unhappyness. Now, I can see ways to improve those checks (potentially), but there are various ways I could do it, and I can't find an example in my games where the AI is settling itself into unhappyness.

If anyone has save games that exhibit this happening they would be useful as examples.

The way it works currently is that it inhibits the building of settlers (or tribes etc.) when any extra settlers (once settled) would create city-limit unhappyness AND the civ-wide happyness quotient is already negative. There is no code in the settler AI itself to inhibit them settling once they are built however. In the absence of inhibitions the AI will build up to about 1 settler for each 2 cities it currently has (max).

Obvious possible changes I can see are:
  1. Change the calculation of the civ-wide happyness quotient. Currently this is the sum of each city's net happyness multiplied by its population. This means that a few large but happy cities will dominate a larger number of small but unhappy cities, and thus allow more settler building. No unhappyness in capital civics might cause this to happen. Lots of ways to tweak this function:
    • Make the city's contribution only consider a capped number of happyness/unhappyness (say first 3 or 4, so that a city happy by 20 doesn't overpower 4 cities unhappy by 4)
    • Don't weight by population (or at least not linearly)
    • Omit the captial from the calculation if using a no-capital-unhappyness civic. Similarly cities with no-unhappyness wonders
  2. Add code to the settler AI itself to cause them to just wait in cities if settling would cause more unhappyness (based on same check settler production uses)

While these are all valid ways to proceed, I'd rather see some concrete examples to let me choose a bit more intelligently, so any examples you have (or can describe in more detail) would be appreciated...
 
Omit the captial from the calculation if using a no-capital-unhappyness civic. Similarly cities with no-unhappyness wonders

I think this is the big one, if you think about:

10 Pop 2 cities at +10 :mad: each = 10x2x10 = 200 :mad:points
1 Pop 10 capital at +20 :) = 1x10x20 = 200 :) points.

Not to mention that as a city grows unhappier, it starves & shrinks, which reduces it's anger quotient by a large percentage as the population drops. I think a better system would be (not real python, just pseudo-code):

Code:
for each player.cities:
  if city.nethappiness > 3:
    quotient += 3
  else:
    quotient += city.nethappiness

if quotient / player.numbercities >= civics.oversettlingpenalty:
  build settler
So you ignore population, and cap the contribution of happy cities to 3, then figure out the average and if building another city won't drop it below 0 then you can build a settler.

I've got a game where this has been happening, I'll upload a few saves from different times when I get home tonight.
 
I think this is the big one, if you think about:

10 Pop 2 cities at +10 :mad: each = 10x2x10 = 200 :mad:points
1 Pop 10 capital at +20 :) = 1x10x20 = 200 :) points.

Not to mention that as a city grows unhappier, it starves & shrinks, which reduces it's anger quotient by a large percentage as the population drops.
I suspect you're right - just want to confirm before I dive in with no actual way to test the results in any game I have.
I think a better system would be (not real python, just pseudo-code):
That's ok, it's C++ anyway ;-)
I've got a game where this has been happening, I'll upload a few saves from different times when I get home tonight.
Thanks - much appreciated
 
Not to mention that as a city grows unhappier, it starves & shrinks

Yeah this happens to me ALL the time. up down, in all cities but going up two then down 1 but the starvation and unhappiness is crazy.
 
I wonder if we could modify the starvation code to give a city some of it's food reserves back when it shrinks, say 50% or 75%? That way when a city starts to starve it doesn't drop from 10 people to 1 in just 9 turns.
 
I wonder if we could modify the starvation code to give a city some of it's food reserves back when it shrinks, say 50% or 75%? That way when a city starts to starve it doesn't drop from 10 people to 1 in just 9 turns.

I'm not sure that makes sense. Starvation occurs when the population is eating more than it produces. Therefore they dip into the reserves until that hits bottom at which
point people begin to perish until food production equals or beats the required amount.

Although more complicated, a more intuitive result would be nearby cities with excess food shipping their surplus to the city in starvation until they are back on their feet.
 
I'm not sure that makes sense. Starvation occurs when the population is eating more than it produces. Therefore they dip into the reserves until that hits bottom at which
point people begin to perish until food production equals or beats the required amount.

Although more complicated, a more intuitive result would be nearby cities with excess food shipping their surplus to the city in starvation until they are back on their feet.

Or the people leaving the starving city and moving to where there is food.
 
I'm not sure that makes sense. Starvation occurs when the population is eating more than it produces. Therefore they dip into the reserves until that hits bottom at which
point people begin to perish until food production equals or beats the required amount.

Although more complicated, a more intuitive result would be nearby cities with excess food shipping their surplus to the city in starvation until they are back on their feet.

Yeah, but I've always looked at 'food reserves' as more of a 'fractional population point' rather than actual stored food. You don't wait until the granary is full and then magically turn rice in babies. The way I imagine it is the more food you produce the more secure people feel in both moving from the wilderness into the city, and the more secure they are in starting or expanding a family, so food getting stored is actually people moving into or being born in your city, the limit being the point at which you grow to the next level.

From a gameplay perspective it takes 50 - 100 turns to grow a city one point, but if that city starves down to 0 stored food it will undo 50 - 100 turns of growth every turn. It seems like there shouldn't be such a huge disparity between speed of growth and speed of loss.
 
Or the people leaving the starving city and moving to where there is food.

Won't that be ok then if i put back in the Immigration Mod? I believe thats what it was set up for in the first place??

Do you have a GOOD working copy of the way "we" changed it?
 
I know this is something JosephII Has complained about, but would it be possible to get the AI to be more cognizant of REV? it has problems with preventing revolts and maintaining a large empire.
 
I know this is something JosephII Has complained about, but would it be possible to get the AI to be more cognizant of REV? it has problems with preventing revolts and maintaining a large empire.

Yes. It's on my list. Annoys me too.
 
Or the people leaving the starving city and moving to where there is food.

If food was not incoming. I'm operating under the assumption that the gov't would want to keep its people. ;)

But if food doesn't arrive (brigands choking off the trade routes, or no excess food elsewhere) then yeah, people would start to emigrate. Even possibly to a neighboring Civ depending on factors and proximity.

Yeah, but I've always looked at 'food reserves' as more of a 'fractional population point' rather than actual stored food. You don't wait until the granary is full and then magically turn rice in babies. The way I imagine it is the more food you produce the more secure people feel in both moving from the wilderness into the city, and the more secure they are in starting or expanding a family, so food getting stored is actually people moving into or being born in your city, the limit being the point at which you grow to the next level.

From a gameplay perspective it takes 50 - 100 turns to grow a city one point, but if that city starves down to 0 stored food it will undo 50 - 100 turns of growth every turn. It seems like there shouldn't be such a huge disparity between speed of growth and speed of loss.

I think the point of starvation causing such a rapid loss in population is to give the player a reason to end it. If you only lose 1 population then have another 50 turns until you lose another, it become much less of a priority.
 
Everyone here has made valid points so the best solution would probably be a compromise.

Emigration should be dependent on how much shrinkage in food a city has, not how many pop it's lost. If it's an event the risk of it occurring could be increased by how much loss in food, if it's a modmod then I have no idea how it works but should still be dependent on -:food: a city has.
When a City does shrink maybe keep 5% food. If it's a huge shrinkage it's only an extra turn to turn it about, but if it's only shrinking slowly it gives a player more turns to turn the city around.

Cheers
 
Receiving and losing pop because of immigration should be affected by border civics (no foreign immigrant with closed border, free specialist instead of pop with skilled worker, ect...)
 
Koshling:

Here are the saves where I am seeing the AI overexpand. The big offender is the Assyrians, who for some reason still haven't converted to Despotism despite have 13 cities! The saves are all Max Compat, and were made using the SVN, between Sept. 18th and 20th.
 

Attachments

What are the main causes of WW? Civics? I know there are some buildings like the market ones or graveyards, but they should not effect games if people just don't build them.

Civics yes indeed, but new changes to building chains are also contributing.

As for not building certain bldgs, that is already happening. So why have bldgs ppl won't build?

@Koshling,
Karadoc the author of the K-Mod found an original BtS bug that Greatly affects AI city placement. He talks about it on the last page of his mod thread. I think you should look at it cause it sounds very appropriate. If I get a chance I'll link the post. http://forums.civfanatics.com/showpost.php?p=10868135&postcount=65

JosEPh
 
Back
Top Bottom