I have had something of a break-through today!
While playing my current play(test) game, the world's other (and dominant - I'm well behind him) super-power suddently comitted civic suicide by switchign to chiefdom with 34 cities with both city limits and REV enabled!
Since I had auto-saves I went back and ran it under the debugger, so now I finally know why this sometimes occurs, and am able to fix it. Turns out that the original BBAI code that evaluates happyness effects of civics didn't cope well with large negative swings in happyness, and various intermediate values overflowed due to a quadrantic term that was never set up for negative values. The overflow caused the final result to be a large positive value, causing the switch.
I have now fixed this and tested it against my own game. Prior to this fix it weas essentially inevitable that large AI civs would self-destruct at some point. That should no longer happen.
Glad I found this before the v21 relaese
While playing my current play(test) game, the world's other (and dominant - I'm well behind him) super-power suddently comitted civic suicide by switchign to chiefdom with 34 cities with both city limits and REV enabled!
Since I had auto-saves I went back and ran it under the debugger, so now I finally know why this sometimes occurs, and am able to fix it. Turns out that the original BBAI code that evaluates happyness effects of civics didn't cope well with large negative swings in happyness, and various intermediate values overflowed due to a quadrantic term that was never set up for negative values. The overflow caused the final result to be a large positive value, causing the switch.
I have now fixed this and tested it against my own game. Prior to this fix it weas essentially inevitable that large AI civs would self-destruct at some point. That should no longer happen.
Glad I found this before the v21 relaese
