Results 1 to 30 of 85

Thread: Campaign/Diplomacy AI

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: Campaign/Diplomacy AI

    One thing I've noticed about M2TW is that the AI acts a lot like it did in MTW.

    In MTW the AI would have most of it's army guarding a province and some guarding the settlement. This made sense since when you entered the province you automatically had to fight the AI army in the province and if you won the army would retreat to the settlement, giving it a larger force to defend the settlement (should you attack it). However in M2TW the player can avoid enemy armies in the province and attack the settlement directly. Thus the AI's tactic of sending out most of it's army to guard the province works against it.

    Any ideas about how to make the AI to keep its soldiers garrisoned unless they want to attack a faction.
    4 Seasons (6 Empires battle for supremecy); 3.0 version
    Total War Eras (start at 970, 1080, 1200, 1300, 1400, or 1500); 2.4 version
    Eras Total Conquest (start at 1230, 1346, 1547); 1.2 version

  2. #2

    Default Re: Campaign/Diplomacy AI

    which i could probably solve by increasing the negative pts_alliance value for the decisions i've set up to make those factions not want to ally.
    Indeed, that will work provided you do not allow the alliance_against value to get too high.

    One thing I've been wondering is if the pts_alliance value holds any sway when an AI faction is forced to chose between allies? With it not showing on the LTGD it's hard to say.

    Any ideas about how to make the AI to keep its soldiers garrisoned unless they want to attack a faction.
    It can be done usnig defend_fortified then disabling forts. Acceptable in vanilla IMO, but, with a little work, it appears forts can be considerably more usefull with the kingdoms.exe. Ironically, the AI is not too bad a fort placement, so they did consider that when they failed to consider so much about the campaign map, this also makes this option less desireable.

  3. #3
    blaaaaaaaaaarg! Senior Member Lusted's Avatar
    Join Date
    Feb 2005
    Posts
    1,773

    Default Re: Campaign/Diplomacy AI

    Indeed, that will work provided you do not allow the alliance_against value to get too high.
    That's the difficult thing. I likehaving the AI form alliance blocks against common enemies, but i want to limit how much Islamic and Catholic factions ally which proves difficult when they have common enemies that it is sensible for them to ally against.

    It can be done usnig defend_fortified then disabling forts.
    Yeah defend_fortified without disabled forts can result in some interesting AI garrisons, but still overall better garrisoning by the AI compared to vanilla. I've been watching a war in the latest campaign in my mod with interest given the big stacks the AI is using to invade and defend settlements with.

  4. #4

    Default Re: Campaign/Diplomacy AI

    That's the difficult thing. I likehaving the AI form alliance blocks against common enemies, but i want to limit how much Islamic and Catholic factions ally which proves difficult when they have common enemies that it is sensible for them to ally against.
    I'm going to script alliances to last 10 turns rather then indefinate and see how the AI handles that. It's an easy, but long, script so it will take me awhile to finish it.

    Yeah defend_fortified without disabled forts can result in some interesting AI garrisons, but still overall better garrisoning by the AI compared to vanilla.
    Major problem with not disabling forts is that AI armies tend to get stuck inside the fort. Highly annoying when you capture thier last city with a full-stack army three steps away just sitting there watching. This can be helped with changing defend types, depending on different situations, particularly switching to frontline when ready to attack and deep when very weak, but it still happens occasionally.

  5. #5

    Default Re: Campaign/Diplomacy AI

    The merchant_city, assassin_city for the byzies was to add to their recruitment line in the EDB so they'd specialize their agent recruitment in particular cities and maybe beat the player to the guild HQ for once. But Lusted's idea seems like it may work better.

    ~~~

    Update on post #5 point:

    GiveMoney seems to trigger ten times a turn when it's regular tribute.

    ~~~

    other people may have noticed this ages ago but i only noticed it recently. Your power rating label (supreme, weak, average) on the diplomacy screen effects what the AI will offer for trade rights etc. If you have a high power rating they generally offer something in exchange for trade rights. If you're weak they're more likely to demand payment for trade rights. Doesn't seem to be relative to their label just yours. Alliances increase it.

    May be of interest as it probably affects a lot of things diplomatically. Especially so as your modding may have changed how likely it is for factions to be one thing or the other. For example in mine i have cheap units but low recruitment so the armies are quite big at the beginning and most of the factions counted as supreme quite early even though they were actually still quite weak. I've increased the points for each label in the descr_diplomacy.xml so there is more of a spread between the factions and the more powerful factions are percieved as such.


    ~~~

    LustedThat's the difficult thing. I likehaving the AI form alliance blocks against common enemies, but i want to limit how much Islamic and Catholic factions ally which proves difficult when they have common enemies that it is sensible for them to ally against.
    It was the excessive catholic-islamic alliances early game that put me off alliance_against. I'm doing alliances by how much the factions like each other now as you can control that a lot more with all the faction_standings triggers.

    ~~~

    Definitely need to try that defend_fortified thing.


    ~~~

    CavalryCmdrThese hidden resources also have the same name (exactly, minus the guild_ at the begining) as the building tree name for that guild (as per export_descr_buildings.txt) I'm wondering if the AI is, instead of programmed to look for 'guild flags,' will recognize any building tree name and increase the priority for that building in that settlement, though I suspect most likely (as the name dose not include the guild_) that it will only work for guilds.

    I'll definately be experimenting with this tommorow.
    Haven't done much with guilds yet but i recall reading a very informative tutorial on them somewhere. Worth looking for if you haven't come across it already.
    Last edited by nikolai1962; 11-23-2007 at 07:15.
    It's not a map.

  6. #6

    Default Re: Campaign/Diplomacy AI

    Quote Originally Posted by CavalryCmdr
    It can be done usnig defend_fortified then disabling forts. Acceptable in vanilla IMO, but, with a little work, it appears forts can be considerably more usefull with the kingdoms.exe. Ironically, the AI is not too bad a fort placement, so they did consider that when they failed to consider so much about the campaign map, this also makes this option less desireable.
    Are there any guides on how to edit defend_fortified and siable forts? Alternatively are there some ready made files I can download that will do this for me?
    4 Seasons (6 Empires battle for supremecy); 3.0 version
    Total War Eras (start at 970, 1080, 1200, 1300, 1400, or 1500); 2.4 version
    Eras Total Conquest (start at 1230, 1346, 1547); 1.2 version

  7. #7

    Default Re: Campaign/Diplomacy AI

    Are there any guides on how to edit defend_fortified and siable forts? Alternatively are there some ready made files I can download that will do this for me?
    defend_fortified as a defend decision in descr_campaign_ai_db.xml, the closest thing to a guid I know of for that file is the link on the top post.

    Easiest way to disable forts that I know of is to edit descr_cultures.txt
    fort_cost 500
    to say
    fort_cost 100000
    Thus making forts cost 100000. Just remember each culture has a seperate fort_cost line.

    As for ready made files, Medimod 0.9 uses that method.

  8. #8

    Default Re: Campaign/Diplomacy AI

    Prompted by a question in a thread.

    If you want factions to have a marriage alliance from the start of the game:

    1. Have a decision entry that makes the factions want to ally, in mine i currently have:

    Code:
    <decision_entry>
    <min_entry	stance="Neutral" target_religion="catholic" is_neighbour="true"/>
    <max_entry  stance="Neutral" target_religion="catholic" turn_number="12" trusted_ally_enemy="false" target_is_shadow="false"/>
    <faction_attitude	can_force_invade="false" want_ally="true" pts_alliance="1"/>
    </decision_entry>
    This makes all the catholic factions want to ally with any neighbouring catholic faction up to turn 12 (while they're rebel-bashing).


    2. Start princesses close to settlements of the faction you want the marriage alliance with.

    3. Make sure the factions don't have any diplomats nearby to make the alliance.

    4. Should get a marriage alliance.

    Alternatively if you just want two specific factions to do this then use the method in post #2 and make separate profiles with a specific entry.

    The princess should be within one turn away from the target faction in case their heir gets a marriage offer straight away. Probably best if you use a princess from the faction that moves first to ensure the target faction's heir doesn't get a marriage offer before the princess can move.
    It's not a map.

  9. #9

    Default Re: Campaign/Diplomacy AI

    AI army merging.

    Problem: AI not merging their armies and particularly the times when they have lots of little stacks all standing round close together not doing anything.

    Been trying to figure this out for my defensive AI profile, in particular looking at the the problem in light of two of the points CavalryCmdr makes in his page (listed above) viz

    1. The attack and defend decisions needing to be in sync
    2. The AI needing a point to mergo on e.g if it's defending it's frontline it needs to have a frontline (explained below)

    Currently using defend_deep as the basis for testing the merging--may not be the best choice overall but it is fine for just testing this aspect.

    Had three bits of progress (I think)...

    1.
    The AI is set to always be defend_minimal to the slave faction but various other things to the other AI factions depending on circumstances. In my simple profile it was initially either defend_deep if at peace and defend_frontline if at war.

    I found the AI merging quite nicely as they expanded against neighbour rebels but going into multi-stack mess mode when they'd taken all the rebel regions and were still at peace with all their neighbour factions.

    Because they were still at war with the non-neighbouring rebel regions they were still at defend_minimal towards the slave faction while being set to defend_deep with their neighbouring factions.

    Changing the defend decison towards the slave faction to be the same as the other AI factions seemed to make the AI merge much better in those situations as they are in the same defense mode for all factions including slave. In my case that meant making the defend decisions towards the slave faction being defend_frontline if a neighbour and defend_deep if not, so the AI faction being processed was defend_deep to everybody in that case.

    2.
    The merging would also go wrong during crusades. In my simple AI profile I originally just had defend_frontline when at war but the AI usually won't have a frontline during crusades/jihads so i think that confused it. Adding a second decison so it was defend_deep when at_war but not a neighbour, and defend_frontline when at_war with a neighbour seems to have fixed that.

    3.
    There was also a third case more specific to my mod but another example of the attack and defend decisions being out of sync.

    I'd set the AI to normally be defend_frontline when at war but to switch to defend_deep when they wanted a ceasefire (as a visual clue when playing). I also have very tight agent limits and few towns so there aren't many diplomats. So often what would happen is an AI faction would go into want peace mode and defend_deep but their single diplomat was on the other side of the map. So the faction would have defend_deep set in the defend decisons but still have invade_immediate or something in the attack decisons because they were still at war. This usually made them go into multi-stack mess mode.

    Not sure how i'll fix that in mine but it is another example of how, if the attack and defense decisions don't fit together then the AI gets confused and they don't merge their armies.

    ~~~

    Currently with defend_deep and everything in sync the AI is merging very nicely most of the time except when case 3 arises. They also seem to always keep a very big garrison in their capital--which is a nice improvement.

    The improved merging may not even be because of the defend_deep bit, it may just be that now the decisons are in sync the AI isn't getting confused as much. I'm going to try setting them to be all defend_normal or something else just to see if it's the being out of sync that messes it up more than which actual defend decision it is using.

    ~~~

    Also the AI sometimes seems to get confused when their group of regions got into a weird shape e.g in my test the english AI expanded right through the centre of the french regions so the french regions ended up in a kind of U shape. That seemed to confuse the french AI a bit, which is sort of understandable as you could see how that might make it hard for the AI to know what central point to defend.

    ~~~

    Also, high brigand spawns made it merge a little bit less effectively as the individual mini-stacks would be chasing rebels instead of merging. I think most mods reduce the brigand spawn rate so that is probably only a minor thing.

    ~~~

    A separate minor thing (maybe not minor in some situations)

    If you start two factions at war they aren't counted in the num_enemies entry used in the campaign AI, (can't remember if CavCmdr mentioned that in his page or not). Might affect some things. Possibly why you have to have the "at_war"="true" bit with the slave faction.
    It's not a map.

  10. #10

    Default Re: Campaign/Diplomacy AI

    There was also a third case more specific to my mod but another example of the attack and defend decisions being out of sync.

    I'd set the AI to normally be defend_frontline when at war but to switch to defend_deep when they wanted a ceasefire (as a visual clue when playing). I also have very tight agent limits and few towns so there aren't many diplomats. So often what would happen is an AI faction would go into want peace mode and defend_deep but their single diplomat was on the other side of the map. So the faction would have defend_deep set in the defend decisons but still have invade_immediate or something in the attack decisons because they were still at war. This usually made them go into multi-stack mess mode.
    Effectively you need to link invade and defend decisions, using the same triggers as the 'defend deep' when wanting peace, switch invade to 'buildup,' 'start,' or even 'none.' This should (mostly) solve the small army issue. Invade decisions will overide defend, so the AI is attempting to follow it's invade orders without an intermediate merge point (such as 'frontline') so the armies have no reason to merge until they reach thier goal. Changing the invade to one of these three leaves only the defend target point, so the AI's armies wil merege there instead.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO