Nonsensical AI tech trading

dylanmeditates

Warlord
Joined
May 14, 2012
Messages
260
So I have another post about tech trading. I am in this game right now where I want to trade Mansa Musa gunpowder for lots of gold and machinery. Here's what happens: I put gunpowder on my side of the table and machinery on his, and ask 'what would make this deal work?' he adds theology, his world map, and 55 gold to the trade. I take off theology and 55 gold because i don't want theology, i want all his gold. i ask him again, 'what would make this deal work?' now, he does what i want and offers machinery, world map, and all 640 of his gold for my gunpowder.

now here's where it gets interesting. i press 'sorry, we cannot accept such a deal' and then again straight to 'what would make this deal work?' and he adds military tradition to my side of the table. when i click MT away, he no longer will accept the trade that he was going to accept a few clicks ago.

if you want to try it out yourself, i have the save posted. turns out that AI trading is not just about laying out acceptable terms, it's also about the order you lay them out in, i guess... any ideas?
 

Attachments

I have not checked the code, but based on the behavior like this which I have seen there appears to be a small random factor in determining the value of what you are offering in a trade (or, equivalent in effect, the minimum profit the AI is willing to accept in the trade). If so, he may have randomly gotten an above average random value for your tech when he made the offer the first time, then a lower one the next time leading him to reject it as the value on your side was then seen as a being a smidge too low for what was on his side. If you try again a time or two he might accept.
 
I have never seen any evidence of this random value (?). I have noticed that when one side is even 1 gold too high, the AI will simply ask you for another tech. He also will never ask you for gold when you have gold on his side. If he was ok with 640 gold, and you then put 641, he would ask for another tech, rather than ask you for one gold or swap 1 gold out from himself.
Perhaps you had your world map the first time and not the second time, making him ask for another tech to (completely unreasonably) cover the value of your world map?
EDIT: I just realized I never press the sorry that deal does not work for me, so if that was the trigger for a new random value, I'd never trigger it. I just swap out whatever does not work or press exit.
 
Although buried, I recall this echo of the past: click here.

Indeed, this is an interesting subject of study. I like you constant meditations, Dylan. You don't fear to ask right questions. And way more interesting that the average agressions about best UU or best whatever-give-me-some-relativistic-opinion.

DanF5771 said:
Then there is most certainly a bug in the code:
Stalin compares the two values and if (iTheirValue > iOurValue) he puts another tech on top of the deal!!! I'm sure it should be the other way around, Suleiman should get a second tech only if one tech is not enough to cover his costs. There are further attempts to level the difference between iTheirValue and iOurValue by trading gold (iGiveGold, iReceiveGold) but the amounts are capped at the leader's AI_maxGoldTrade. {There is a minor bug in this calculation too. If Stalin is in financial trouble (his iGoldValuePercent=3) he asks for 50% less cash than if he is not (his iGoldValuePercent=2) due to iGold = ((iTheirValue - iOurValue) * 100) / iGoldValuePercent.}


Finally if (iTheirValue > (iOurValue * 3 / 4)) the deal is good and Suleiman will DoW the victim for 1 or 2 techs +- some gold.
This condition also indicates that giving a second tech if (iTheirValue > iOurValue) is unnecessary. Furthermore it shows that the bug prevents successful bribe deals when 1 tech is not enough and the instigator does not have the necessary cash to reach the 75% threshold. I personally think this should be fixed -- it might entail some more dogpile wars due to successful bribes.
 
pffttzzsschhhh ... conjured up again :D
Game thinks you're in financial trouble -- Mansa will only agree if you ask for 440 :gold: in that deal.
Set your espionage slider to 0 and try again ...
pffffloppp ...
 
pffttzzsschhhh ... conjured up again :D
Game thinks you're in financial trouble -- Mansa will only agree if you ask for 440 :gold: in that deal.
Set your espionage slider to 0 and try again ...
pffffloppp ...

played around w/ the slider and this is what i found: leaving it where it is yields the same results as before (of course...). but when i set the esp. slider to 0 (and all other sliders to 0), now this is what happens when i go through the same procedure: put gunpowder for machinery, see what he gives, take off theology and 55 gold from his side and ask 'what would make this deal work?' and he adds 640 gold, BUT NOW he doesn't ask for MT anymore.

