Results 1 to 17 of 17

Thread: Invade and Defend Decisions

  1. #1
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Invade and Defend Decisions

    Defend Decisions defend_minimal - do not distribute troops in that direction
    defend_normal - equal distribution to frontlines and towns
    defend_raid - equivalent of invade_raids in defense scenario (run around aimlessly in small stacks)
    defend_frontline - defend outside on the frontline (see my main tutorial for info on frontline map command)
    defend_fortified - defend in forts or on the borders
    defend_deep - defend in or around towns


    Invade Decisions
    invade_immediate - invade ASAP (preferably at 1:1 strength ratio) from the frontline into enemy lands
    invade_buildup - slower invade strategy than immediate, prefers to build up on the frontline to specified
    invade_raids - small patrols invade enemy lands cause devastation but is too advanced a strategy for the high level AI
    invade_opportunistic - invade targets that are or become weaker than ours even if it is not planned
    invade_start - plan a future invasion
    invade_none - don't plan invasions but can force invade via the exe unless otherwise specified


    Notes:
    Also note that invade_priority plays an important role in which forces invade where and when.
    Cavalrycmdr has said he thinks that the invade_priority is offset by distance from a target, which can make or break naval invasions. And personally I agree as it seems like a pretty good explanation for some of the things that happen in the LTGD logs.

    Invade_immediate also may affect naval invasions, although invade_buildup works too.

    1) can_force_invade , turns on or off invasions ordered by the exe and overriding the decisions unless otherwise specified
    2) See here for further reading
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  2. #2
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Invade and Defend Decisions

    One thing I forgot.

    There's absolutely no way I could find to circumvent the hardcoded defense plan. The AI will not leave a region to release a siege of another close by, no matter how close. It will only do that with separate armies classified ad free strength I believe.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  3. #3
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: Invade and Defend Decisions

    I have this error and I cannot get where it comes from ?

    Code:
    [data.xml.tag] [error] File:[mods/Faerun/data/descr_campaign_db.xml]Error reading Attributes.(78:32)

  4. #4
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Invade and Defend Decisions

    The error is located on line 78 and in column 32. Press ctrl+g then type in 78 in your text editor (I assume it is notepad++).
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  5. #5
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: Invade and Defend Decisions

    ok thanks, normally the log says it more clearly !

  6. #6

    Default Re: Invade and Defend Decisions

    You're wrong. Invade_raids is the best strategy. Attacks faster than invade_buildup and recruits a better army than invade_immediate. It attacks with large forces.

  7. #7
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Invade and Defend Decisions

    And what about mysterious and mighty invade_opportunistic recruit profile?

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  8. #8
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Invade and Defend Decisions

    I want to share some old gems of "pre-reversal era" wisdom that I find.

    https://forums.totalwar.org/vb/showt...omacy-AI/page2
    Excellent research! CavalryCmdr and Nikolai1962 are really "AI prophets" from early modding era. Just read about defend_decisions comparement and unexpected effects of invade_start!

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  9. #9
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Invade and Defend Decisions

    An interesting tale told by LTGD log. "at_war" condition changes apply only at defend_decisions phase.

    I'd like to reveal from engine reverse what's the meaning ofat_war entry.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  10. #10

    Default Re: Invade and Defend Decisions

    Quote Originally Posted by bitterhowl View Post
    I want to share some old gems of "pre-reversal era" wisdom that I find.

    https://forums.totalwar.org/vb/showt...omacy-AI/page2
    Excellent research! CavalryCmdr and Nikolai1962 are really "AI prophets" from early modding era. Just read about defend_decisions comparement and unexpected effects of invade_start!
    Thank you for this link, I read most of the thread and it gives a rather good image of how the campaign AI actually functions. Considering how much time has passed, it felt like going through a historical source. This game really is an unpolished gem, I wonder how much is still possible, that we aren't currently aware of.

  11. #11

    Default Re: Invade and Defend Decisions

    In the vanilla campaign ai I found an entry as following:

    <decision_entry>
    <!--
    If we have a cease hostilities mission against the target, 50% chance to use defaults
    (this will reduce chance of factions attacking some targets if it will cause excommunication)
    -->
    <min_entry has_ceasehostilities="true"/>
    <max_entry rand="0.5"/>
    </decision_entry>

    Do you know if it is working correctly?

    Anyway, sorry for double posting, I received an answer here:

    https://www.twcenter.net/forums/show...1#post16076803
    Last edited by Macaras; February 02, 2022 at 04:38 PM.

  12. #12
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Invade and Defend Decisions

    Quote Originally Posted by bitterhowl View Post
    I want to share some old gems of "pre-reversal era" wisdom that I find.

    https://forums.totalwar.org/vb/showt...omacy-AI/page2
    Excellent research! CavalryCmdr and Nikolai1962 are really "AI prophets" from early modding era. Just read about defend_decisions comparement and unexpected effects of invade_start!
    During ongoing testing of my upcoming Westeros release I revealed that defend blocks are more important than invade. Had my Ironborn just sitting around their isles. Changed some blocks in defend part - now they conquer the entire map at 250 turn.

    My hint is that defend_frontline has not defend purpose, but invade one. It helps to accumulate invading force on border increasing frontline_balance to necessary value.

    Old article says that only defend_normal has good performance at defending actions, because frontline and fortified plans are ineffective for sieging enemy and defend_deep is too passive.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  13. #13
    z3n's Avatar State of Mind
    took an arrow to the knee

    Join Date
    Aug 2011
    Posts
    4,640

    Default Re: Invade and Defend Decisions

    Here's some other tidbits from CavalryCmdr about it, I've found it to be true as well, so my favoured defense decision in any war is defend_frontline


    Quite useful, can be used with “invade_opportunistic”, “invade_immediate” and “invade_buildup” with great effect. As it implies the AI will attempt to match up against the target faction on the frontline. Army size determined by invade type and nearby enemies. This decision type uses “invade_priority” to determine whose frontline to line up on. Note: One weakness is it will not “recall” these troops to intercept/lift siege unless they can arrive in one turn. DO NOT use against non-neighbouring factions.
    https://medieval2.heavengames.com/m2...ials/ai_essay/
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  14. #14

    Default Re: Invade and Defend Decisions

    Thank you for sharing this guys, one can learn something. I think its simple but very important..

  15. #15
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Invade and Defend Decisions

    Some updates from CavalrtCmdr in another thread here, that invade_opportunistic with can_force_invade=false can make great naval invasions. Haven't tested it myself, but included it into new CAI for mod that porting Rome 1 to Medieval 2, for Romans to invade Carthage, and mod author says it's going good. (He released the mod just some hours ago).

    Another thing I have to say, that military_balance_plus_enemies is very interesting parameter for the sake of making AI behaviour more realistic and smooth. I'm using it to make additional reasons for AI to invade Neutral faction at the most preferable moment.

    This parameter is sensitive to strategical interactions and seems it's only one which can have fast change - if faction is ok and hadn't crushing defeat in battle then military_balance between Neutral neighbouring factions wouldn't have big changes. But, when your neighbour starting war against third faction, then military_balance_plus_enemies may have dramatic change. So it maybe a moment to sudden attack, if you prepared it previously and gathered forces via defend_frontline, but waited for a good chance. Military_balance_plus_enemies changes when faction goes to war could mark such a moment to attack. I think it may be useful to script AI behaviour against human player, to prevent unprepared attacking of any neighbour.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  16. #16

    Default Re: Invade and Defend Decisions

    To specify, invade_opportunistic, can_force_invade=false
    The AI can do a quasi naval invasion, that is if they have another reason to go to a region (by ship) they can then attack that region even without a bordering region or if that region is an island. It is very rare as there is little other reason for the AI to move into enemy regions except to attack. The reason I've seen them do it only with invade_opportunistic is because the AI is more likely to hire mercenaries, and will travel around to do so, the AI army was in that region to hire mercs and decided he had gathered enough of a force to attack, after he was already there, so it's technically not a naval invasion.

    When I say very rare, we're talking a handful of times running 20 or 40 one hundred round AI only campaigns (I was testing different personalities at the time.)

    Sorry if I wasn't clear in the other post.
    Last edited by CavalryCmdr; March 11, 2023 at 10:11 PM.

  17. #17
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Invade and Defend Decisions

    Got some strange AI behaviour during siege on player - lifting it after 1-2 turns even with good odds.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •