Frequently Asked Questions

Status
Not open for further replies.
I'm sure it's caused by these tile yield icons because when I click the button to show them (I play with that option off) and then turn it off - game freezes for about 10 seconds. That's why I hope turning off that settlers' ability would solve my problem with them.

Now that you mention it, I did notice that in a few play sessions. AFAIK, you can't disable that, so you have to consult 45* for that.
 
Strange thing. I reloaded a save and... problem disappeared. Settlers now work as usual, with no freezing. Maybe it's because of this graphics paging or something like that. When I heard about it for the first time I assumed it only loads features (trees, towns etc) when you look at the specific map region, and then unloads (sorry, forgot how the opposite of "loading" in this context is called in English, so I'll just use "unload" word) it again to save memory. But it seems that it works slightly different - it loads features when you look at them and then they stay loaded all the time. I reloaded save, so again a lot of map is still "unseen" by me - I discovered it, but did not look at it after reloading - so features there are not loaded. But I think that when I look at entire map during my playing I'll get this freezing again - because features all around the map will be loaded again and won't disappear. And that's why it'll take a lot more time to "unload" tile yields marks again.

Surprisingly having this option to see tile yields on all the time does not help. I thought that if they are visible all the time and don't have to be "unloaded" - the problem will disappear, but no - even with tile yields visible option on I still had this freeze after deselecting my settler.
 
the cruse missile I built always shows grey fields, like attacke range = 0
As I understand, it should work like a bomber, 1) choose what to attack and 2) within a limited range choose the field.
But I have grey fields only.
:confused:

I can do a cruise missile strike with no problems. Are you trying to target a unit?

cruise missile air strike.jpg
 
In the original BTS, the AI would take the average between its attitude towards you and its attitude towards your vassals, then round down. For example, it might be at Pleased with you, but Annoyed with your vassals, resulting in a rounding down to Annoyed towards you without your knowledge (the diplomacy screen would still show them as Pleased). Does this mod fix this bug?
 
In the original BTS, the AI would take the average between its attitude towards you and its attitude towards your vassals, then round down. For example, it might be at Pleased with you, but Annoyed with your vassals, resulting in a rounding down to Annoyed towards you without your knowledge (the diplomacy screen would still show them as Pleased). Does this mod fix this bug?

I didn't know AI behave like this in standard BTS, so although this might have been changed by previous modders, the answer is I don't know.
 
