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

On AI valuation of strategic resources.

Discussion in 'Community Patch Project' started by JamesNinelives, Dec 13, 2020.

?

How much should the AI value one unit of a strategic resource at?

  1. 0-1 gpt

    2 vote(s)
    8.3%
  2. 1-2 gpt

    7 vote(s)
    29.2%
  3. 2-3 gpt

    3 vote(s)
    12.5%
  4. 3-5 gpt

    6 vote(s)
    25.0%
  5. 5-7 gpt

    3 vote(s)
    12.5%
  6. 7-10 gpt

    2 vote(s)
    8.3%
  7. 10+ gpt

    2 vote(s)
    8.3%
  8. other (please state in comments)

    8 vote(s)
    33.3%
Multiple votes are allowed.
  1. JamesNinelives

    JamesNinelives Emperor

    Joined:
    Mar 16, 2019
    Messages:
    1,577
    Gender:
    Male
    Location:
    Australia
    I wanted to bring this up because it seems very difficult to perfect. What I would like to do here is discuss what an ideal outcome would look like to give a frame of reference for further discussion.

    I not asking for a single value that applies for all resources or all situations, simply the values which seem most reasonable if we had to establish some middle ground. I have allowed people to choose more than one answer, so you may select multiple responses if you feel they are appropriate.

    I chose gold per turn rather than lump sum gold because I am hoping that is more consistent across different game speeds.
     
    Last edited: Dec 13, 2020
  2. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    7,310
    Location:
    Malaga (Spain)
    I think the offer should account the money both players handle. Right now it accounts only for the money of one of them. That's why the offer is so difficult to please the human player.
    A 5-15% of my base income should be good enough for one strategic that I have none.
     
  3. usadefcon1

    usadefcon1 Warlord

    Joined:
    Sep 24, 2016
    Messages:
    165
    Depends on the era,
    I'd say 2-4 gpt in Ancient
    3-5 Classical
    4-6 Medieval
    5-7 Renaissance
    Etc...
     
  4. Kim Dong Un

    Kim Dong Un The One & Unly Supporter

    Joined:
    Dec 17, 2017
    Messages:
    818
    Gender:
    Male
    Location:
    Pyongyang
    Yeah, the conversation wasn't necessarily discussing strategics in this post, but I still think it could be used as a general baseline for most trade items/deals.
     
  5. JamesNinelives

    JamesNinelives Emperor

    Joined:
    Mar 16, 2019
    Messages:
    1,577
    Gender:
    Male
    Location:
    Australia
    The challenge there is that the more variables we add, the more complex fine-tuning the equation becomes.
    I agree the value should vary over time. Perhaps I should have specified an era to use as a baseline.
     
  6. azum4roll

    azum4roll Emperor

    Joined:
    Jul 17, 2018
    Messages:
    1,325
    Gender:
    Male
    First, the buyer should evaluate how much they need the strategic resource. Each copy they buy should be evaluated separately, with the second copy evaluated based on already having the first copy, etc. This is the base value of the trade perceived by the buyer. It should range from 0 for already having enough of that strategic resource (extra copies have no value!!) to 5gpt (we really want to train a legion right now to conquer England and we have 0 iron left) in Ancient-Classical, which should scale with era in a reasonable way (non-linear, maybe era^power with a power somewhere near 1.5 - it doesn't need to be clear and transparent since it's all internal and the value will be further modified anyway). Then, the value should be modified depending on how much the buyer likes the seller (worth more with a better relationship). It should not depend on the buyer's current income - if we can't afford it we won't send the offer. Also increased if we're William and seller loses monopoly/buyer gains monopoly from it.

    The selling side should go through a similar process. The base value should range from 2gpt (we have excess copies but we still want to gain some money from them) to infinite (we really need those resources right now!!), scaling with era in the same way as above. Then it's modified by the relationship between buyer and seller (worth more with a worse relationship). Also increased if trading with William and seller loses monopoly/buyer gains monopoly from it.

    General trade value suggestions:
    • Trades should only go through if both parties agree to it, but it's normal that each party perceives a different value for the same goods and no trade happens.
    • Buyer should never allow a trade value more than what they want to pay, and seller should never allow a trade value less than what they want to receive.
    • When trading with a human, the value shown should be the threshold in how much the AI wants to pay/receive for the trade. The human should not be able to pay less or receive more than that value.
    • In AI trades, when buyer value is higher than seller value, maybe the actual trade value can be the average of them? And both parties can get the same trade opinion bonus.
     
    Last edited: Dec 14, 2020
  7. ilteroi

    ilteroi Prince

    Joined:
    Mar 11, 2006
    Messages:
    370
    note that there already is quite a bit of logic in place. AI evaluates era, flavor, diplo stance, available gpt, amount of resources etc.

    also there is a bugfix for overly high valuation in the pipeline. so what is wrong?
     
    vyyt and JamesNinelives like this.
  8. azum4roll

    azum4roll Emperor

    Joined:
    Jul 17, 2018
    Messages:
    1,325
    Gender:
    Male
    Just saying that expected trade value should not depend on available gpt for either party. No gpt = no trade, not making it cheaper. Having a high income doesn't mean you should pay 50% of it to bribe someone to declare war either. That should make it simpler and less exploitable.

    And this thread aims to find a balanced value for strategic resources.
     
    JamesNinelives likes this.
  9. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    7,310
    Location:
    Malaga (Spain)
    I took a look at the logic there (Recursive brought it up in one of his posts) and the only thing I miss is evaluation of the income for both seller and buyer. If the ai does not consider the economic strength of his trader, it will only make offers that appeal to the proponent, thus failing to close deals since they are not liked by the other part.
    Iirc, the code makes the ai to send the offer to where it profits best.
    So, it should first try to sell the resources to trade partners that are both liked and have big money to expend, since this way the seller will benefit most. Why don't sell more expensive stuff if they can?
    Spare cash should be considered too, not just income, since there are playstyles with many instant gold yields with apparent low income, but then they are rich.
     
    Kim Dong Un and DukeBrani like this.
  10. azum4roll

    azum4roll Emperor

    Joined:
    Jul 17, 2018
    Messages:
    1,325
    Gender:
    Male
    AIs should be already evaluating all possible trade partners every turn when they want to buy/sell something, and pick the highest/lowest valued one that will go through. I don't know if they should ask for human player's opinion first though, since that's a bit unfair whether they do or not, AND human players tend to change the deal completely to something else (at least I do).
     
  11. JamesNinelives

    JamesNinelives Emperor

    Joined:
    Mar 16, 2019
    Messages:
    1,577
    Gender:
    Male
    Location:
    Australia
    This thread isn't about changing things, it's just about having a reference for what we want the outcome to be. I've noticed that we do change this aspect of the game fairly often, and I remember Gazebo expressing some frustration at people saying 'too high' and then 'too low' when it gets fixed. So I wanted to get an idea of what 'just right' would actually look like.
     
  12. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    7,310
    Location:
    Malaga (Spain)
    And I've given you my opinion on why it is so hard to find the right values. With the current method you either have wrong values at the beginning or at the end.
     
    XSamatan likes this.
  13. JamesNinelives

    JamesNinelives Emperor

    Joined:
    Mar 16, 2019
    Messages:
    1,577
    Gender:
    Male
    Location:
    Australia
    To be honest I think to an extent it's going to be difficult to find a balance where we don't have the wrong values at some point. There are so many variables that getting them all right is quite a task.
     
  14. Legen

    Legen King

    Joined:
    Sep 13, 2015
    Messages:
    830
    The value of strategics in practice is as follows:

    - Am I a warmonger AI? High prices.
    - Am I neighboring a warmonger? High prices.
    - Is my UU available (or about to) and it requires that strategic? High prices.

    I noticed strategics having varying values over time due to the presence of a warmonger, and especially when related unique units are coming into play. I'm ok with the AI paying a lot for strategics for any of the three reasons above.
     
  15. stii

    stii King

    Joined:
    Oct 3, 2010
    Messages:
    630
    I think it is just impossible, because it has to work buying and selling. And a human can take such advantage of even slight mistakes in the AI valuing things.

    Early on you can make a huge amount of money selling things to the AI they probably don't really need. But it only probably because sometimes they do want iron/horse. Most of the time a human doesn't really want any resources but when you do it is a pain and you'd be willing to pay a lot more. So having an AI act like that is going to be really tough. A DoF really amplifies this too to the point where it might be an exploit.
     
    Kim Dong Un and JamesNinelives like this.
  16. azum4roll

    azum4roll Emperor

    Joined:
    Jul 17, 2018
    Messages:
    1,325
    Gender:
    Male
    Deals have always been exploitable. You can always sell a luxury to a 100% happy AI, or a strategic resource to an AI with 40 excess. You can always pay 1 less gpt than suggested to buy something off an AI. You can make your own deals to an AI during their turn, when they try to approach you to propose their own deal. AIs are always willing to accept an embassy trade early game, despite city states might offer them a quest to discover your borders. You can hold off making peace with a city state and an AI will likely pay you to do so. I feel like the whole thing needs an overhaul.
     
  17. JamesNinelives

    JamesNinelives Emperor

    Joined:
    Mar 16, 2019
    Messages:
    1,577
    Gender:
    Male
    Location:
    Australia
    That would involve a lot of work and honestly I'm not sure it's possible to make trade entirely exploit-proof. There are many aspects of the game where if a human chooses to they can cheese a win. To a degree I think we need to be willing to accept that we may not get a perfect result in the end. Perhaps what we should be looking for is something that is 'less exploitable' rather than 100%. E.g is if better to err on the side of low prices where the player can buy resources easily than to err on the high side where the player can make a lot of money easily?
     
    stii likes this.
  18. azum4roll

    azum4roll Emperor

    Joined:
    Jul 17, 2018
    Messages:
    1,325
    Gender:
    Male
    High price is not a problem when it's justified. We just need the AI to know when they absolutely need a resource (high price) and when they absolutely don't need one (zero price, not low).
     
  19. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    7,241
    Generally I am fine with a simple 1 gpt valuation. If I have extra resources, I feel fine to sell them for that price. It’s the 2,3,4 horses for 1 gpt that bother me.
     
    JamesNinelives likes this.
  20. tommytoxen

    tommytoxen Warlord

    Joined:
    May 7, 2012
    Messages:
    227
    Gender:
    Male
    Location:
    worksop
    i think it should be based on scarcity of the resource and how badly the civ wants it. though not sure how realistic that is to calculate.

    honestly in my games if they offer me too little for a resource that's quite scarce i'll decline and keep it for myself, they can just make do without they're only spiting themselves if they don't pay up for it.

    but if i have an abundance of a resource and don't really need it i'll give it to civs that i like/are friends for cheap. heck i often give it away for free to allies if i wanna prop them up a little, like if they're a buffer between me and a powerful enemy.
     
    JamesNinelives likes this.

Share This Page