# My personal thread: Clarification of certain game mechanics

Discussion in 'Civ4 - Strategy & Tips' started by Manco Capac, Jun 16, 2012.

1. ### SeraielChieftain

Joined:
Sep 6, 2011
Messages:
7,954
Gender:
Male
Look "Replay #4" for the real formula but Espionage / 10 = Hammers is quite accurate for most cases. According to that, Peter has 200 in something.

2. ### GhpstageChieftain

Joined:
Jan 15, 2009
Messages:
2,944
Location:
Bristol, England
In general how often is that rule of thumb reasonably accurate? Theres such a number of modifiers involved like -20% for trade routes, -20% or even -40% for shared religion, espionage spending etc etc I can't see it being very accurate unless its for typical conditions (assuming a nearby neighbour and trade route discount at least).

Even Tachys post in the thread you mentioned doesn't go into it in full detail!

3. ### soundjataBe like water

Joined:
Jun 3, 2011
Messages:
1,664
I think it's more than 200. Because when building a settler, the cost goes up to 400~450 so I assume it's a factor of 5.
Or maybe I'm assuming wrongly a proportionality here?

4. ### Manco CapacFriday,13 June,I Collapse

Joined:
Mar 1, 2010
Messages:
8,051
Excellent, I have staff to take care of the business while I strike.
Sadly, I won't give a penny for ya work.

I don't know about Nukie's reference, but the practical formula I use (and is simply a math. simplification of the original) is:

SabotageProduction*((EspionageByAIOntoYou+100)/(3*InvestigateCity)

That gives the perfect value once rounded. If to evaluate wonders, don't ever forget wonders are as costly for the AI as for the human, but gets the discount per era. Something like -5% on deity (deity deity deity DIETY baby),-4% on IMM, -3% on EMP and so on until 0% I guess, but I care less on lower levels. Cumulative per new eras of course for a max of 6 levels of cumulation (a reason why the AI's tech so fast at the end of the game with a crazy -30% of discount).

5. ### Doshinjolly yellow giant

Joined:
Apr 24, 2003
Messages:
4,470
Location:
Terra
He has 301 invested in the current build.

Easier formula for the lazy:

(Sabotage Production / Influence Civics) * 100

6. ### soundjataBe like water

Joined:
Jun 3, 2011
Messages:
1,664
Glee!

I can wait a few more turns for moRe h.a....

7. ### LennierChieftain

Joined:
Mar 10, 2013
Messages:
1,194
Gender:
Male
Location:
Orange County, NY
Thanks, Ghpstage. I guess Tachywaxon wasn't my only hope.

8. ### GhpstageChieftain

Joined:
Jan 15, 2009
Messages:
2,944
Location:
Bristol, England
Now thats useful .
Thinking about it, has there ever been an article on how to gather useful info like this from the espionage screen?

Now, as I do want to see some kind of complete theory of AI trade valuation (Basically the reducing of AI trade to AI trade credits, the base values the AI works off), which, when combined with stuff people have found previously, including tonnes of stuff found by Tachy would pretty much complete our knowledge of AI trading, i'll resurrect the part of the work Tachy started in post 104.

So far Tachy dealt with this one

Which I do have a question about Tachy!
When I tried this using WB, at Emperor/normal/standard, but with Saladin as the AI, he asked for 65 gold to buy Agriculture from him, what kind of factors could have lead to this?
Even calculating using the 89 cost for agriculture at Emp doesn't quite make up the difference, only giving 59.33.

EDIT - Actually, while I have to test it when I get time, I think its because the AI knew me

But beyond that we're left with these
Spoiler :

Hopefully I can get some of the easier ones out of the way, or started at least!

Starting with TRADE_GOLD: AI_goldTradeValuePercent() , which is in CVPlayerAI, and i'm sure someone has already solved this on this forum as i've seen the 3 and 2 values banded around a lot, but a search turned up nothing. EDIT - Actually Tachy looked at this code here but for a different purpose.
Spoiler :
This is just 200, or 300 if the AI is in financial trouble, when used in any trade considerations it'll be divided by 100 to get 2 or 3 AI trade credits per gold.

Next TRADE_GOLD_PER_TURN: AI_goldPerTurnTradeVal(), still in CVPlayerAI again i'm sure someones done this before but no clue where
Spoiler :
This is an easy follow up that uses the previous AI_goldTradeValuePercent
Its simplifies to GPT * 20, or GPT * 30 if the AI is in financial trouble.
Neither of the above 2 have any situations that would result in AI denial, which is obvious when you think about it but I thought I may as well mention.

Just in case anyone wants t dive in, that leaves the followng in CVPlayerAI,
Spoiler :

Unfortunately several of these like resources, religion and civics look reasonable at first, but call up pretty long functions like AI_BonusVal and AI_civicValue that are just plain nasty.

The others
Spoiler :

Are from CVTeamAI, along with some that weren't mentioned like,
AI_openBordersTradeVal() that seem to be of interest only in that they are above the relevant DenialTypes, and in that they have a tiny fuction for a value, even if, as we know from ingame, is never used as they cannot be traded for anything else.
Spoiler :
I'm not sure exactly what 'plot' means in this case, as I know it isn't simply a tile when applied to unit ranges and the sort. But I think i'll go out on a limb and claim this says that a maps value is (0.5 * the number of land tiles uncovered) + (0.1 * the number of water tiles uncovered) all divided by 2 if bought from a vassal.
Just puts a minimum 'price' on a map, DIPLOMACY_VALUE_REMAINDER is 10 AI trade credits for all(?) AIs, and as each gold is worth 2 when not in financial trouble you get 10/2 = 5.
I don't think i've ever seen it go to 3 as would be expected for AIs in financial trouble, but a post Tachy made earlier suggests it does happen.