Someone looked in the SDK of vanilla Civ IV (sorry, I don't know exactly where; he didn't specify) and found this:
http://forums.civfanatics.com/threa...ow-exactly-wfyabta-works.188183/#post-4602558
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;                                                                                                        
}
As I understand it, it is the "CvTeamAI" instead of "CvPlayerAI" that makes the AI use the average of its diplomatic attitude towards you and your vassals when determining whether it should trade with you (I don't have other examples, but I suspect CvTeamAI also affects other things like peace vassaling, defensive pacts, and of course war declarations). The most dangerous aspect of this is, obviously, that Friendly AIs are not truly Friendly if they are not also Friendly towards every single one of your vassals.

I hope this section of code is enough to help you pinpoint its location.
 
Someone looked in the SDK of vanilla Civ IV (sorry, I don't know exactly where; he didn't specify) and found this:
http://forums.civfanatics.com/threa...ow-exactly-wfyabta-works.188183/#post-4602558
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;                                                                                                       
}
As I understand it, it is the "CvTeamAI" instead of "CvPlayerAI" that makes the AI use the average of its diplomatic attitude towards you and your vassals when determining whether it should trade with you (I don't have other examples, but I suspect CvTeamAI also affects other things like peace vassaling, defensive pacts, and of course war declarations). The most dangerous aspect of this is, obviously, that Friendly AIs are not truly Friendly if they are not also Friendly towards every single one of your vassals.

I hope this section of code is enough to help you pinpoint its location.

I'll have a look when I have some time but probably not very soon.
 
Someone looked in the SDK of vanilla Civ IV (sorry, I don't know exactly where; he didn't specify) and found this:
http://forums.civfanatics.com/threa...ow-exactly-wfyabta-works.188183/#post-4602558
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;                                                                                                     
}
As I understand it, it is the "CvTeamAI" instead of "CvPlayerAI" that makes the AI use the average of its diplomatic attitude towards you and your vassals when determining whether it should trade with you (I don't have other examples, but I suspect CvTeamAI also affects other things like peace vassaling, defensive pacts, and of course war declarations). The most dangerous aspect of this is, obviously, that Friendly AIs are not truly Friendly if they are not also Friendly towards every single one of your vassals.

I hope this section of code is enough to help you pinpoint its location.

I looked and the bug is still very much present. I checked, and the fix is a 1-liner, but I don't have a compiler set up at present. If 45* wants to fix, the change is in:

Code:
DenialTypes CvTeamAI::AI_techTrade(TechTypes eTech, TeamTypes eTeam) const

The relevant section is fairly early in the function, here:

Code:
DenialTypes CvTeamAI::AI_techTrade(TechTypes eTech, TeamTypes eTeam) const
...
...
      if (isAtWar(eTeam))
        {
                return NO_DENIAL;
        }

        if (AI_getWorstEnemy() == eTeam)
        {
                return DENIAL_WORST_ENEMY;
        }

        eAttitude = AI_getAttitude(eTeam); // relevant line

        for (iI = 0; iI < MAX_PLAYERS; iI++)
        {
...

So change the marked line to this:
Code:
eAttitude = GET_PLAYER(getLeaderID()).AI_getAttitude(eTeam);

That will fetch the attitude of the team leader instead of using the aggreggate team AI attitude from vassals.
 
Wow, if this is so easy I upload it with my next revision. Thank you Afforess.
Well I lied. I checked and there is no function to match CvPlayerAI::AI_getAttitude(TeamTypes eTeam), which is what I gave as the replacement. You could easily write one, it would just sum up the attitude of the player towards all players of the team.... But an even easier route would be to just do this:

Code:
eAttitude = GET_PLAYER(getLeaderID()).AI_getAttitude(GET_TEAM(eTeam).getLeaderID());

And use their team leader as a proxy for how the AI player feels about the team. Lazy, less code and effective 99.99% of the time.
 
Well I lied. I checked and there is no function to match CvPlayerAI::AI_getAttitude(TeamTypes eTeam), which is what I gave as the replacement. You could easily write one, it would just sum up the attitude of the player towards all players of the team.... But an even easier route would be to just do this:

Code:
eAttitude = GET_PLAYER(getLeaderID()).AI_getAttitude(GET_TEAM(eTeam).getLeaderID());

And use their team leader as a proxy for how the AI player feels about the team. Lazy, less code and effective 99.99% of the time.

Yeah, I was just checking; I'll just pick the second solution because it's less time consuming :p
Thanks again for looking into it
 
How exactly war reparations work? I clicked to offer war reparations, asked what that civ wants for it, they added a small amount of gold they wanted from me, I accepted but I received no bonus in relations.
 
How exactly war reparations work? I clicked to offer war reparations, asked what that civ wants for it, they added a small amount of gold they wanted from me, I accepted but I received no bonus in relations.

It doesn't add much in positive relation points, but removes the negative ones which have to do with war, like "you declared war on us!" or "you razed one of our cities!". Though it DOES add a "Past events have proven your good nature to ones" positive relations point.
 
Ah, ok, thx. Did I do it right? I offered to pay war repations, asked what they want in return and then accepted their proposal. Will giving war reparations, adding an amount of money and giving it as a gift work the same way? Or will I have to always ask them what they want as war reparations?
 
Ah, ok, thx. Did I do it right? I offered to pay war repations, asked what they want in return and then accepted their proposal. Will giving war reparations, adding an amount of money and giving it as a gift work the same way? Or will I have to always ask them what they want as war reparations?

Asking is the only way to go.
 
You can't. You used to be able to, but due to the AI not understanding how it works, as well as this being more or less a cheat, it's disabled in the XML.
 
Status
Not open for further replies.
Top Bottom