C2C SVN Changelog

Just pushed to SVN (3714):
  • Tweaked AI assessment of withdrawal and knockback effects on desirability of outcome (prevents potential suicides against high value enemy units)
  • Added substantial stats logging to the BBAI logs (see below)
  • Fixed a nasty issue in AI civic evaluation that was causing it to oscillate between matriarchy and patriarchy (and a few other combos)
  • Added pedia text for auto-build buildings to say in the pedia that they are
  • Added messages to the player when auto-build buildings get built in your cities
  • Fixed a potential crash in use of the pedia from the main menu

The stats dump will cause a lot of statistics about the current state of each player's civ to be added to the BBAI log at the end of that player's turn. The idea behind this is to be able to see, in one place, where the AI is falling behind and get some clues as to why. The stats logged are as follows:
  • Treasury
  • Income from self
  • Income from trade deals
  • Units costs
  • Unit supply costs
  • Maintenance costs
  • Corporation taxes
  • Inflation costs
  • Civic costs
  • Total science output
  • Total espionage output
  • Total culture output
  • Total population
  • Total production
  • Total food production
  • Number of cities
  • National rev index
  • Total count of animals subdued
  • Number of times a civic switch has occurred
  • Number of total civic changes made
  • Number of turns spent in anarchy
  • For each city:
    • Population
    • Production
    • Food surplus
    • Net happyness
    • Net health
    • Local rev index
    • Maintenance cost
    • Income
    • Science
    • Espionage
    • Culture
    • Current values for all properties present
  • Count of each unit type the player possesses
  • Count of each building type that has been constructed by a unit that the player has (so indicates how subdued animals are being used primarily)

Testing this is what enabled me to find the civic issue with patriarchy/matriarchy, which is also fixed in this rev. This was actually a problem with ANY civic that had city growth modifiers, because the AI evaluated the value of growth modifiers based on how much faster (in actual turns given the food supply, happiness excess, etc. it has) it would actually make it grow. If a city has no food surplus a changed modifier won't help, so these modifiers got very low values for cities with no net food production. The bug was that cities currently producing units using food (settlers etc.) appeared to give no benefit from these modifiers, so while a civ is buildings settlers and workers the value of things like matriarchy appeared to drop suddenly, and as a result it would often switch. After the settler/workers complete it then finds matriarchy looks much better, so it switches back...and so on. I fixed this by using the nominal food surplus (i.e. - ignoring revolutions or build-by-food in the calculation), and that seems to have settled things down.