so we can see that the AI definitely changes its trades based on your financial situation (which i have to consider 'cheating' by the AI, don't you agree? there is no way for me to see their sliders but apparently my sliders affect their decisions. those big mean AI. hmph).

but am i right that is still a bit unclear as to why the order in which i ask mansa about what he wants in the trade (when my slider is unchanged in the save posted) changes the terms he will agree to? as i describe in the OP, why will mansa agree to a certain trade, but demands more for the exact same trade a mere 3 clicks later and will no longer accept his original trade? seems... nonsensical. i wonder if there is a way to take advantage of this weird behavior? so many questions, i still don't even understand the original issue at hand, ha... yes, so many questions :)
 
Wait, adjusting my slider changes my tech trade negotiations? What?!?!? Time to go looking for a nice head shaped wall . . .
 
pffttzzsschhhh ... conjured up again :D
Game thinks you're in financial trouble -- Mansa will only agree if you ask for 440 :gold: in that deal.
Set your espionage slider to 0 and try again ...
pffffloppp ...

*network hacking*

Bzzz bzzz
Do you about peacevassal ever trying to break with the human player? Never found any code about it...
*lost bus*
 
Wait, adjusting my slider changes my tech trade negotiations? What?!?!? Time to go looking for a nice head shaped wall . . .

Looks reasonable to me.


I haven't looked at the code yet, but I guess the code makes a "for loop" (simply understand that as an iteration over N number of thing) and forgets to exclude the human player out of financial crisis calculi, which is wrong because it leads to this "bug", or better said consequence that gainsays the design intention.
I think I'll make an small article out of this.
 
pffttzzsschhhh ... conjured up again :D
Game thinks you're in financial trouble -- Mansa will only agree if you ask for 440 :gold: in that deal.
Set your espionage slider to 0 and try again ...
pffffloppp ...

Welcome back, DanF! They still talk about you around here.
 
but am i right that is still a bit unclear as to why the order in which i ask mansa about what he wants in the trade (when my slider is unchanged in the save posted) changes the terms he will agree to? as i describe in the OP, why will mansa agree to a certain trade, but demands more for the exact same trade a mere 3 clicks later and will no longer accept his original trade? seems... nonsensical. i wonder if there is a way to take advantage of this weird behavior? so many questions, i still don't even understand the original issue at hand, ha... yes, so many questions :)

Mansa has 2 ways to look at his gold:

1. from his own perspective -- "I'm Riiicchh, Biatch!" -- money means nothing, gold value 2
2. from your perspective -- poor Dylan in financial trouble -- needs every penny, gold value 3

When you put Machinery + his maps on his side of the table and Gunpowder on yours and ask him to make the deal fair, he will use his own gold value 2 to come up with the 640 :gold: as compensation.
When you ask for a sum of gold directly, he will use your perspective and gold value 3 -> you can ask for a maximum of 440 :gold: in that deal.

I don't have the game and code at hand so I cannot test it, but I suspect there are various ways to take advantage of these mechanics (buy techs from the AI for gold, fair trade diplo bonus for a cheaper price?).
Maybe Tachy can cover this in the article. :)

Do you about peacevassal ever trying to break with the human player? Never found any code about it...

sorry, no
great stuff in your personal thread :goodjob:


Welcome back, DanF! They still talk about you around here.
thanks
 
I am seeing this very similiar situation again in the same game:
1. I put my steel for wang's rifling on the trading table
2. i ask 'what would make this deal work?'
3. he adds world map and 60 gold to his side of the table
4. i click 'we cannot accept' followed by 'what would make this deal work?'
5. he says that he will not accept.

he also will not accept if you just:
1. put steel on your side of the table, and put rifling and 60 gold and world map to his side of the table.

you must ask him to make the deal and only then will he give you the best deal. MAIN POINT: somehow the AIs calculate the values of trades differently depending on the order in which you ask them to evaluate things, regardless of the actual values of what is being traded
 
I had a nonsensical tech trade in one of my latest games. I forget the exact circumstances, but it went something like this:

I bring up a tech and ask Justinian what he wants for it.
He says he wants one of my techs and 700 some gold.
I say "Sorry, we cannot accept such a deal".
I then take away the gold on my side and ask him what will make the deal work.
He now wants to give me 90 gold.

Does this make any sense?
 
@baseballpie
i've seen a number of trades like that, basically what is going on is justinian is willing to take no less than the second trade mentioned, but if you are willing to do the first trade, you will get a diplo bonus 'our trade relations have been fair and forthright' or something like that
 
I had a nonsensical tech trade in one of my latest games. I forget the exact circumstances, but it went something like this:

I bring up a tech and ask Justinian what he wants for it.
He says he wants one of my techs and 700 some gold.
I say "Sorry, we cannot accept such a deal".
I then take away the gold on my side and ask him what will make the deal work.
He now wants to give me 90 gold.

Does this make any sense?
I think the AI always tries to maximize what it can gain from a trade where you ask what it would like in exchange.

I think the "Our trading relations have always been blabla" simply comes from diplo points you get when making a deal that is significantly to the advantage of the AI (works for gifts aswell I think) [Tachy should be of some help]
 
Back
Top Bottom