There are no special denial triggers for map trades, its just the standard worst enemy and AI XML attitude, of which one or two are very high.
Also, I suspect the 5:1 value ratio between land and sea may also account for water heavy maps you always seem to get from huts.trigger.MapRefuseAttitudeThreshold

Think i'll leave it at that for now, but
looks interesting due to
Making it more expensive to bribe an AI who has nukes into a war, and that there would even be a value about declaring on someone else who has nukes as the DenialTypes that follow this forbid it...
Spoiler :

New to do list
Spoiler :

9. ### GhpstageChieftain

Joined:
Jan 15, 2009
Messages:
2,944
Location:
Bristol, England
This is interesting, especially when combined by what I found in the code.
Spoiler :

Spoiler :

AIs seem to value per turn trades as a lump sum of value*time where time is always 10.
Unless theres something else to take into account then it means begging for a resource or GPT is effectively stealing 9 turns of value from an AI
This may also explain why resources don't tend to increase the AIs fair trade diplo score too, as unless theres more relevant, but separate, code somewhere then the lump sum is the only value and it doesn't increase over time.

10. ### robyextremeChieftain

Joined:
Oct 4, 2003
Messages:
228
Location:
Your explanation of granary is ******** lol. Do you actually expect people to understand that?

edit: NEVERMIND all your posts are written in gibberish.

Moderator Action: Please do not troll the forums. This is not acceptable as the word ******** is simply offensive and the rest of your post gets personal. You would have done better to simply pass this bye and not made any comment.

11. ### pomthomDrive & Reverb

Joined:
Dec 6, 2012
Messages:
1,587
Location:
Goodbye Paris, good morning London
A lot of people do understand. This thread is a huge contribution to the knowledge heritage of Civ 4 and contains the fruit of a lot of work (although not from me personally).

Your own contribution to it offends me highly.

12. ### UnforcedErrorSettler

Joined:
May 1, 2012
Messages:
3,298
Gender:
Female
Location:
Budapest, Hungary

Moderator Action: To call someone a troll is to troll. Please report posts and let the staff handle it. This only serves to feed the troll and make things worse.

13. ### Manco CapacFriday,13 June,I Collapse

Joined:
Mar 1, 2010
Messages:
8,051
To quote Pewdiepie: Hahaha, you gave me more views hahaha.

On a serious note: I'm not expecting people to understand, because I'm an extremely elistist person who loves to haughtily jest at the expense of the weak. I'm so nerdy I spoused with my delusions that I am a success story because I'm so great in Civ IV. Is it ok of an answer?

Moderator Action: Use of sarcasm can also be trolling. Please report the post and let staff handle it.

14. ### MitchumChieftain

Joined:
May 31, 2006
Messages:
11,744
Location:
San Diego, CA
That answer is perfect, Tachy. Except for the "I'm so great in Civ IV." part.

15. ### Manco CapacFriday,13 June,I Collapse

Joined:
Mar 1, 2010
Messages:
8,051
Indeed, even though I have no idea what is the white gibberish says about.

Thanks for not spitting on me. Very appreciated, especially in times like these.

16. ### GhpstageChieftain

Joined:
Jan 15, 2009
Messages:
2,944
Location:
Bristol, England
Does anyone know if how AI choose what civics and religions to run, and when to change has ever been figured out?

17. ### SeraielChieftain

Joined:
Sep 6, 2011
Messages:
7,954
Gender:
Male
Did I understand it right that robbyextreme is only mad at Tachywaxon because she was allowed to go the world's CIV-University? I mean, he cannot be mad at her for being allowed to go to that University with kossin, it's really neither one's fault that canadians are so hard to teach that their country can only afford 2 places because 1 Canadian takes hundreds of teachers to only learn basic stuff like:

Moderator Action: Please stop feeding trolls. This only serves to continue making things worse.

Code:
iValueArist = 1 Beaker 4 Culture
{
.................
----%%%%%WTF\$\$\$\$\$\$
}}}}
[b]If iPlayersCiv = Canada
change iValueArist to 5 Nuisance 1 Insanity[/b]
{
..............

----//////?=!LOL§§"
[b]if country next to Canada produce 1 Angry Citizen for each Canadian Arist[/b]
}}}}}
[b]Message given: AAAAAAARRRRRRRRRGGGGGGGGGGGHHHHHHHHH![/b]

Code taken from iNonsense.xml

18. ### MensPulchraChieftain

Joined:
Nov 7, 2013
Messages:
46
I agree with RobyExtreme.

Joined:
Sep 6, 2011
Messages:
7,954
Gender:
Male
20. ### GhpstageChieftain

Joined:
Jan 15, 2009
Messages:
2,944
Location:
Bristol, England
Perhaps some of the opening post is misleading, as to be honest it is out of reach for a lot of people, but there are enough people who can understand whats been written to answer questions from those who didn't understand but asked, rather than just complained!
"Join Date: Nov 07, 2013"