I've been asked to explain the formula used by the AI to calculate the Deal Value of Strategic Resources (@saamohod). This formula could probably be improved, so feel free to suggest changes to it.
Preliminaries:
- On Standard Speed, 1 GPT always corresponds to a Deal Value of 40
- I will describe valuation from the AI perspective, so "Sell Price" refers to the price used when the AI sells a resource
- I will skip some technical details of the formula, which shouldn't have much of an effect
There are 4 steps to calculate deal valuation:
1. Base Value for a single Resource Item
Each Strategic Resource has a base Deal Value of 50, scaling by 25 per era. Or, in terms of GPT: 1.25 GPT, scaling by 0.625 GPT per Era.
2. Increase for excess GPT
Prices are increased based on the excess Gold per Turn of the paying player. The formulas:
If the AI is buying, prices are increased by: sqrt((excess GPT of AI player)/4)*5
If the AI is selling, prices are increased by: sqrt((excess GPT of Human player)/5)*5
The value added can not exceed the Base Value.
3. Modifiers
Prices are multiplied by some modifiers:
Uranium Resource:
Buy and Sell Price: *2
Human Player has a stronger military than the AI:
Sell Price: *1.45
Buy Price: *0.8
The players are neighbors:
Sell Price: *1.1
Buy Price: *0.7
AI is going for a Science win:
Sell Price Aluminum: always NA
Buy Price Aluminum: *1.25
Some Modifiers for Netherlands [skipped]
Resource Ratio:
Sell Price increased if the AI has less total Resources of that type than we have, and vice versa
Buy Price increased if the AI has more total Resources of that type than we have, and vice versa (why is that? the AI pays more if it already has a lot?...)
Sell/Buy price are multiplied with the ratio of the number of resources, lower bound *0.5, upper bound *1.25 (buying) or *2 (selling)
Modifiers based on AI opinion
For example: Friendly approach:
Sell Price: *0.9
Buy Price: *1.1
4. Valuation for each Resource Entity in the Deal
For each entity of the resource in the deal, the value calculated in steps 1-3 is modified based on the amount of excess resources the AI would have after buying/selling it.
AI Buying:
AI Selling:
Example:
Industrial, Turn 257, abundant Resource settings, I'm trading with Theodora.
For 3 Horses, Theodora offers me a Deal Value of 294 (8 GPT).
Let's follow through the steps of how this value is calculated:
For each Horse Item, we therefore have a value of 140. Theodora currently has 1 excess Horse, so the 3 Horses added would be number 2, 3, and 4. Following the table in Section 4, the deal values for these items are multiplied by 0.85, 0.7, and 0.55.
The total resource valuation is therefore 140*(0.85+0.7+0.55) = 294, which corresponds to 8 GPT (rounded up).
If I wanted to buy 3 Iron from Theodora, the Deal Value would be 1,575 (40 GPT).
Theodora currently has 24 excess Iron, the 3 Iron sold would leave her with 23, 22, 21 after the deal. As she still has much excess Iron left, she doesn't ask for higher prices, the modifiers are 1, 1, and 1.
In total: Deal Value of 525*(1+1+1) = 1575, or 40 GPT (rounded up)
Preliminaries:
- On Standard Speed, 1 GPT always corresponds to a Deal Value of 40
- I will describe valuation from the AI perspective, so "Sell Price" refers to the price used when the AI sells a resource
- I will skip some technical details of the formula, which shouldn't have much of an effect
There are 4 steps to calculate deal valuation:
1. Base Value for a single Resource Item
Spoiler :
Each Strategic Resource has a base Deal Value of 50, scaling by 25 per era. Or, in terms of GPT: 1.25 GPT, scaling by 0.625 GPT per Era.
Era | Ancient | Classical | Medieval | Renaissance | Industrial | Modern | Atomic | Information |
---|---|---|---|---|---|---|---|---|
Deal Value | 50 | 75 | 100 | 125 | 150 | 175 | 200 | 225 |
GPT | 1.25 | 1.875 | 2.5 | 3.125 | 3.75 | 4.375 | 5 | 5.625 |
2. Increase for excess GPT
Spoiler :
Prices are increased based on the excess Gold per Turn of the paying player. The formulas:
If the AI is buying, prices are increased by: sqrt((excess GPT of AI player)/4)*5
Excess GPT of AI Player | 10 | 50 | 100 | 200 | 500 | 750 | 1000 |
---|---|---|---|---|---|---|---|
Deal Value | 8 | 18 | 25 | 35 | 56 | 68 | 80 |
GPT | 0.2 | 0.45 | 0.63 | 0.88 | 1.40 | 1.71 | 1.97 |
If the AI is selling, prices are increased by: sqrt((excess GPT of Human player)/5)*5
Excess GPT of Human Player | 10 | 50 | 100 | 200 | 500 | 750 | 1000 |
---|---|---|---|---|---|---|---|
Deal Value | 7 | 16 | 22 | 32 | 50 | 61 | 70 |
GPT | 0.18 | 0.4 | 0.56 | 0.79 | 1.25 | 1.53 | 1.76 |
The value added can not exceed the Base Value.
3. Modifiers
Spoiler :
Prices are multiplied by some modifiers:
Uranium Resource:
Buy and Sell Price: *2
Human Player has a stronger military than the AI:
Sell Price: *1.45
Buy Price: *0.8
The players are neighbors:
Sell Price: *1.1
Buy Price: *0.7
AI is going for a Science win:
Sell Price Aluminum: always NA
Buy Price Aluminum: *1.25
Some Modifiers for Netherlands [skipped]
Resource Ratio:
Sell Price increased if the AI has less total Resources of that type than we have, and vice versa
Buy Price increased if the AI has more total Resources of that type than we have, and vice versa (why is that? the AI pays more if it already has a lot?...)
Sell/Buy price are multiplied with the ratio of the number of resources, lower bound *0.5, upper bound *1.25 (buying) or *2 (selling)
Modifiers based on AI opinion
For example: Friendly approach:
Sell Price: *0.9
Buy Price: *1.1
4. Valuation for each Resource Entity in the Deal
Spoiler :
For each entity of the resource in the deal, the value calculated in steps 1-3 is modified based on the amount of excess resources the AI would have after buying/selling it.
AI Buying:
Excess Amount of Res. after the deal | -1 | 0 | 1 | 2 | 3 | 4 | 5+ |
---|---|---|---|---|---|---|---|
Modifier | 1.5 | 1.5 | 1 | 0.85 | 0.7 | 0.55 | 0 |
AI Selling:
Excess Amount of Res. after the deal | 0 | 1 | 2 | 3+ |
---|---|---|---|---|
Modifier | NA | 10 | 10 | 1 |
Example:
Spoiler :
Industrial, Turn 257, abundant Resource settings, I'm trading with Theodora.
For 3 Horses, Theodora offers me a Deal Value of 294 (8 GPT).
Let's follow through the steps of how this value is calculated:
Step | Deal Value | GPT | Comments |
---|---|---|---|
1. Base Value | 150 | 3.75 | Industrial Era |
2. Adjustment for excess GPT | 160 | 4 | Theoroda has only 26 excess GPT, so she's not willing to pay much |
3. Military Might | 125 | 3.125 | Theodora is weaker than me, so she pays less to not support me even further |
3. Resource Ratio | 130 | 3.25 | Theodora has 31 Horses in total, I have 29, so Theodora is willing to pay a bit more |
3. Approach | 140 | 3.5 | We are friends, so I get favorable trade offers |
For each Horse Item, we therefore have a value of 140. Theodora currently has 1 excess Horse, so the 3 Horses added would be number 2, 3, and 4. Following the table in Section 4, the deal values for these items are multiplied by 0.85, 0.7, and 0.55.
The total resource valuation is therefore 140*(0.85+0.7+0.55) = 294, which corresponds to 8 GPT (rounded up).
If I wanted to buy 3 Iron from Theodora, the Deal Value would be 1,575 (40 GPT).
Step | Deal Value | GPT | Comments |
---|---|---|---|
1. Base Value | 150 | 3.75 | Industrial Era |
2. Adjustment for excess GPT | 225 | 5.625 | I have 845 excess GPT, so I have to pay much more for everything |
3. Military Might | 320 | 8 | Theodora is weaker than me, so she doesn't want to sell strategic resources at a low price to me |
3. Resource Ratio | 585 | 14.625 | I have 108 Iron in total, Theodory only 59, so the selling price is modified by 108/59 = 1.83 |
3. Approach | 525 | 13.125 | We are friends, so I get favorable trade offers |
Theodora currently has 24 excess Iron, the 3 Iron sold would leave her with 23, 22, 21 after the deal. As she still has much excess Iron left, she doesn't ask for higher prices, the modifiers are 1, 1, and 1.
In total: Deal Value of 525*(1+1+1) = 1575, or 40 GPT (rounded up)
Last edited: