1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Civ Illustrated #1 (Know Your Enemy)

Discussion in 'Civ4 Strategy Articles' started by Kaitzilla, Oct 23, 2012.

  1. ArchGhost

    ArchGhost Chieftain

    Joined:
    Aug 2, 2016
    Messages:
    349
    The thing having a vassal does for capping success is it combines their power ratings when determining whether you can cap them or not. It makes the master quite a bit more resistant in practice (often refusing to cap all the way to elimination if you ignore their vassal), but strictly speaking is still completely possible if you are powerful enough.


    You can even capitulate former enemy vassals without firing a shot against them (no war success at all); it happens quite often to me in Earth18 games with Tokugawa and Mansa who are always leeching off somebody the whole time. When their master caps they often follow suit the same turn as they are so small.

    Not sure if it has to do with Power Ratings or how much you've beaten on their master (in the XMLs, the vassal doesn't care about war success against the Master when determining to break away or not, so I doubt this) but it is possible to do.
     
  2. Hamilton321

    Hamilton321 Chieftain

    Joined:
    Jul 15, 2016
    Messages:
    125
    Whenever I play as Rome, thirty praetorians is far less than I recruit. When I play as Rome I usually play huge earth2 and end my classical era wars owning about a third of the main continent with something like seventy praetorians. :mischief:
     
  3. Anysense

    Anysense Chieftain

    Joined:
    Jan 30, 2015
    Messages:
    618
    Yeah, I thought there is some difference between huge and tiny:)
     
    sampsa likes this.
  4. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,144
    Gender:
    Male
    Location:
    America!
    @Pangaea
    Ok, it took me over a year to reproduce this problem, but I've finally got it.

    In the attached save, if the player signs a Cease Fire immediately, the following turn Stalin will be Annoyed, his worst enemy will be Zara, and Stalin will not Peace Vassal to the player.
    2 turns after the save, Stalin will still not Peace Vassal.

    BUT!

    If the player signs a Cease Fire on the following turn after loading the save, then 2 turns after the save Stalin WILL Peace Vassal to the player. :eek:

    For the life of me, I can't pin the problem down any further.
    Random Seed on reload is not enabled, so everything should be precisely the same no matter how many times the turns are replayed.

    The fact that Stalin will Peace Vassal to the player at Annoyed when it should only occur at Pleased is jaw dropping.
    Spoiler :


    If anyone can figure out why this anomaly is occuring, please let me know!

    I really have no idea why a peace vassal is not possible if cease fire occurs right away, but IS possible if cease fire occurs on the save +1 turn.
    Apologies for the lack of World Builder, the save is from the competitive BOTM 172 that ended 2 months ago.
     

    Attached Files:

    Last edited: Jun 3, 2019
  5. WastinTime

    WastinTime Chieftain Supporter

    Joined:
    Jan 27, 2006
    Messages:
    15,204
    Gender:
    Male
    Location:
    California
    What's his reason?
    nevermind. it's that he doesn't like you enough. Anyway, I have your answer! (next post)
     
    Last edited: Jun 5, 2019
  6. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,144
    Gender:
    Male
    Location:
    America!
    !!!
     
  7. WastinTime

    WastinTime Chieftain Supporter

    Joined:
    Jan 27, 2006
    Messages:
    15,204
    Gender:
    Male
    Location:
    California
    This makes me miss the SGotMs. Researching your question, I learned something which might be able to be used in evil ways :devil:

    (referring to the test case in post #204)

    Short-ish answer:
    Stalin's attitude towards you is modified by how many other land targets he has! :eek: (I didn't know this)
    In the case where Stalin will peace vassal, Korea's borders expanded (artist bomb?) for whatever reason, and now they share enough tiles (8, I think) to be land target. Stalin has not one, but TWO other land targets (besides you).
    Those two AI must also have greater power (which they do in your case.)
    So his attitude goes all the way up 2 notches to Pleased and he will agree to be a vassal.

    from CvTeamAI.cpp
    Code:
    if (kLoopTeam.AI_isLandTarget(getID()))
                        {
                            if (iLoopTeam != eTeam)
                            {
                                if (kLoopTeam.getPower(true) > getPower(true))
                                {
    .
    .
    .
                                    iAttitudeModifier += (3 * kLoopTeam.getPower(true)) / std::max(1, getPower(true)) - 2;
                                }
    
    .
    .
                            }
                        }
    then later...

    Code:
    AttitudeTypes eModifiedAttitude = CvPlayerAI::AI_getAttitudeFromValue(AI_getAttitudeVal(eTeam, false) + iAttitudeModifier);
    .
    .
    .
    if (eModifiedAttitude <= GC.getLeaderHeadInfo(GET_PLAYER((PlayerTypes)iI).getPersonalityType()).getVassalRefuseAttitudeThreshold())
                        {
                            return DENIAL_ATTITUDE;
                        }
    
    So, now it looks like you could peace vassal any/all AI. Even the ones that need 'Friendly'.
     
    Last edited: Jun 5, 2019
    ArchGhost, sampsa and Kaitzilla like this.
  8. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,144
    Gender:
    Male
    Location:
    America!
    I can sort of see why a weak AI sharing long borders with stronger AI might be willing to lower their standards to peace vassal to the human player for protection, but wow, what an obscure mechanic!

    Thanks so much for checking this WastinTime :D
    Code diving is beyond me.

    Ripe for abuse ya.
    Would take some thought though.

    Will check up on it when I have more time.
     
    Last edited: Jun 5, 2019
  9. WastinTime

    WastinTime Chieftain Supporter

    Joined:
    Jan 27, 2006
    Messages:
    15,204
    Gender:
    Male
    Location:
    California
    My pleasure. I haven't touched Civ in over 6 months and poking around in the code again really did make my day.
     
  10. ArchGhost

    ArchGhost Chieftain

    Joined:
    Aug 2, 2016
    Messages:
    349
    Sticking that in the ol' mind vault. Maybe this is the reason guys like Monty flip their attitudes all the time early game? Wow!
     
  11. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,144
    Gender:
    Male
    Location:
    America!
    I finally have time to look at this topic in more detail.
    First, I double checked to make sure my Land Target stuff was correct.

    In the 1st case where Stalin will not peace vassal, he has no Land Targets because no one is touching 8 of Stalin's land tiles.
    He will not peace vassal at Annoyed, nor will he peace vassal at Cautious with a religion change by the player.
    Stalin normally peace vassals at Pleased.
    Spoiler :
    No Land Targets - Stalin is Annoyed with Player




    No Land Targets - Stalin is Cautious with Player





    In the 2nd case where a Cease Fire is signed 1 turn later, Korea indeed does culture bomb and changes things.
    In this case Stalin has 1 Land Target, and Korea definitely has more power (soldiers) than Stalin.
    Stalin with then peace vassal to the human at Annoyed.
    Spoiler :
    1 Land Target - Stalin is Annoyed with Player and will Peace Vassal




    It seems 1 land target neighbor can make the weak AI jump more than 1 attitude value?

    The main part of the code seems to be this:
    Code:
      iAttitudeModifier += (3 * kLoopTeam.getPower(true)) / std::max(1, getPower(true)) - 2;

    How much is Korea being stronger than Stalin affecting his attitude towards the player?


    As near as I can tell, Korea's power (all by itself) is sufficient in the test save for Stalin to peace vassal to the player at Annoyed instead of Pleased.
    Korea's and Stalin's power (soldiers) is:
    Spoiler :
    Korea = 350,000/0.9044 = 387,000 Soldiers
    Stalin = 350,000/5.1471 = 68,000 Soldiers
     
    Last edited: Jun 9, 2019
  12. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,144
    Gender:
    Male
    Location:
    America!
    Grr, Peace Vassals are so annoying!
    There are so many rules to getting one.

    "You've Grown too Powerful for Us" is one I am struggling to understand.
    I first I thought it depends on land area or population tripping domination, but that is not true.
    Going way over the dom limit on land area with a peace vassal does not trigger "You've Grown too Powerful for Us".
    Spoiler :



    But going above half on population does trigger it?
    Spoiler :



    Maddening!!
    54% combined population is not even close to the domination limit of 71% population needed on a duel map.

    Open the test save and see how Alex will peace vassal.
    Then add 1 population to the player with world builder and see how he won't. :crazyeye:


    **Edit**
    More testing shows "You've Grown too Powerful for us" can also be triggered with 40% combined world population with the peace vassal if the land domination target is exceeded.

    I can't make any sense of these results.
    Spoiler :


    Alex gains 1 population and will no longer peace vassal due to "You've Grown too Powerful for us"
    Spoiler :



    I'm trying to keep in mind only half of Alex's population and land area count for the player's dom. limit if Alex becomes a vassal.
     

    Attached Files:

    Last edited: Jun 9, 2019
  13. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,144
    Gender:
    Male
    Location:
    America!
    I've been trying to pin this down with another test game.
    So far I've gotten Alex (who peace vassals at Friendly) willing to peace vassal to the player at Annoyed by giving him a neighbor who is a Land Target for Alex. (Cathy touches 8 of Alex's land tiles) :dance:
    Cathy is his worst enemy with -20 diplo through world builder, and she has 9,000,000 soldiers compared to Alex having 24,000 soldiers. :eek:
    4 Attitude thresholds, all the way from Annoyed to Friendly!

    If I make 1 arrogant demand and Alex goes to Furious, he will no longer peace vassal to the player.
    Spoiler :


    I guess under no circumstances will civs peace vassal at Furious. :hmm:
    Probably part of the code where being less than or equal to the refusal threshold means an automatic rejection.
    These duel sized test games are tiny so I can upload a lot of them.
     

    Attached Files:

    Last edited: Jun 9, 2019
    Anysense likes this.
  14. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,144
    Gender:
    Male
    Location:
    America!
    Whoa, this whole situation was mentioned by DanF5771 10 years ago! :eek:

    Really does feel like he had Civ 4 completely figured out in 2009.
    We just read about it sometimes.
     
  15. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,144
    Gender:
    Male
    Location:
    America!
    Time for some testing to figure out how the power of a land target neighbor affects the willingness of an AI to peace vassal to a player.
    We will attack this from the data side since I don't read code.

    First, a test game where Alex shares a long border with Cathy to turn on Land Target status.
    Both are given 100,000 Soldiers.

    The player is given twice the land, twice the population, and 3 times as many soldiers to activate Peace Vassal for Alex.
    ..
    ....
    Huh, Alex says he is doing fine on his own.
    The player needs 3.6 times the power of Alex to get him to peace vassal. :hmm:

    I thought is was 3.0 times the power of the AI or 1.5 times the power if the player was a Land Target of the AI.


    Anyway, world builder's diplo mode is used to bring the player up to +10 Friendly with Alex.
    He is willing to peace vassal once the player has 361,000 Soldiers to Alex's 100,000.

    Relations are lowered to +9 Pleased with Alex. (Alex will no longer peace vassal)
    Cathy's power is raised microscopically to 102,000 Soldiers (Alex will peace vassal :))

    Relations are lowered to +8 Pleased with Alex. (Alex will no longer peace vassal)
    Cathy's power is raised to 132,000 Soldiers. (Alex will not peace vassal)
    Cathy's power is raised to 134,000 Soldiers. (Alex will peace vassal :))

    Relations are lowered to +7 Pleased with Alex. (Alex will no longer peace vassal)
    Cathy's power is raised to 166,000 Soldiers. (Alex will not peace vassal)
    Cathy's power is raised to 168,000 Soldiers. (Alex will not peace vassal)

    With these 3 data points, it might be possible to figure out the math formula.
    Code still says:
    Code:
    if (kLoopTeam.getPower(true) > getPower(true))
                              {
    
    iAttitudeModifier += (3 * kLoopTeam.getPower(true)) / std::max(1, getPower(true)) - 2;
    It seems to say the attitude modifier is (3 * Cathy's power / Stalin's power) - 2.

    When Cathy and Stalin both have 100,000 soldiers, this equation is presumably (3*100/100) - 2
    3-2=1. :hmm:
    But the part higher up says the attitude modifier only occurs if Cathy has more power than Stalin.

    Go to the next data point, 102,000 soldiers for Cathy. (She now has more power than Stalin)
    (3*102/100) - 2 = 1.06 or +1 diplo relations. That boosts the +9 Pleased secretly back up to +10 Friendly and Alex will peace vassal.

    The next data point is 132,000 soldiers for Cathy.
    (3*132/100) - 2 = 1.96 or +1 diplo relations. This is not enough to boost +8 Pleased up to +10 Friendly, and Alex will not peace vassal.

    The next data point is 134,000 soldiers for Cathy.
    (3*134/100) - 2 = 2.02 or +2 diplo relations. That boosts the +8 Pleased secretly up to +10 Friendly and Alex will peace vassal.

    The next data point is 166,000 soldiers for Cathy.
    (3*166/100) - 2 = 2.98 or +2 diplo relations. This is not enough to boost +7 Pleased up to +10 Friendly, and Alex will not peace vassal.

    The last data point is 168,000 soldiers for Cathy.
    (3*168/100) - 2 = 3.04 or +3 diplo relations. That boosts the +7 Pleased secretly up to +10 Friendly and Alex will peace vassal.

    The formula works!

    If a peace vassal candidate is bordered by another AI enough to activate Land Target status, then the player will receive a secret diplo modifier if the land target AI has more power (soldiers) than the peace vassal candidate following the formula:
    Attitude Modifier = Floor (3 * Land_Target_AI_Power / Peace_Vassal_AI_Power) - 2

    A civ will never peace vassal at Furious no matter what the Attitude Modifier is at.
     
    Last edited: Jun 9, 2019
  16. Anysense

    Anysense Chieftain

    Joined:
    Jan 30, 2015
    Messages:
    618
    It seems that I'm getting better. This is a standard size map though, not tiny. So probably not saying much about how much better I have actually got.
    Spoiler :
    Civ4ScreenShot0620q.jpg

    Thats some research @Kaitzilla ! I hardly ever had peace vassals, but with proper use of this mechanics it may be a useful tool.
     
  17. WastinTime

    WastinTime Chieftain Supporter

    Joined:
    Jan 27, 2006
    Messages:
    15,204
    Gender:
    Male
    Location:
    California
    Each leader has a small modifier in the XML that make them slightly harder or easier. I didn't look, but Alex must be +20%.
     
  18. WastinTime

    WastinTime Chieftain Supporter

    Joined:
    Jan 27, 2006
    Messages:
    15,204
    Gender:
    Male
    Location:
    California
    It can be one or more land targets. So you could get 2 boosts.
    I thought your test game had 2, but maybe I counted the other civ's tiles instead of Stalin's.
     
    Kaitzilla likes this.
  19. djdazi180

    djdazi180 Chieftain

    Joined:
    Feb 8, 2018
    Messages:
    17
    Gender:
    Male
    Location:
    Cologne, Germany
    Thanks for the reasearching.

    Does this diplo modifier only affect the PVassalage or every other point of Diplo as well?
     
  20. Anysense

    Anysense Chieftain

    Joined:
    Jan 30, 2015
    Messages:
    618
    Do normal rules apply to tech trading between vassals? Or do they, perhaps, always trade anything, as they do with their master?
     

Share This Page