Luxury / Strategic Resource Valuation

aandrzej

Chieftain
Joined
Jan 11, 2021
Messages
10
Not sure if that should go here but i find it strange that enemy AI can open borders to me for 1 gold per turn but i don't have to open borders for them. That looks unrealistic when it comes to religious fights i think.
 

Zuizgond

King
Joined
Oct 24, 2016
Messages
694
Not sure if that should go here but i find it strange that enemy AI can open borders to me for 1 gold per turn but i don't have to open borders for them. That looks unrealistic when it comes to religious fights i think.
Fully agree with this. At some point of the game (I think that's when they start thinking I am winning) if I want to give open borders to a friendly AI it says 'impossible' but I can get open borders from him for 1 gpt.
 

azum4roll

Emperor
Joined
Jul 17, 2018
Messages
1,939
They don't want your open borders if you're Popular+ against them in CV progress.

STEP 4: Last Few Copies Bonus
Tally up the amount the AI has of this resource, INCLUDING imports and SUBTRACTING exports (this can be higher than the amount listed in the trade screen).
- If after the trade the AI would have none of this resource left, return IMPOSSIBLE!
- If after the trade the AI would have 1 or 2 of this resource left, multiply value by 10.

This and the Diminishing Returns from the buying part should be considering each resource and valuing each instead of the whole deal at once. And instead of checking existing deals for diminishing returns, they should check (current amount they have - amount they're using),
INCLUDING imports and SUBTRACTING exports. If this number is too high just return 0 for any excess strategic resource.

Example: buyer AI has 2 excess iron. They should buy 1 iron for 70, 2 iron for 130, 3+ iron also for 130 since they don't need more than 4 excess.

(Buying Luxuries) STEP 7: Comparative Resource Happiness
- Count the amount of Happiness each player is gaining from resources.
- If seller has more resource happiness than AI (or an equal amount), multiply value by 11 and divide by 10.
- If AI has more resource happiness than seller, multiply value by 10 and divide by 11.
I don't think this part is needed. Happiness is not a competition.
Instead check AI's happiness only and value the luxury much cheaper (down to something like 5% or even 0) if AI doesn't need the happiness from the luxury, and the luxury isn't needed for CS quest or WLTKD. Getting a luxury for free isn't always a good thing, as it may shift CS quest/WLTKD requirements to something harder to obtain.

Netherlands:
I think we should simplify the checks.

Buying strategic resource: Value the exact copy of a resource higher if buying it would have given them a monopoly. All other copies don't need to be checked.

Buying luxury resource: Value a luxury resource higher if
1. they haven't already imported the resource from a major civ (should be worth at least 3 :c5gold: + 3 :c5culture: per turn), or
2. importing this copy of resource gives them a monopoly. This check should only be done to a pure tile yield monopoly if
2a. They have a copy of this resource within working distance, or
2b. They have the Corporation tech, haven't founded a corporation, AND (the score of this corporation is higher than the current planned one OR they don't have access to any corporation)
Selling luxury resource: Value a luxury resource higher if they haven't already exported the resource to a major civ.

On actual deal value:
AI vs human: AI should always offer the lowest value when selling and highest value when buying.
AI vs AI: They should accept the deal at the average of selling and buying price, giving both parties an equal diplomatic opinion bonus.
Of course, this could already be how it works right now...
 

Zuizgond

King
Joined
Oct 24, 2016
Messages
694
They don't want your open borders if you're Popular+ against them in CV progress.

Ok but this doesn't make sense. They don't want OUR open borders but they are ok to give us THEIR open borders for 1 or 2 gpt. It should be the opposite.
 

Dimmy

Chieftain
Joined
Oct 2, 2016
Messages
97
All in all, for strategic ressources and open borders the AI shouldn't bother the human player and the latter should be pro-active on these matters. For me these are pocket change for deals at best unless my random setup selected small strategic ressources and/or scarce. That should put their value up.
For the rest like declaring wars / asking for peace, resolutions etc it should be kept the same as per now.
 

Rekk

Emperor
Joined
Dec 9, 2017
Messages
1,638
Ok but this doesn't make sense. They don't want OUR open borders but they are ok to give us THEIR open borders for 1 or 2 gpt. It should be the opposite.
Sure it does. You get a bonus to tourism if you give your Open Borders. The AI wants to lower your tourism against them, and is still willing to increase their tourism against you.
 

Recursive

Already Looping
Moderator
Joined
Dec 19, 2017
Messages
3,163
Let's keep the thread on topic, please. This is not about Open Borders or the interval at which deals are offered, it's about the actual price at which the AI values the trades for Strategic and Luxury Resources.

The offer interval will be addressed later.
 

Zanteogo

King
Joined
Nov 13, 2015
Messages
946
STEP 5: Sneak Attack
If AI is planning to sneak attack the seller, divide the value by 2.

Could it allow the player to suspect a sneak attack?

This is a single player game. Don't make the AI worse at making deals because some people want to exploit the game.

I am sorry if this is harsh, but the order of importance should be:

a) Does the change make the game more fun?
b) Does the change allow the game to "work" better?
c) Does the change allow a human to exploit it?

