Calculating Cash in tech deals

Major Tom

Mortal
Joined
Jun 1, 2005
Messages
756
Location
Oslo
This is probably a noob question but have always iterated.

Say you have aesthetic (507) and (117/507) in alpha, How much cash is AI willing to pay extra for aesthetic when trading? Looking for the formula where aes=alpha(117/507)+cash.
 
I can join the noob crowd too then because I don't know and I'm also curious. :)

I do know that the AI gives 80% of the value to your techs, so if you have aestethics they value it at 507*0.8 = 405.6, and since 507-405.6 = 101.4 I always try to put in more than 102 beakers into alpha before trying the trade.

How gold is counted and valued on either side of the scales I don't know.
A related complication is how monopoly techs alter things.
 
I can join the noob crowd too then because I don't know and I'm also curious. :)

I do know that the AI gives 80% of the value to your techs, so if you have aestethics they value it at 507*0.8 = 405.6, and since 507-405.6 = 101.4 I always try to put in more than 102 beakers into alpha before trying the trade.

How gold is counted and valued on either side of the scales I don't know.
A related complication is how monopoly techs alter things.
Yeah, monopoly (or number of AI having it already) maybe a thing.
In this at least 1 other had it. And the answer was somewhere in the range 55-60. I started at 120 and worked my way down in 5 coins interval. Took me several minutes of my time.
 
This is btw a reason that I like to not get stuff like archery/HBR/divine right etc. Stuff that you don't need currently.
They are good to have as indicators for deals.
 
Right. I also think it matters who initiated the deal. I am sure that it happened that an offer came out of the blue from AI where he offers a tech + cash where everything has a 1:1 valuation.
 
As far as I know AIs will always value gold and beakers at a 1:1 ratio, but there's a ton of factors where they'll value techs for more or less. Deity difficulty adds a flat 85% multiplier to a player tech's beaker value, IIRC, monopoly techs are valued higher (or non-monopoly techs are valued less, either or), etc.
 
I didn't know exactly either, but fortunately I did know basically where to look in the code to find out.

Relevant functions: cvPlayerAI::AI_considerOffer(), cvPlayerAI::AI_dealVal(), cvTeamAI::AI_techTradeVal(), cvPlayerAI::AI_goldTradeValuePercent().

It seems to start by evaluating the relative value. In arbitrary "Value" units...

