New Hotfix Version (12-15)

Status
Not open for further replies.
@Deadstarre
The process is complex :crazyeye: I might be mistaken with some details. But, more or less, here it goes.
1. If the number of turns to train or build is bigger than AI_ATTEMPT_RUSH_OVER_X_TURNS_TO_BUILD (15, game speed adjusted), AI marks such an order as "try to rush".
2. In vanilla game only those buildings (or units) were hurried, I think. But that code is replaced by CP code, which completely ignores that flag.
3. Hurrying is done during economic phase of the turn and (I think) the only important factor is available gold. This is really damn strong tactics. If AI is doing good with gold, it seems that it basically hurries everything. So, on top of production bonuses, AI will utilize this mechanics, constantly exchaning gold into more production bonuses (re: snowballing).
4. AI is scanning through cities and checks available builds. If there's gold in treasury, it hurries it. AI (I think) tries to finish the building with the hurry, but I wouldn't say that is a hard rule. It is possible to simply invest in the building.
5. This process is so important, that it is called twice (great comment in the code "See if we want to finish any of our builds by rushing; let's do this twice, to make sure we're using all our money.").
6. AI cannot hurry, if there's not enough gold in treasury AI_GOLD_TREASURY_BUFFER (150, game speed adjusted). It also uses some kind of PurchaseBuffer when AI is saving for a specific purchase (?), but I didn't go into details here.
7. It also doesn't hurry if GPT is negative on average for the last 5 turns.
8. There's also separate code for Faith purchase (which is considered hurry, too), plus code that analyzes possible chops.
9. Puppets don't hurry, unless AI is Venice. Edit. That would also explain, why puppets develop so slowly, beside not building old-eras things.
10. Hurrying in Capital takes priority, and if a city is threatened to be conquered, AI doesn't invest there.
 
Last edited:
What does the mod do? Care to share a link? Did not find it on Civfanatics. Thanks!

The mod is actually called Leadership Reformation. It basically gives your Generals/Admirals the potential to get certain traits that can then be upgraded via experience earned from nearby combat.​
 
The process is complex :crazyeye:

Thank you for the very fleshed out answer =)

This is really damn strong tactics. If AI is doing good with gold, it seems that it basically hurries everything. So, on top of production bonuses, AI will utilize this mechanics, constantly exchaning gold into more production bonuses (re: snowballing)

It has to be this way though, it's what the human would do. Im happy its the case

I've always felt they had room for improvement in when they decide to buy and utilize units; like, an AI shouldn't reach a certain number of thousands of gold - at that point itd be more useful to mass buy units in every city and use them for an impromptu war than continue to have it sit in treasury- or rather if theyre already at the supply cap, use existing units with the plan to easily replace any losses immediately. But if that were the case, the AI who are doing well would really eat up the other AI who are struggling and runaways would be even worse. Still a little frustrating when I am dominating an AI militarily even though they appear to be holding enough gold to stop me, Its good to know that when gold is appearing to pile up theyve already bought every building they possibly could.

7. It also doesn't hurry if GPT is negative on average for the last 5 turns.

its easy to see why they have such a rule, i can think of a few situations it could be exploited though. I wonder if it factors instant yields as well? for instance I know no matter what my gpt looks like i can still rely on consistent income to come in from the progress or authority instants
 
@Deadstarre
The process is complex :crazyeye: I might be mistaken with some details. But, more or less, here it goes.
1. If the number of turns to train or build is bigger than AI_ATTEMPT_RUSH_OVER_X_TURNS_TO_BUILD (15, game speed adjusted), AI marks such an order as "try to rush".
2. In vanilla game only those buildings (or units) were hurried, I think. But that code is replaced by CP code, which completely ignores that flag.
3. Hurrying is done during economic phase of the turn and (I think) the only important factor is available gold. This is really damn strong tactics. If AI is doing good with gold, it seems that it basically hurries everything. So, on top of production bonuses, AI will utilize this mechanics, constantly exchaning gold into more production bonuses (re: snowballing).
4. AI is scanning through cities and checks available builds. If there's gold in treasury, it hurries it. AI (I think) tries to finish the building with the hurry, but I wouldn't say that is a hard rule. It is possible to simply invest in the building.
5. This process is so important, that it is called twice (great comment in the code "See if we want to finish any of our builds by rushing; let's do this twice, to make sure we're using all our money.").
6. AI cannot hurry, if there's not enough gold in treasury AI_GOLD_TREASURY_BUFFER (150, game speed adjusted). It also uses some kind of PurchaseBuffer when AI is saving for a specific purchase (?), but I didn't go into details here.
7. It also doesn't hurry if GPT is negative on average for the last 5 turns.
8. There's also separate code for Faith purchase (which is considered hurry, too), plus code that analyzes possible chops.
9. Puppets don't hurry, unless AI is Venice. Edit. That would also explain, why puppets develop so slowly, beside not building old-eras things.
10. Hurrying in Capital takes priority, and if a city is threatened to be conquered, AI doesn't invest there.

This is a pretty good run-down of my code. I've also got some other routines specifically for units, notably one that runs during the player phase and checks for empty slots in operations (sneak attacks, etc.) and tries to fill them in ASAP with an appropriate unit.

Note that, in vanilla, the AI did not know how to purchase units or buildings. It never, ever would. I figured that out waaaay back in CSD days.

Thank you for the very fleshed out answer =)



It has to be this way though, it's what the human would do. Im happy its the case

I've always felt they had room for improvement in when they decide to buy and utilize units; like, an AI shouldn't reach a certain number of thousands of gold - at that point itd be more useful to mass buy units in every city and use them for an impromptu war than continue to have it sit in treasury- or rather if theyre already at the supply cap, use existing units with the plan to easily replace any losses immediately. But if that were the case, the AI who are doing well would really eat up the other AI who are struggling and runaways would be even worse. Still a little frustrating when I am dominating an AI militarily even though they appear to be holding enough gold to stop me, Its good to know that when gold is appearing to pile up theyve already bought every building they possibly could.



its easy to see why they have such a rule, i can think of a few situations it could be exploited though. I wonder if it factors instant yields as well? for instance I know no matter what my gpt looks like i can still rely on consistent income to come in from the progress or authority instants

The treasury function the code uses looks at gross input/ouput, not GPT, so yeah, it takes into account instant yields.

G
 
I’m using just CP and CBO, and having a strange issue. Whenever I explore and meet City States, I get the popup saying they are giving me 8 gold and 15 faith (or whatever the numbers are), but I don’t actually get those things....
 
I’m using just CP and CBO, and having a strange issue. Whenever I explore and meet City States, I get the popup saying they are giving me 8 gold and 15 faith (or whatever the numbers are), but I don’t actually get those things....
Could be that you need the diplomacy mod for this to work properly? Also, instant yields can go to capital or to the empire pool. So it's a bit difficult to track. Have you checked that you don't actually have the faith pool increased by 15 points?
 
Could be that you need the diplomacy mod for this to work properly? Also, instant yields can go to capital or to the empire pool. So it's a bit difficult to track. Have you checked that you don't actually have the faith pool increased by 15 points?
I’m just looking at the faith counter in the top left. Is there another place where faith gets accumulated? Sorry If noobish question
 
Status
Not open for further replies.
Back
Top Bottom