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

Land Target and Manipulating the AI

Discussion in 'Civ4 - Strategy & Tips' started by Kaitzilla, Jan 6, 2016.

  1. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,161
    Gender:
    Male
    Location:
    America!
    This thread will be an attempt to illustrate and outline all the ways to abuse the Land Target Rule that have been discovered so far. :devil:


    I've been looking for a comprehensive thread about the little known "Land Target Rule" and can't find one anywhere, so I'm going to make one.

    Basically, a "Land Target" is when one civ shares an 8 tile land border with another civ.
    This affects things like begging amounts, ease of capitulation, ease of peace vassaling, how likely an AI will go to war with you, etc. etc.

    Here are the threads I've found mentioning it so far:

    The absolute closest I've seen to someone pinning down "Land Target" is the thread where WastinTime blew away the competition in GMajor 134 using Peace Vassals to take over the world.
    http://forums.civfanatics.com/showthread.php?t=539468&highlight=land+target&page=5
    Specifically, Pollina's post with the test games.
    Spoiler :

    Step 1) Verify you need an 8 tile border to trigger "Land Target" status with an AI.

    We'll start with Polina's save (2nd one) since it is the easiest way to check. (Using a begging technique, the save would have to be reloaded after every beg :cringe:)
    This will help us duplicate WastinTime's findings that 8 tiles is the trigger, water tiles don't count, and diagnal tiles do count.

    With Power Ratio at 1.7 in the scoreboard thanks to the BUG mod, if "Land Target" status is active, Hatshepsut will Peace Vassal.
    If "Land Target" is not active, Hatshepsut won't Peace Vassal. :)
    Spoiler :





    First, a smattering of different border configurations.
    All of these result in Hatshepsut being willing to Peace Vassal (valid Land Target)
    Spoiler :







    Then we take away one city from that 3rd picture and suddenly Hatshepsut won't Peace Vassal (not a Land Target)
    That means diagonals must count and that 8 tiles is the threshold.
    Spoiler :



    So far, so good.
    WastinTime's conclusion of 8 border tiles with diagonals counting looks valid. :goodjob:

    Now we will test the water tiles not counting.
    In this test, we seemingly have 8 tiles of border touching on both sides, but Hatty won't Peace Vassal.
    That means that water tiles don't count, again just like WastinTime said.
    Spoiler :





    Now we dig deeper. :whipped:
    Does "Land Target" status require 8 land tiles of shared border on the human side?
    The AI side?
    Can a tile being touched on two sides count twice?
    MORE TESTING!

    In this test, the Human has 8 land tiles on the border and the AI has 7.
    Hatshepsut refuses to Vassal, and that means all kinds of things.
    1) The number of human land tiles the AI touches with their land tiles does not matter.
    Hatshepsut is clearly touching 8 human land tiles and that isn't triggering Land Target status.
    2) Hatshepsut's corner tile (#3) isn't counted twice. If it was, she would Peace Vassal.
    Spoiler :




    [/URL]

    Next, we switch things around with the Human having 7 land tiles on the border and the AI has 8.
    Hatshepsut will Peace Vassal.
    Spoiler :





    Finally, we have 3 Human Land tiles touching 8 AI tiles along the border.
    Hatshepsut will Peace Vassal.
    Spoiler :





    And to show that water tiles really don't count for this calculation, a slightly different configuation.
    Hatshepsut won't Peace Vassal.
    Spoiler :





    That should clear up all the confusion. :D
    Land Target - When a Civ is touching 8 neighbor's land tiles along their border with their own land tiles, the Neighbor Civ will consider them a valid LandTarget. (Diagonal is a valid direction for the purposes of touching. Water tiles don't count at all)

    DanF also mentions in D6 that a Land Target must also have a city on the same continent as an AI's capital.
    http://forums.civfanatics.com/showpost.php?p=7190899&postcount=84
    So don't expect the Land Target techniques to work on an AI with a capital on an island somewhere unless you can plant your own city on that same island.
     
    Last edited: Aug 9, 2017
  2. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,161
    Gender:
    Male
    Location:
    America!
    Abusing Land Target Status

    **Warning**
    Becoming a Land Target makes an AI much more likely to DOW you.
    See D17, D18, E1, and E2
    http://forums.civfanatics.com/showpost.php?p=7190899&postcount=84

    Step 1) Triple your beg/demand amounts.
    If you remember how many turns you've known an AI, and see the power ratio you have with them, you can calculate exactly how much you can beg from them. :)
    Everything you need to know about begging is mentioned by Silu here:
    NOES!
    My next 3 posts are littered with errors because of this wrong begging formula! :mad:
    Please go to post #8 for the correct begging guide.
    Spoiler :
     

    Attached Files:

  3. kossin

    kossin Chieftain

    Joined:
    Dec 4, 2008
    Messages:
    9,572
    Location:
    Canada
    Hi Kaitzilla!

    Dusting off old mechanics :)
    Here are two old posts which are relevant to your topic.

    Peace vassals

    Permanent Alliance (well maybe not as relevant but it's similar goal)

    Keep up the good work :cool:
     
  4. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,161
    Gender:
    Male
    Location:
    America!
    Thanks for the links Kossin. :D
    Peace Vassel and Land Target and AI capital being on another continent for the Ducks in SGOTM 11 is dead-center material for this thread.
     
  5. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,161
    Gender:
    Male
    Location:
    America!
    Step 1) Triple your beg/demand amounts continued

    Now I'm sure you are wondering how much you can beg for techs using this technique. ^_^
    Go back to the beg formula and use BEAKERS*1.5 = 150*2*power_ratio = 300.
    BEAKERS = 300/1.5 = 200:science:
    That means you can beg for a 200:science: tech instead of 150:gold:, or if you are a Land Target (x3 bonus!) a 600:science: tech instead of 450:gold:!

    Just reload the test game to check. (If you remove Iron Working, add a Knight to maintain power ratio. If you add a 1 pop city, remove 1 pop from your capital)
    Monotheism is a 468:science: tech.
    Iron Working is a 780:science: tech
    .
    Spoiler :

    The math says the most we can beg for is 600:science:, so that means Monotheism would be an acceptable beg and Iron Working would be too much.
    Let's see what the test game says:
    Spoiler :
    Monotheism




    Iron Working

    Free Monotheism, and Iron Working was denied.
    Exactly as predicted.

    Notice the math is very consistent.
    http://forums.civfanatics.com/showthread.php?t=496586
    The AI always wants 75% of the beaker value in gold during trade rounded to the lowest 5 value. (Unless they researched some of the tech themself)
    Monotheism = Floor_to_nearest_5(468:science:*0.75) = 350:gold:
    Iron Working = Floor_to_nearest_5(780:science:*0.75) = 585:gold:
    Spoiler :




    This very ratio is why you can beg 75% as much gold as you can science.
    0.75 * 600:science: = 450:gold:


    Now, if you want to extort even more from Mansa than a 600:science: tech, you must increase your power ratio with him.
    How much to get an Iron Working(780:science:) beg?
    Plug 780 into the formula and go backwards :)
    780/3 undoes the land target, so BEAKERS = 260:science:
    BEAKERS*1.5 = 150*2*Power_Ratio
    260*1.5 = 300*Power_Ratio
    390 = 300*Power_Ratio
    390/300 = Power_Ratio
    1.3 = Power Ratio

    Okay, to beg Mansa successfully for Iron Working, we need to increase our power ratio from 1.0 to 1.3
    The Demographics screenshot on T101 says we both have 102,000 Soldiers.
    Looking up the Demographics thread, to reach a 1.3 power ratio I need 132,600 soldiers.
    http://www.civfanatics.com/civ4/strategy/demographics.php

    To gain 132,600-102,000 = 30,600 Soldiers instantly, I will need to use world builder to add umm...
    A Mech Infantry(32k) should do it. (Use the BTS 3.17 values!)
    Reloading the test game and adding a Mech Inf., we try for the Iron Working beg.

    **Edit**
    Test beg failed. :cry:
    I can only get 520:gold: out of Mansa and not the 590:gold: I'm expecting. (15.5% gold increase from 31% power rise :confused:)
    Let me check around.

    **Edit2**
    Checked Bug Mod.
    It is definitely showing Power Ratio as My Soldiers / AI Soldiers.
    378,000/80,000 = 4.725 (American Empire on Scoreboard)
    Spoiler :



    It's not Land Target causing the problem.
    520 gold with and 170 gold without.
    ***Edit 3***
    I added a 2nd Mech Infantry so I have 166,000 troops compared to Mansa's 102,000 troops.
    I can now beg 31.5% more gold and have 63% more power than Mansa.
    This is silly O.o
    I will check if maybe the Marathon Speed or Duel map size is affecting the Power_Ratio somehow.
     
  6. Seraiel

    Seraiel Chieftain

    Joined:
    Sep 6, 2011
    Messages:
    7,954
    Gender:
    Male
    This thread imo. should be in the strategy-guides subsection, because I fear, that it'll become burried below all the other threads like "where to settle 2nd city" or "whom to attack" that, unlike these, have little to no relevance towards others and once the game of those threads has been played, this is a reference book thread like Civ Illustrated #1 though, plz make sure that people are able to find it in 2y from now aswell. (thread bookmarked)

    And I just wished, the CFC forum had "like" and "add reputation" features. Writing posts like this one is so difficult, but it's so useful for so many players. TYVM Kaitzilla, rated the thread 5* , because it's the least I can do and maybe it'll stick out a little better because of that.
     
  7. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,161
    Gender:
    Male
    Location:
    America!
    Thanks for the support Seraiel. :love:

    Once I get the begging stuff sorted out, I'll do Peace Vassals and then finally regular Vassals.
    Try to highlight what WastinTime and TMIT are doing.


    **Edit**
    Ok, it looks like the problem is Silu's begging formula is wrong.
    http://forums.civfanatics.com/showpost.php?p=12851104&postcount=20
    It is supposed to be = (Turns_known + 50)*2*((Our_Power+100)/((Their_Power+100)) as shown by Ghpstage.

    One could argue that my 134,000 soldiers versus Mansa's 102,000 soldiers gives a power ratio 1.313
    That means ((131+100)/(100+100)) = (231/200) = 1.155
    Or should I be doing ((134+100)/(102+100)) = 1.158 :confused:
    Then (150*2*231/200) = 346 * 3 Land Target = 1038/2 = 519:gold: which is exactly the exact amount that Mansa will give me (520 actually) with 1 extra Mech Inf.
    Or (150*2*234/202) = 521:gold: which I suspect is more likely since the game Floors() a lot of calculations.

    The real question is, what is Our_Power exactly?
    Say BUG Mod gives a power ratio of 1.724
    How do we plug that into ((Our_Power+100)/((Their_Power+100))?


    Do 134,000 Soldiers mean Our_Power = 134?
    Does a power ratio of 1.724 get split into Our_Power = 172.4 and Their_Power = 100?

    **Edit2**
    Used here too in SGOTM18.
    People just plug in power ratio and don't try to work through ((Our_Power+100)/((Their_Power+100)) :lol:

    **Edit3**
    Ok, I made both sides powerful in the test game.
    Spoiler :

    Assuming this works off of soldiers, then ((Our_Power+100)/((Their_Power+100)) becomes ((389+100)/(208+100)) = 489/308
    Plug that into GOLD*2 = (100+50)*2*(489/308)*3 = 1428.9
    So the max gold beg should be Floor_to_nearest_5(1428.9/2) = floor(714.44) = 710:gold: if Land Target.
    Will check with the test game now.

    Results:
    710:gold: beg, Yes
    717:gold: beg, Yes
    718:gold: beg, No

    Huh, doesn't round to the nearest 5?
    Forget all that floor stuff, I was wrong.

    It is still a bit off :crazyeye:
    Did I know Mansa 101 turns and not 100 like I thought?
    That allows 719:gold: instead of 714:gold: , mmm
    Going back to the top, (102+100)/(102+100) = 1, so I must still have known Mansa 99 turns on T100 to be denied.
    On T101 with the same power rating, he accepts begs all the way up to 452:gold:
    On T100 with the same power rating and no Land Target, he accepts begs all the way up to 149:gold:, but not 150:gold:
    Maddening!
    **Edit 4**
    Ok, Neilmeister's post had the answer.
    We are calculating iThreshold, and the AI pays out IOurValue which must be lower than iThreshold.
    So when I calculated Mansa must give 150:gold: on Turn 100, I was wrong.
    He must give less than one hundred gold, or < 100:gold:
    That is why he gave 99:gold:
    That is why he gave 718:gold: with the 10 mech infantry, because the iThreshold was 719.
    So I had no need to go to Turn 101.
    On turn 100, I knew Mansa for 100 turns :D
     
  8. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,161
    Gender:
    Male
    Location:
    America!
    **Under Construction**
    Spoiler :
    Abusing Land Target Status

    **Warning**
    Becoming a Land Target makes an AI much more likely to DOW you.
    See D17, D18, E1, and E2
    http://forums.civfanatics.com/showpost.php?p=7190899&postcount=84

    Step 1) Triple your beg/demand amounts.

    Welcome readers from post #2!
    Before you can triple your beg amount using Land Target, you must know how to correctly calculate your maximum beg. :twitch:

    The Totally Correct Begging Guide :nuke:

    Begging_Ceiling = [((Turns_Known + 50) * 2 * ((Our_Power + 100)/(Their_Power + 100)) * 3 if Land Target]
    Leave this number in fraction form.

    Our_Power is the Players Soldier count in the Demographics Screen divided by 1000.
    So if you have 132000 Soldiers, Our_Power = 132.
    To find Their_Power if the AI does not have the lowest Soldier total on the Demographics Screen, use the 4 decimal power ratio that Bug Mod/BUFFY Mod provides and perform:
    Their_Power = Our_Power / 4 decimal power ratio.
    If you don't have a mod that displays the 4 decimal power ratio on the Scoreboard, look on the power graph and estimate the ratio of Your Power vs. the AI's Power and write down that as your power ratio.
    This means your calculation will be a broad estimate instead of an exact number. :sad:

    When you meet an AI for the 1st time, write down what turn that was because that is when the turns_known counter starts.
    If the AI contacted you between turns, say between turn 6 and turn 7, you met them on turn 6.
    Your current turn - turn you met the AI = Turns_Known
    If you can't remember what turn you met an AI, it is frequently recorded in the BUFFY log if you have logging enabled.

    Divide the Begging_Ceiling by 2 if the Human Player is not in Financial Trouble to find the Gold_Ceiling.
    Divide the Begging_Ceiling by 3 if the Human Player is in Financial Trouble to find the Gold_Ceiling.
    Divide the Begging_Ceiling by 1.5 if the Human Player is not in Financial Trouble to find the Tech_Ceiling.
    Divide the Begging_Ceiling by 2.25 if the Human Player is in Financial Trouble to find the Tech_Ceiling.

    The final step is follows:
    The maximum :gold: you can beg from an AI is less than the Gold_Ceiling number minus all your previous successful begs/demands.
    If your Gold_Ceiling is 150:gold:, you can beg 149:gold: or less and be successful if you have no previous begs.
    If you begged 80:gold: many turns ago and the Gold_Celing is 150:gold:, the most you can beg for this time will be < 150 - 80 = 70, so 69:gold:

    The maximum :science: you can beg from an AI is less than the Tech_Ceiling number minus all your previous successful begs/demands.
    If your Tech_Ceiling is 200:science:, you can beg a tech that costs 199:science: or less and be successful if you have no previous begs.
    If you begged a 120:science: tech many turns ago and the Tech_Ceiling is 200:science:, the most you can beg for this time will be < 200 - 120 = 80, so 79:science:

    The conversion rate from :science: to :gold: is 4/3.
    So a 100:science: beg in the past is equivalent to a 75:gold: beg in the past.


    Many people are mistaken that the AI being in Financial Trouble is what causes the division of the Begging_Ceiling by 3 instead of 2.
    In fact, it is the Human Player being in Financial Trouble that causes the Begging_Ceiling to be divided by 3 instead of 2, thus causing Gold_Ceiling to become 50% smaller.
    Tachywaxon defined "Financial Trouble" well.
    http://forums.civfanatics.com/showpost.php?p=12021925&postcount=97

    Basically, it is when you or an AI have expenses greater than 60% of your income.
     
  9. Pollina

    Pollina Chieftain

    Joined:
    Dec 19, 2011
    Messages:
    1,785
    Great thread, Kaitzilla!

    Thanks for taking the time to investigate this. The power+100 has been bugging me for a while, but I never got around to testing it.

    Minor correction to the formula above:

    It should be
    Begging_Ceiling = [floor(((Turns_Known + 50) * 2 * (Our_Power + 100))/(Their_Power + 100)) * 3 if Land Target]

    So the formula for your t101 example is:

    Begging_Ceiling = floor(((101+50)*2*489)/308)*3 = 1437

    GOLD = floor(1437/2) = 718 (We can beg up to 717 gold (no financial trouble). :thumbsup:)
     
  10. obsolete

    obsolete Chieftain

    Joined:
    Dec 17, 2005
    Messages:
    6,201
    Location:
    Planet Earth
    So... when is this all going to be put into the bug-mod? :)
     
  11. Pollina

    Pollina Chieftain

    Joined:
    Dec 19, 2011
    Messages:
    1,785
    I did a search for AI_isLandTarget in the code to find out which AI decisions are influenced by land target considerations:

    The most well known ones already mentioned in this thread are:

    * Begs and demands (thresholds for how much can be begged/demanded)
    * Peace Vassals and Capitulation ("We're doing fine on our own", "We are afraid of your enemies" considerations)
    * AI DoW mechanics (war plan and war target selection)


    Two less well known instances where the AI does land target checks are:

    * Monopoly tech value for &#8220;We don&#8217;t want to start trading...&#8221; calculations
    * &#8220;Close borders spark tensions&#8221; calculation

    The first one is mostly irrelevant. IIUC, the AI is slightly less likely to trade techs that unlock naval units when they are plotting war on us and we are NOT a land target :crazyeye:. (I hope I got that right.)

    The second one is more important. The formula for the attitude hit from close border tensions is:

    Not a land target:
    Attitude_hit = floor(iCloseBordersAttitudeChange*(max(tiles_stolen,20)*3)/100)

    Land target:
    Attitude_hit = floor(iCloseBordersAttitudeChange*(max(tiles_stolen,20)*3+40)/100)

    iCloseBordersAttitudeChange is found in CIV4LeaderHeadInfos.xml and is, e.g., -3 for Isabella. That means that, as a land target, one will always get at least a floor(-3*0.4)= -1 negmod with Isabella, even without stealing any tiles from any of her cities' BFCs. At 20 or more tiles stolen, the attidude hit is -1 (while not a land target) or -3 (land target).

    Spoiler Code :
    Code:
    int CvPlayerAI::AI_getCloseBordersAttitude(PlayerTypes ePlayer) const
    {
    	if (m_aiCloseBordersAttitudeCache[ePlayer] == MAX_INT)
    	{
    	int iPercent;
    
    	if (getTeam() == GET_PLAYER(ePlayer).getTeam() || GET_TEAM(getTeam()).isVassal(GET_PLAYER(ePlayer).getTeam()) || GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isVassal(getTeam()))
    	{
    		return 0;
    	}
    
    	iPercent = std::min(60, (AI_calculateStolenCityRadiusPlots(ePlayer) * 3));
    
    	if (GET_TEAM(getTeam()).AI_isLandTarget(GET_PLAYER(ePlayer).getTeam()))
    	{
    		iPercent += 40;
    	}
    
    		m_aiCloseBordersAttitudeCache[ePlayer] = ((GC.getLeaderHeadInfo(getPersonalityType()).getCloseBordersAttitudeChange() * iPercent) / 100);
    	}
    
    	return m_aiCloseBordersAttitudeCache[ePlayer];
    }
     
  12. MrGrandiose

    MrGrandiose Chieftain

    Joined:
    Mar 16, 2015
    Messages:
    86
    Location:
    Montreal, Canada
    Very true. Rated ***** also to highlight the quality content!
     
  13. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,161
    Gender:
    Male
    Location:
    America!
    Thanks for the help Pollina! :love:
    I will start using the corrected formula immediately for my testing.
    This will speed up the thread progress immensely.


    My bane is forgetting that coders always round their numbers with stuff like floor() cause they store whole numbers in INT variables.
    I just never know where I should be putting floor() into my math and going raving mad trying to figure it out (like :espionage: calcluations)

    Apologies for the incoherent last paragraph.
    The 100:gold: and 718:gold:, not 719:gold: seems like (and probably is) nonsense because I was referencing even more tests that didn't get mentioned in the post previously, and I was low on sleep so I'm not sure what I was talking about there.

    Right, I forgot about border tensions. :goodjob:
    Will have to add one more section illustrating Tachywaxon's border tensions post from Civ Illustrated so that people abusing Land Target don't get blindsided by diplo penalties they did not anticipate.
     
  14. Gwynnja

    Gwynnja Chieftain

    Joined:
    Dec 8, 2007
    Messages:
    2,010
    Gender:
    Male
    Location:
    CA
    Seconded. Great post.
     
  15. Pollina

    Pollina Chieftain

    Joined:
    Dec 19, 2011
    Messages:
    1,785
    Whenever there's division, the result gets truncated. This includes instances where something is multiplied by 3/2 or 40/100, etc. Second rule of thumb is that functions that return numbers always return integers. There is no such thing as a plot distance of 1.5 or 9.5, for instance.

    Espionage mission cost calculations are fun! :D
     
  16. Kaitzilla

    Kaitzilla Lord Croissant

    Joined:
    Jun 21, 2008
    Messages:
    8,161
    Gender:
    Male
    Location:
    America!
    I should make that my signature. :love: :goodjob:
     
  17. Pangaea

    Pangaea Rock N Roller

    Joined:
    Sep 17, 2010
    Messages:
    5,107
    Fantastic thread - rated 5 also :)

    If I understood this correctly, the counting in the below pictures is correct?

    Spoiler :




    After Asoka captured that barb city (Polynesian), I got -1 :mad: for border pressure, so I reckon that's a good indicator as well, though as most things in Civ, these thresholds probably depend on AI personalities. (edit: I see that was touched upon above).

    Not enough military yet, but once I get out a real army, I hope he'll peace vassal.
     
  18. WastinTime

    WastinTime Chieftain Supporter

    Joined:
    Jan 27, 2006
    Messages:
    15,209
    Gender:
    Male
    Location:
    California
    @Kaitzilla, how about vassal chaining and land target? In other words, if I have a vassal and my target AI has 8 tiles that border only my vassal. No border with me. Is that a land target for all purposes?
     
  19. Seraiel

    Seraiel Chieftain

    Joined:
    Sep 6, 2011
    Messages:
    7,954
    Gender:
    Male
    You once wrote yourself, that the borders of the Vassal don't count WastinTime. I think this was in GM-134.
     
  20. WastinTime

    WastinTime Chieftain Supporter

    Joined:
    Jan 27, 2006
    Messages:
    15,209
    Gender:
    Male
    Location:
    California
    I figured this was the thread to fact check that. I seems logical to me that vassal borders would count--at least for some things.
     

Share This Page