Gold is worth either 1.02 or 1.03 "Value" per gold, depending on whether the AI is in financial trouble (AIs consider themselves in financial trouble if their gold slider is too high; if I recall correctly I think it's 50%+ of commerce going to gold, but my memory on that may be wrong). So if you offer 200 gold on your side, the AI is going to consider that offer a value of 204 or 206.

For techs, it starts by figuring out how many beakers the receiving player has remaining to discover the tech (if you're at 50/59 on a tech, that would be 9). This number is also going to depend on things like difficulty level, map size, game speed, and number of players on the team - Deity AIs for example research at 1.3x speed, so a tech offered by you to them is worth about 78% of the beaker cost, while a tech offered by them to you is worth the standard 100% since you don't get a difficulty level tech speed boost.

Once it knows the beaker value, that gets multiplied by something between 1.5 and 2.0 depending on how many teams that AI has met who know the tech (including you and itself). 1.5 would be if the AI knows nobody who has the tech, 2.0 would be if everybody the AI knows has the tech, 1.75 if half the teams the AI has met have the tech, etc.

Some specific techs then get an additional 1.1x multiplier to their beaker, because they have iAITradeModifier of 10 in CIV4TechInfos.xml. Most techs have iAITradeModifier of 0, so no multiplier in general.

Spoiler Full List of techs with inflated value :
Feudalism, Guilds, Military Tradition, Ecology, Electricity, Fission, Flight, Advanced Flight, Composites, Stealth, Genetics, Fiber Optics, Fusion, Archery, Horseback Riding, Machinery, Gunpowder, Rifling, Steel, Assembly Line, Railroad, Artillery, Industrialism, Rocketry, Satellites, Robotics


And after that, it rounds the value down to the nearest multiple of 10 (why? I have no idea. But it does.). So if at this point it thinks the tech is worth 209, it will instead start considering it worth 200.

As a final step, any human requesting the tech is assumed to have a minimum of 10 value for the tech. This only applies to human trade partners, and in practice pretty much never applies anyways (you'd need to be trying to get a tech for which you had ~1-6 beakers remaining to discover it and would be finding it next turn; unless it was some sort of huge panic event like a sudden DoW, you'd simply finish researching that yourself to avoid incrementing the WFYABTA counter).

So that's how it figures out how much each side of the deal is worth. Then it will accept the deal if it thinks it's getting at least 10% more value than you are.
 
I didn't know exactly either, but fortunately I did know basically where to look in the code to find out.

Relevant functions: cvPlayerAI::AI_considerOffer(), cvPlayerAI::AI_dealVal(), cvTeamAI::AI_techTradeVal(), cvPlayerAI::AI_goldTradeValuePercent().

It seems to start by evaluating the relative value. In arbitrary "Value" units...

Gold is worth either 1.02 or 1.03 "Value" per gold, depending on whether the AI is in financial trouble (AIs consider themselves in financial trouble if their gold slider is too high; if I recall correctly I think it's 50%+ of commerce going to gold, but my memory on that may be wrong). So if you offer 200 gold on your side, the AI is going to consider that offer a value of 204 or 206.

For techs, it starts by figuring out how many beakers the receiving player has remaining to discover the tech (if you're at 50/59 on a tech, that would be 9). This number is also going to depend on things like difficulty level, map size, game speed, and number of players on the team - Deity AIs for example research at 1.3x speed, so a tech offered by you to them is worth about 78% of the beaker cost, while a tech offered by them to you is worth the standard 100% since you don't get a difficulty level tech speed boost.

Once it knows the beaker value, that gets multiplied by something between 1.5 and 2.0 depending on how many teams that AI has met who know the tech (including you and itself). 1.5 would be if the AI knows nobody who has the tech, 2.0 would be if everybody the AI knows has the tech, 1.75 if half the teams the AI has met have the tech, etc.

Some specific techs then get an additional 1.1x multiplier to their beaker, because they have iAITradeModifier of 10 in CIV4TechInfos.xml. Most techs have iAITradeModifier of 0, so no multiplier in general.

Spoiler Full List of techs with inflated value :
Feudalism, Guilds, Military Tradition, Ecology, Electricity, Fission, Flight, Advanced Flight, Composites, Stealth, Genetics, Fiber Optics, Fusion, Archery, Horseback Riding, Machinery, Gunpowder, Rifling, Steel, Assembly Line, Railroad, Artillery, Industrialism, Rocketry, Satellites, Robotics


And after that, it rounds the value down to the nearest multiple of 10 (why? I have no idea. But it does.). So if at this point it thinks the tech is worth 209, it will instead start considering it worth 200.

As a final step, any human requesting the tech is assumed to have a minimum of 10 value for the tech. This only applies to human trade partners, and in practice pretty much never applies anyways (you'd need to be trying to get a tech for which you had ~1-6 beakers remaining to discover it and would be finding it next turn; unless it was some sort of huge panic event like a sudden DoW, you'd simply finish researching that yourself to avoid incrementing the WFYABTA counter).

So that's how it figures out how much each side of the deal is worth. Then it will accept the deal if it thinks it's getting at least 10% more value than you are.
Thanks for a detailed answer. In the meantime I checked @Manco Capac thread about certain game mechanics were he mentioned a hard coded 3:2 conversion. Then adjust for the things you mentioned. Deity level 78% of my 117 beakers is 25 deduction. 2/3 is another 38 deduction. This is 54. He paid 55 but known percentage should also adjust, this time in my advantage. Just guessing.
 
Last edited:
I usually estimate that i need to offer ~30% more value.
An easy way to look at stuff would be: Machinery costs 1183:science: on deity, and AIs need only ~800:science: (but that number is ofc hidden).
If i want to trade my Machinery for their Feuda now (same cost), ~380:science: should be researched first.
Or another tech / gold added.

Sometimes i need less and sometimes more, depending on how well known that tech is already.
Figuring out exact numbers needed seems impossible :)
There are too many factors and each trade can be different, so i just go with ~30%.
For example an AI might have just finished teching something and started on your tech..now i would fall flat on my nose with any calculations, and more invested = better.
 
I usually estimate that i need to offer ~30% more value.
An easy way to look at stuff would be: Machinery costs 1183:science: on deity, and AIs need only ~800:science: (but that number is ofc hidden).
If i want to trade my Machinery for their Feuda now (same cost), ~380:science: should be researched first.
Or another tech / gold added.

Sometimes i need less and sometimes more, depending on how well known that tech is already.
Figuring out exact numbers needed seems impossible :)
There are too many factors and each trade can be different, so i just go with ~30%.
For example an AI might have just finished teching something and started on your tech..now i would fall flat on my nose with any calculations, and more invested = better.
Yeah, very practical rule of thumb. But what do you do when you’re recipient of cash in deals? Do you, like me, tediously lower the amount with short intervals in trade screen until she finally open her purse?

Edith: In the example above you had invested 77 23%. In addition AI like to pay 55-59 coins for those beakers you invested. (Btw, it’s deity).
 
Last edited:
You mean if you ask what will you give me for this, and they offer some crappy techs + some gold but you want only gold instead?

When asking for a specific tech, i think they always add their best gold offer.
 
Fun thread!

As an aside - I’ve noticed that e.g. Lain is very reluctant to pay cash for techs, often preferring less lucrative trades to get gold instead. I’m not sure I really follow why that is the case, particularly as the AI values gold highly. Can anyone explain?

Finally - this (more often) comes up for me in resource trades, where the AI keeps trying to give me sheep when I just want their money! Is there any guide for how many GPT an AI thinks a resource is worth?
 
As an aside - I’ve noticed that e.g. Lain is very reluctant to pay cash for techs, often preferring less lucrative trades to get gold instead. I’m not sure I really follow why that is the case, particularly as the AI values gold highly. Can anyone explain?
I believe that's because AIs on higher difficulties get more use out of that gold than the player will out of the tech, or at least it's a worse trade than the player selling old tech for gold. AIs on higher difficulties get much cheaper techs, much cheaper unit upgrades, cheaper maintenance, etc., so even a little gold can fling them ahead a relatively far distance.
 
Fun thread!

As an aside - I’ve noticed that e.g. Lain is very reluctant to pay cash for techs, often preferring less lucrative trades to get gold instead. I’m not sure I really follow why that is the case, particularly as the AI values gold highly. Can anyone explain?

Finally - this (more often) comes up for me in resource trades, where the AI keeps trying to give me sheep when I just want their money! Is there any guide for how many GPT an AI thinks a resource is worth?
Yeah we are all reluctant paying. The thing is, when we are entitled to cash we must demand all that are rightfully ours without spending our valuable time on that person on the other side of the table.

Of course, the opposite applies too when your bank account allows.

A formula in a spreadsheet would therefore be time saving.
 
Last edited:
"What would make this deal work" without gold should result in their best offer, if you ask with just tech vs. tech.
Unless they add some cheap tech like Archery instead, then i'm stuck with guessing amounts if they don't accept a trade for all their gold.
 
I pay gold for tech quite often.
Sometimes I pay alot of cash.
It really depends on where you are in the game.

Not sure what situation Lain was in that you mention, but I'm guessing it was a situation where the goal was to keep slider at 100% just reaching some key tech..?
 
Fun thread!

As an aside - I’ve noticed that e.g. Lain is very reluctant to pay cash for techs, often preferring less lucrative trades to get gold instead. I’m not sure I really follow why that is the case, particularly as the AI values gold highly. Can anyone explain?

Finally - this (more often) comes up for me in resource trades, where the AI keeps trying to give me sheep when I just want their money! Is there any guide for how many GPT an AI thinks a resource is worth?
Most likely cos :gold: > :science: for us, in regular games we have way more :science: multipliers like libraries, Academy etc.
Also with :gold: we get exactly what we see, while for a tech another trade might come up with other AIs.
edit: as Krikav wrote, sometimes a tech is so important thou that i just pay.

AIs always offer resources first :)
I know that # of cities matters, huge AIs will offer more :gold: for your resis cos they make more use of them.
Can see this when playing OCC i.e., we only have to pay i think 6:gold: for standard resis there. Only 1 city makes use of them.
 
Resource trades, they give their cities total population divided by 10, floored. Other limitations might apply too though.
But the most practical way to just figure out is to start high "Give me 20gpt! No...?", go low "Well, 10gpt... Yes." then in the middle "How about 15gpt?" and then wiggle abit "Ok, 10 but not 15, how about 12? Ok thats fine."
Could have gotten 13, could have gotten 14, but one has to have limits for how much to bother. :D
Same thing when selling tech for gold.

Oh, and one more obvious thing why to favour gold above tech, if you sell tech for gold you don't up the "WFYABTA"-limit.
 
The haggling approach is the one I always use, as far as I know you there is no penalty in how many times you talk to an AI in a turn, so I just start high and reduce bit by bit until I find the max they will pay.

Question
How does the fair trade value work (ie when you get +1 rep when they say your trades have been fair). Is there a way to calculate what consitiutes a fair trade?
 
Back
Top Bottom