This is not a typical motive with a timer and a randomizer.
First of all, bribery is only valid in the AI realms. An AI will never bribe you onto some third party (his foe against which it is battling) in the base BTS. Bribery or dogpiling is an AI process that is calculated each turn with its own RNG to happen, but in a diminishing manner. In the few first turns, the dogpiler has great chance to bribe someone and as the war stretches in time, the odd of this happening shrinks hard.
The concept of timer was established for various reasons:
- Avoid mass trading in a way it gives no chance to the human player
- Avoid to be nagged all the time by the AI
- Avoid accumulating huge amounts of diplo hits
- Others
In bribery, if the dogpiler has hit the lucky dice side and if there is an actual valid third party, the "pact" will
necessarily succeeds.
Once the war has begun between the potential dogpiler and its foe, the main factors that determine the bribe odd are the XML variable
iDeclareWarTradeRand and the war counter, which is the number of turns since the war has started.
Interestingly, iDeclareWarTradeRand is 40 for all leaders but Pacal. Pacal has 60 instead. Perhaps, the devs knew Pacal was a natural tech leader, allowing him to easily bribe...who knows?
Now, for the war counter (
AI_getAtWarCounter() ), the moment of the declaration has a value of 0 and the turn after is labeled 1 and so on. Just to give a reference.
The RNG for initiating a bribe is calculated via that little part of code:
A mention about type of wars:
AI has several types of war and will change its behaviour according to the type of war. When the dogpiler is a victim of another AI DoWing on him/her, the type of war can easily be deduced as a defensive war (
WARPLAN_ATTACKED ). And the diplo web will show you without doubt that fact. Nevertheless, if the dogpiler has initiated the war, you can't know for sure which type of war (s)he has chosen. The
WARPLAN_DOGPILE deflates the chance of a bribe. Sadly, there is no particular way to know without cheating. But a feeble way to exclude dogpiling war is when the dogpiler has equal or more than 50% more power than its potential victim.
Here starts the calculus:
If
WARPLAN_DOGPILE, then the war count is approx. doubled, meaning :
Code:
ModifiedWarCount=WarCount*2+5
But we can ignore this because in practice, it is not doable to guess this type of war.
And if the potential dogpiler is a victim, then that part is easily guessed irrelevant. Again, interestingly, that modification for dogpilers turns out to be a penalty...
Then, if the war count is 0 to 9,
Code:
Odds=([COLOR="Green"][B]iDeclareWarTradeRand[/B][/COLOR]*WarCounter/10) +1
No rounding at all because all from 0 to 9, it doesn't generate any float number...
We see earlier in the WarCount, stronger is the chance of a bribe
Then, for the three first turns following the war (that is turn 0,1,2,3)
Code:
Odds2=[(Odds/4)]+1
Now, there is a rounding effect and it is rounding down.
At last, the Odd number isn't the real odd. Just like the randomizers, it is the number of faces of a virtual dice. For instance, if it gives a number of 40, then the real odds are 1/40=2.5% per turn.
In Summary, for the 52 leaders except Pacal II, the odds are:
After the third turn of war, the odds dramatically plummet.
After the 10th turn of the war, the odds remain constant for the rest of the war, that is 2.5% chance per turn the warmonger bribes someone along.
Once the dice says to the dogpiler "Go for it, bring more in the party!", the code chooses amongst the AI who can be an ally.
The attitude of the dogpiler to that potential ally has a component in skewing that AI over another to be an ally, but the choice is still random.
Now remains the deal part...
To recapitulate:
- The game rolls for the dogpiler its will to initiate a bribe
- Then, the dogpiler chooses who will be its partner in war.
- Finally, the deal is set according to several steps.