1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Nonsensical AI tech trading

Discussion in 'Civ4 - General Discussions' started by dylanmeditates, May 23, 2013.

  1. dylanmeditates

    dylanmeditates Chieftain

    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?
     

    Attached Files:

  2. God-Emperor

    God-Emperor Chieftain

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    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.
     
  3. traius

    traius His own worst enemy

    Joined:
    May 27, 2012
    Messages:
    938
    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.
     
  4. Manco Capac

    Manco Capac Friday,13 June,I Collapse

    Joined:
    Mar 1, 2010
    Messages:
    8,051
    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.

     
  5. DanF5771

    DanF5771 Chieftain

    Joined:
    Feb 21, 2008
    Messages:
    1,194
    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 ...
     
  6. traius

    traius His own worst enemy

    Joined:
    May 27, 2012
    Messages:
    938
    Tachy teaches me all the time :)
     
  7. dylanmeditates

    dylanmeditates Chieftain

    Joined:
    May 14, 2012
    Messages:
    260
    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 :)
     
  8. Mec AntiKythera

    Mec AntiKythera Chieftain

    Joined:
    Sep 24, 2010
    Messages:
    980
    Wait, adjusting my slider changes my tech trade negotiations? What?!?!? Time to go looking for a nice head shaped wall . . .
     
  9. Manco Capac

    Manco Capac Friday,13 June,I Collapse

    Joined:
    Mar 1, 2010
    Messages:
    8,051
    *network hacking*

    Bzzz bzzz
    Do you about peacevassal ever trying to break with the human player? Never found any code about it...
    *lost bus*
     
  10. Manco Capac

    Manco Capac Friday,13 June,I Collapse

    Joined:
    Mar 1, 2010
    Messages:
    8,051
    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.
     
  11. dylanmeditates

    dylanmeditates Chieftain

    Joined:
    May 14, 2012
    Messages:
    260
    so considering everything we've seen here... can it suffice to say simply that if you put your gold slider to 100 before you go into negotiations, you will be getting the best deal possible from the AI?
     
  12. Ataxerxes

    Ataxerxes Chieftain

    Joined:
    Jul 29, 2009
    Messages:
    3,073
    Welcome back, DanF! They still talk about you around here.
     
  13. DanF5771

    DanF5771 Chieftain

    Joined:
    Feb 21, 2008
    Messages:
    1,194
    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. :)

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


    thanks
     
  14. dylanmeditates

    dylanmeditates Chieftain

    Joined:
    May 14, 2012
    Messages:
    260
    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
     
  15. baseballpie

    baseballpie Chieftain

    Joined:
    Nov 13, 2012
    Messages:
    2,090
    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?
     
  16. dylanmeditates

    dylanmeditates Chieftain

    Joined:
    May 14, 2012
    Messages:
    260
    @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
     
  17. pomthom

    pomthom Drive & Reverb

    Joined:
    Dec 6, 2012
    Messages:
    1,587
    Location:
    Goodbye Paris, good morning London
    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]
     

Share This Page