Does anybody know how exactly WFYABTA works?

Obormot

Old warmonger
Joined
May 2, 2005
Messages
1,781
Location
Russia
I do understand the concept istelf, but I am interested in some numbers, so that I can plan my trades ahead. An exact formula of how the limit is calculated based on score, diplomacy and whatever else is involved, would be the best thing, but an approximate number of tech you would expect to be able to get in trades would do fine too.
 
I did read that discussion and found some usefull info. I didn't see any numbers though, that's why I am asking. It looks like nobody knows the exact formula, but I am sure that people that have played many games far into industrial/modern age should know some approximate number.

For example if I want to launch a spaceship quickly, is it a good idea to beeline to Alphabet and trade for all the cheap techs, or should I save those trades for more expensive techs? I wanted to try a space race win, but I have absolutely no experience with long games.
 
it's level dependant + relation dependant.
Trading for the cheaper techs is a mistake above monarch, AFAIK.
You better research them in a few turns, and trade for bigger ones.
 
OK, I looked it up in the SDK:

Code:
DenialTypes CvTeamAI::AI_techTrade(TechTypes eTech, TeamTypes eTeam)
{
...
    if (eAttitude < ATTITUDE_FRIENDLY)
    {                                                                                                                             
        if ((GC.getGameINLINE().getTeamRank(getID()) < (GC.getGameINLINE().countCivTeamsEverAlive() / 2)) ||                                                                         
              (GC.getGameINLINE().getTeamRank(eTeam) < (GC.getGameINLINE().countCivTeamsEverAlive() / 2)))                                                                           
        {
            iNoTechTradeThreshold = AI_noTechTradeThreshold();
          
            iNoTechTradeThreshold *= max(0, (GC.getHandicapInfo(GET_TEAM(eTeam).getHandicapType()).getNoTechTradeModifier() + 100));
            iNoTechTradeThreshold /= 100;
            if (AI_getMemoryCount(eTeam, MEMORY_RECEIVED_TECH_FROM_ANY) > iNoTechTradeThreshold)
            {
                return DENIAL_TECH_WHORE;
            }
        }
    ....
    }
....
}

...

int CvTeamAI::AI_noTechTradeThreshold()
{
    int iRand; 
    int iCount;                                                        
    int iI;

    iRand = 0;                                              
    iCount = 0;                                                         

    for (iI = 0; iI < MAX_PLAYERS; iI++)
    {
        if (GET_PLAYER((PlayerTypes)iI).isAlive())                                                      
        {                                                   
            if (GET_PLAYER((PlayerTypes)iI).getTeam() == getID())                             
            {                                                    
                iRand += GC.getLeaderHeadInfo(GET_PLAYER((PlayerTypes)iI).getPersonalityType()).getNoTechTradeThreshold();          
                iCount++;                                                         
            }                                                   
        }                                                   
    }

    if (iCount > 0)                                                         
    {                                                   
        iRand /= iCount;                                                            
    }                                                   

    return iRand;                                                                                                          
}

This means that you'll never get WFYABTA with a friendly civ. Otherwise you can only trade techs if either you OR the AI you are dealing with are in the lower halve of the scoretable, and then you are limited to a certain number of tech trades that depends on the AI leader personality (NoTechTradeTreshold parameter from CIV4LeaderHeadInfos.xml) and difficulty level (NoTechTradeModifier parameter from CIV4HandicapInfo.xml).
 
Obormot said:
OK, I looked it up in the SDK:

Code:
DenialTypes CvTeamAI::AI_techTrade(TechTypes eTech, TeamTypes eTeam)
{
...
    if (eAttitude < ATTITUDE_FRIENDLY)
    {                                                                                                                             
        if ((GC.getGameINLINE().getTeamRank(getID()) < (GC.getGameINLINE().countCivTeamsEverAlive() / 2)) ||                                                                         
              (GC.getGameINLINE().getTeamRank(eTeam) < (GC.getGameINLINE().countCivTeamsEverAlive() / 2)))                                                                           
        {
            iNoTechTradeThreshold = AI_noTechTradeThreshold();
          
            iNoTechTradeThreshold *= max(0, (GC.getHandicapInfo(GET_TEAM(eTeam).getHandicapType()).getNoTechTradeModifier() + 100));
            iNoTechTradeThreshold /= 100;
            if (AI_getMemoryCount(eTeam, MEMORY_RECEIVED_TECH_FROM_ANY) > iNoTechTradeThreshold)
            {
                return DENIAL_TECH_WHORE;
            }
        }
    ....
    }
....
}

...

int CvTeamAI::AI_noTechTradeThreshold()
{
    int iRand; 
    int iCount;                                                        
    int iI;

    iRand = 0;                                              
    iCount = 0;                                                         

    for (iI = 0; iI < MAX_PLAYERS; iI++)
    {
        if (GET_PLAYER((PlayerTypes)iI).isAlive())                                                      
        {                                                   
            if (GET_PLAYER((PlayerTypes)iI).getTeam() == getID())                             
            {                                                    
                iRand += GC.getLeaderHeadInfo(GET_PLAYER((PlayerTypes)iI).getPersonalityType()).getNoTechTradeThreshold();          
                iCount++;                                                         
            }                                                   
        }                                                   
    }

    if (iCount > 0)                                                         
    {                                                   
        iRand /= iCount;                                                            
    }                                                   

    return iRand;                                                                                                          
}

This means that you'll never get WFYABTA with a friendly civ. Otherwise you can only trade techs if either you OR the AI you are dealing with are in the lower halve of the scoretable, and then you are limited to a certain number of tech trades that depends on the AI leader personality (NoTechTradeTreshold parameter from CIV4LeaderHeadInfos.xml) and difficulty level (NoTechTradeModifier parameter from CIV4HandicapInfo.xml).
But I'm pretty sure that once you get to the SS techs, all leaders will say "We'd rather win the game, thank you very much." regardless of friendly relations. Someone correct me if I'm wrong.
 
Yes, you are right. It seems they won't trade for techs that allow to build the spaceship parts, and even world wonder/project techs if they intend to build those. But if they are friendly they will trade for normal techs regardless of monopoly & WFYABTA limit.
 
Obormot said:
Otherwise you can only trade techs if either you OR the AI you are dealing with are in the lower halve of the scoretable...
It looks to me as if you both have to be in the lower half of the score table in order to avoid a DENIAL_TECH_WHORE check (assuming
getTeamRank() returns lower values for higher scoring teams).
 
malekithe said:
It looks to me as if you both have to be in the lower half of the score table in order to avoid a DENIAL_TECH_WHORE check (assuming
getTeamRank() returns lower values for higher scoring teams).
Correct. The code shown will return the TECH_WHORE denial if (a) relations are less than friendly, (b) either team's rank is below the median (presumably, in the top half of the scoreboard), and (c) you've exceeded the threshold number of trades.
 
Back
Top Bottom