Also the exploit is realistic. In real life, if a country is about to sneak attack another, it's not about to sell a ton of arms to a country it's about to attack for cheap, if it's going to sell them at all it's going to sell them at a massive amount.

It's also something human players DO TO THE AI NOW. If I plan on attacking someone, I'm not selling them stuff so they can build an army. Why should the AI be any different?
 

azum4roll

Emperor
Joined
Jul 17, 2018
Messages
1,939
A full proposal for luxury valuation

When luxury is not needed (for WLTKD or CS quest) and civ is happy, a new lux is only worth 2-3 global happiness = 2-3 golden age points and 2% growth in 2-3 cities, at the cost of potentially making future luxury requests more difficult compared to buying the lux when needed. The aim of this rework is to only let required luxury trades go through at a reasonable price, and unneeded trades rejected due to low price AND the potential of a high price if the seller waits.

Buy Value
If banned, IMPOSSIBLE

Base value: 0

Religion bonus: +1GPT for every 2 yields that would be given by importing the luxury. Science, culture and faith count double.

Everything under this scales with era.

We're unhappy!
- below 50%: -25% growth and -25% unit production. This is more than what a WLTKD can give, +4GPT
- below 35%: -75% growth and -75% unit production, plus barbarians and city revolutions. +8GPT
- below 20%: -100% growth and -75% unit production, plus more barbarians and faster city revolutions. How did we end up here? +15GPT
- at war or planning war: this is more serious; we may lose the war due to this. +3GPT on top of the above

WLTKD: +25% growth, plus extra bonuses from traits, policies, wonders, or buildings. +1GPT per 10% yields given by the WLTKD, determined per city. If not possible, just give a fixed extra value if we have access to one or more of the above extra bonuses, multiplied by the number of cities requiring the resource. Growth is not counted if we're unhappy.

CS quest: +X influence, +Y gold. The easy way is to give it a value of +Y gold, and extra value from the influence depending on diplomatic flavour.

We're the Netherlands:
1. Check the Trait_YieldFromImport table. If we have a trait that benefits from importing luxury resources and we haven't imported this one, add the total value divided by 2 as GPT. Science and Culture are worth double.
2. Our trait has ImportsCountTowardsMonopolies = true, and importing this copy of the luxury gives us the monopoly.
2a. The monopoly gives percentage yields or golden age length. +8GPT, this is well worth it.
2b. The monopoly gives yields on the resource tile. +1GPT per copy of this resource within working distance.
2c. +10GPT if we have the Corporation tech, haven't founded a corporation, AND (the score of this corporation is higher than the current planned one OR we don't have access to any corporation)

Approach multipliers: unchanged

GPT surcharge: +floor(0.5*sqrt(our GPT)), NOT scaled with era, capped at 20% of the value calculated above.

Sell Value
If banned, IMPOSSIBLE
If it will result in unhappy (because it's the last copy and we're at the threshold already), IMPOSSIBLE

Base value: (2 + era)GPT
We should sell to the Goddess of Festivals player in the first two eras, but stop doing so in Medieval.

Last copy: This is the complicated part. The lost golden age points and growth in cities are negligible, but this resource will be impossible to obtain (for the purpose of WLTKD and CS quests) until one of the deals with this resource ends. This potential loss is more probable if we already own/imported more luxury resources, and reaches 100% if we currently own all resources in the world (cities will immediately ask for that very resource if they're not in WLTKD). Good thing we can always overvalue the resource.

WLTKD value in all cities (W): +1GPT per 10% yields given by the WLTKD, determined per city. If not possible, just give a fixed extra value if we have access to one or more of the extra bonuses, multiplied by the number of cities we own. This value scales with era.
Probability of each city asking for the sold resource (P): number of resources we own or imported / number of resources in the world
Number of times each city will ask for a resource (n): Shortest deal duration / WLTKD duration. For example, if one of the deals of us selling this resource is due to end in 3 turns, n = 3/20.

Final added value = W * (1 - ((1 - P) ^ n))
This can be slow since we're talking about using an uncachable pow(double, double) per last copy resource per civ. A very bad overvaluation would be W * min(1, P * n).

We're the Netherlands: Check the Trait_YieldFromExport table. If we have a trait that benefits from exporting luxury resources and we haven't exported this one, subtract the total value divided by 2 as GPT, scaling with era. Science and Culture are worth double. This can make the value go below 0. In that case, set the value to 0 and skip the subsequent calculations.

Approach multipliers: unchanged

GPT surcharge: +floor(0.5*sqrt(their GPT)), NOT scaled with era, capped at 20% of the value calculated above.

Deal AI
Go through every player by order of approach (friendly first, hostile last).
If there's a resource we want:
- if it's from an AI, complete the trade at price of (sell value - buy value) / 2 if sell value > buy value.
- if it's from a human and buy value > 1GPT scaled with era, send a trade proposal priced at buy value.
Others (open borders, votes trading etc.) can stay how it currently works, except:
- don't approach a human if they rejected our last proposal of the same type within 10 turns.
 
Top Bottom