As an example, I have included below the output from my BBAI logs a sample AI for the last turn after playing 350 turns on a small map in autoplay from a game start (this has lost its indentation for some reason when I pasted it, so it's actually slightly easier to read in real BBAI log):
Spoiler :

[472319.656] City State of Pirate Empire stats for turn 345:
[472319.656] Treasury: 1112
[472319.656] Total gold income from self: 24
[472319.656] Total gold income from trade agreements: 0
[472319.656] Unit cost (pre inflation): 9
[472319.656] Unit supply cost (pre inflation): 0
[472319.656] Maintenance cost (pre inflation): 18
[472319.656] Civic upkeep cost (pre inflation): 0
[472319.656] Corporate income (pre inflation): 0
[472319.656] Inflation effect: 0
[472319.656] Total science output: 74
[472319.656] Total espionage output: 10
[472319.656] Total cultural output: 51
[472319.656] Total population: 13
[472319.656] Total food output: 69
[472319.656] Total production output: 107
[472319.656] Num cities: 4
[472319.656] National rev index: 5
[472319.656] Number of animals subdued: 55
[472319.656] Civic switches: 8
[472319.656] Total num civics switched: 12
[472319.656] Total turns in anarchy: 8 (2%)
[472319.656] City Port Royal:
[472319.656] Population: 7
[472319.656] Production: 46
[472319.656] Food surplus: 9
[472319.656] Local rev index: -19
[472319.656] Maintenance: 3
[472319.656] Income: 16
[472319.656] Science: 52
[472319.656] Espionage: 8
[472319.656] Culture: 37
[472319.656] Net happyness: 19
[472319.656] Net health: 10
[472319.656] Property values:
[472319.656] Water Pollution Rate: -53
[472319.656] Air Pollution Rate: -536
[472319.656] Disease Rate: 47
[472319.656] Crime Rate: 25
[472319.656] City Barataria:
[472319.656] Population: 2
[472319.656] Production: 25
[472319.656] Food surplus: 8
[472319.656] Local rev index: 0
[472319.656] Maintenance: 4
[472319.656] Income: 2
[472319.656] Science: 7
[472319.656] Espionage: 1
[472319.656] Culture: 4
[472319.656] Net happyness: 3
[472319.656] Net health: 3
[472319.656] Property values:
[472319.656] Water Pollution Rate: -43
[472319.656] Air Pollution Rate: -384
[472319.656] Crime Rate: 37
[472319.656] Disease Rate: 23
[472319.656] City Roma:
[472319.656] Population: 3
[472319.656] Production: 26
[472319.656] Food surplus: 11
[472319.656] Local rev index: 23
[472319.656] Maintenance: 7
[472319.656] Income: 5
[472319.656] Science: 12
[472319.656] Espionage: 0
[472319.656] Culture: 6
[472319.656] Net happyness: 2
[472319.656] Net health: 8
[472319.656] Property values:
[472319.656] Air Pollution Rate: -562
[472319.656] Water Pollution Rate: 34
[472319.656] Disease Rate: 33
[472319.656] Crime Rate: 42
[472319.656] City La Vega:
[472319.656] Population: 1
[472319.656] Production: 10
[472319.656] Food surplus: 1
[472319.656] Local rev index: 2
[472319.656] Maintenance: 3
[472319.656] Income: 0
[472319.656] Science: 2
[472319.656] Espionage: 1
[472319.656] Culture: 2
[472319.656] Net happyness: 3
[472319.656] Net health: 6
[472319.656] Property values:
[472319.656] Water Pollution Rate: -4
[472319.656] Air Pollution Rate: -408
[472319.656] Crime Rate: 10
[472319.656] Disease Rate: 2
[472319.656] Units:
[472319.656] Worker: 3
[472319.656] Elephant Rider: 3
[472319.656] Great General: 2
[472319.656] Trained Dogs: 1
[472319.656] Rogue: 1
[472319.656] Atl-Atl: 12
[472319.656] Hunter: 1
[472319.656] Slinger: 2
[472319.656] Stone Axeman: 4
[472319.656] Stone Maceman: 1
[472319.656] Buildings constructed by units:
[472319.656] Myth of the Cheetah, Jaguar and Leopard: 1
[472319.656] Myth of the Bull: 1
[472319.656] Myth of the Bear: 1
[472319.656] Myth of the Deer: 1
[472319.656] Myth of the Horse: 1
[472319.656] Myth of Birds: 1
[472319.656] Military Standard (Animal mascot): 3
[472319.656] Herd - Buffalo: 1
[472319.656] Herd - Camel: 1
[472319.656] Myth of the Camel: 1
[472319.656] Herd - Deer: 1
[472319.656] Myth - Earth: 1
[472319.656] Myth of the Giraffe: 1
[472319.656] Myth of the Goat: 1
[472319.656] Governor's Menagerie: 1
[472319.656] Governor's Pets: 2
[472319.656] Myth of the Lion: 1
[472319.656] Master Hunter: 1
[472319.656] Myth of Reptiles: 1
[472319.656] Myth of Rodents: 1
[472319.656] Myth - Sky: 1
[472319.656] Snake Charmer: 1
[472319.656] Myth of the Walrus: 1
[472319.656] Myth of the Weasel: 1
[472319.656] Myth of the Wolf: 1
[472319.656] Feather Worker: 1
[472319.656] Myth of the Phoenix: 1

As you can see it probably is still a bit civic-switch-happy, but it's doing a decent job both hunting and using its subdued animals.

Anyway, games started under this rev or later, will now include the necessary information to produce these stats at any time, so if you have a game in which the AI falls behind (or suddenly implodes), turn BBAI logging on and play a turn or two then send me the BBAI logs (or take a look for yourself as you see fit)
 
Updates

Completed core Promotion Line definitions
Completed programming of bAutoPrereqHierarchy tag on Promotion Lines
Tweaked retraining mechanism to not include free promotions
 
Just pushed to SVN (3725):
  • Fixed CTD reported by Hydro (which seems to be with espionage allocation)
  • Fixed CTD reported by Sgtslick (logging crashes if on turn 0)
 
Just pushed to SVN (3734):
  • More memory optimization
  • Fixed a bug with promotions given directly by Python
  • Reworked promotion retraining internals a bit to simplify and make more transparent
 
That's most likely because I accidentally deleted one of the ending tags when trimming the last few buildings. It's fixed now, and working fine for me SVN wise.

Well, a clean SVN 3734 is still giving errors, so you might want to check again.
 
These changes are causing about 100 XML errors as far as I can tell, so please take a look at them.

It seems the main CIV4BuildingInfos.xml in SVN 3731 was accidentally replaced with a "modular only" version (where you list only the tags that are changed).
Reverting it to the previous version (attached) probably solves the problem. (Paste to the Caveman2Cosmos\Assets\XML\Buildings\ folder.)
 

Attachments

Back
Top Bottom