Results 1 to 17 of 17

Thread: Know how about invasions and Ai-horde-mode behavior (for advanced users)

  1. #1
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Icon1 Know how about invasions and Ai-horde-mode behavior (for advanced users)

    Okay, i'll try to explain in a few words (from what is possible) and with my poor english, what i have found out so far, in many hours of testing until now, about the ai-invasion mode behavior of hordes. The following text is not about the basics of invasions and nearly useless for beginners. But advanced users must admit that such post like this, containing all fundamental know-how about invasions and important answers to never answered questions, has never been written in this complexity.

    When we're talking about the invasions in modding terms, so the invasion begins here:
    A
    fter emerging a "spawned_on_event" marked faction (in descr_sm_factions.txt), with the "faction_emerge" command (in campaign_script.txt), they begin to act in horde-mode. They remain in this solely horde-mode, until they conquered at least one settlement. After successfully conquering their first horde target settlement (horde_target in descr_regions.txt), they are leaving their horde mode and become a normal faction. Only from this point we can finally influence them by the assigned Ai-script-section (in descr_campaign_ai_db.xml) and by their faction standings (in descr_strat.txt).

    Optimal horde-mode behavior sequence:
    1. Horde leader spawned after "faction_emerge" command...
    2. ... in outer east coord. for the east map border regions-outer north for north map border regions etc...
    2b. or at random coord. in the other middle map regions
    3. immediately decides for a valid horde-target settlement and move towards this
    4. horde reinforcement spawning
    5. horde reinforcement and Horde leader move on to meet each other
    6. together they move towards the previous selected horde target
    7. they change route and move towards each army in sight they want to attack. Then returning to point #5
    8. they attack and sack settlements (no conquer) on their way (sometimes even not on their straight route)
    9. finally, after many of those above distractions (when they are still alive), they arrive at the horde-target and give their best (...and rest) to occupy this settlement
    10. after successfully conquerring this settlement, they settle down and begin to act as a normal faction

    Influences points for the AI-Horde-mode behavior in order of relevance:
    1a. Valid horde target in therms of distance and accessibility.
    1b. Right Ai pathfinding calculation to the targed due to mapping.
    1c. When using the vanilla-invasion-structure in campaign_script.txt, what i suggest you to do, then spawn points (for Horde leader & reinforcements), reposition_character command and I_CharacterTypeNearTile condition distance must be adapted to your map
    2. horde settings in descr_campaign_db is fundamental, too.
    3. horde settings in descr_sm_factions = horde strenght must be adapted to the goals and to the enemy strenght present in campaign.
    4. spotting range of generals and horde-leader

    Horde-mode side notes:
    A.
    The distance between a horde-target-settlement to the first horde spawn point, from where the horde leader spawn, must (very important) be within around maximal 75 tiles to be valid. (tiles = pixel in map_regions.tga)
    B. new spawned horde reinforcements and faction leader will be moved immediately to meet each other
    C.
    new spawned horde faction leader, never considers to attack the settlement in the spawning region in the first rounds!? = (edit: depends definitely on horde settings in descr_campaign_db)
    D. ATM it seems that ai-horde selects the nearest horde target from their spawning point!? = (edit: this also depends on horde settings indescr_campaign_db)
    E. new spawned horde faction leader, who is not moving in his first rounds, seems to had encountered issues which remain (not valid horde target) more or less for the rest of their campaign (or horde-mode existence) and for their later reinforcements, too!
    F. once a horde target settlement has been conquered and the horde settled down to become a normal faction, the other horde targets has no more relevancy for them, because they're no more a horde.
    G. inital faction standings seems not to influence horde
    H. victory conditions seems not to influence horde


    The secret key of the Ai-horde-mode-behavior is for sure the right mix-up of all this components adapted to every single given strategy map.

    I've found out that there was a scripted possibilty to let spawn our self made named-character within the 'faction_emerge' command as horde-leader! So we can make use of him in scripts, as we would like do with the other named characters.

    I've worked and tweaked a bit the
    descr_campaign_db, too. Some entries are not, what their names are supposed to be, and some are not, what comments suggested in some other threads.

    The Mongols invasion is working perfectly now. In about more than 200 testing games, only 1 time i've observed the horde doing nothing, but this one seems to be caused by the famous normal Ai issue.

    Sample of good working
    horde settings in my descr_campaign_db.xml:

    <hordes>
    <end_target_faction_bonus int="-300"/>
    <start_target_faction_bonus int="-500"/>
    <farming_level_bonus int="-50"/>
    <shared_target_bonus int="-1000"/>
    <disbanding_horde_bonus int="-500"/>
    <starting_region_bonus int="300"/>
    <horde_target_resource_bonus int="1000"/>
    </hordes>


    At this point i've successfully reached my mission goal to make the horde working nearly perfect and sharing my knowledge about it with you, because i'm a good guy ... who wanna earn some reps.

    BASICS added:
    To mark a region as horde target you must add the line horde_target under the hidden resource line in the >descr_regions.txt<

    .....................................................................................................................................................

    Last edited by Userpro; May 05, 2010 at 04:50 PM. Reason: UPDATING
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  2. #2
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: Stuff about invasions and Ai-horde-mode behavior (Mongols,Timurids etc...)

    Need this space for further testing the horde settings in descr_campaign_db ... sometime in the future!

    In the meantime i repeat about it, what i've already posted above:

    After testing and working a bit with the descr_campaign_db file, i want advise you all, that some entries are not what their names are supposed to be, and some are not, what comments suggested in some other threads.

    Sample of good working horde settings in my descr_campaign_db.xml:

    <hordes>
    <end_target_faction_bonus int="-300"/>
    <start_target_faction_bonus int="-500"/>
    <farming_level_bonus int="-50"/>
    <shared_target_bonus int="-1000"/>
    <disbanding_horde_bonus int="-500"/>
    <starting_region_bonus int="300"/>
    <horde_target_resource_bonus int="1000"/>
    </hordes>
    Last edited by Userpro; December 31, 2008 at 06:42 AM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Know how about invasions and Ai-horde-mode behavior (for expert eyes only)

    You might have mentioned that you need an entry in the hidden_resource line in descr_regions to designate a region as 'horde_target'.










  4. #4
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: Know how about invasions and Ai-horde-mode behavior (for expert eyes only)

    You are right, but i assumed that it was obvious for advanced users, to set the horde targed in this manner. :hmmm: But i will add it now.... thanks for feedback anyway gigantus!
    Last edited by Userpro; December 01, 2008 at 02:25 PM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  5. #5
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    Nice job there userprobe!


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

  6. #6
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    Nice job there userprobe!
    Thanks SigniferOne!
    The last thing what remains to do, is to decrypt perfectly the really confusing horde settings in descr_campaign_db.xml. The strange thing on some values is, that if changing values of one entry, than changing the behavior for another...... Never seen such stuff :hmmm:

    Added: As i allready said above; Some entries are not, what their names are supposed to be, and some are not, what comments suggested in some other threads.
    Last edited by Userpro; December 11, 2008 at 08:55 PM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  7. #7

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    post move to other forum

    ____________________
    Last edited by Oswald von Wolkenstein; December 04, 2008 at 10:27 PM.
    Under the Patronage of Belisarius
    ______________________

    Member of S.I.N.
    = Fidei defensor =

    Consider yourself conservative? Five Conservative Classics



  8. #8

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    Hi, I am wondering how to make a horde settle in a region (not sack) if there are no horde_target 's in descr_regions.

    Americas campaign allows French to act as horde for a while and eventually they settle.. BUT i confirm there is no horde target.. but in my modfolder games if there is no horde target my hordes are stationary..

  9. #9
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    Okay, i gave a look into the americas campaign and try to shortly explain the difference.

    France is marked as "spawned_on_event" faction with horde settings in the descr_sm_factions.txt, thats right!
    But they never spawned as a real horde (with real horde behavior) cos the french will spawn armies only via campaign_script.txt with the normal "spawn_army" command, but without the precedent "event emergent_faction france" command.
    In this manner they never act as a real horde with horde behavior and therefore they dont need horde targeds, marked as such in the descr_regions.txt.

    I hope this point out the difference!?
    Last edited by Userpro; February 02, 2010 at 03:37 PM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  10. #10
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    France is marked as "spawned_on_event" faction with horde settings in the descr_sm_factions.txt, thats right!
    But they never spawned as a real horde (with real horde behavior) cos the french will spawn armies only via campaign_script.txt with the normal "spawn_army" command, but without the precedent "event emergent_faction france" command.
    In this manner they never act as a real horde with horde behavior and therefore they dont need horde targeds, marked as such in the descr_regions.txt.

    I hope this point out the difference!?
    I've made some testing on what i wrote above and must admit, that i was wrong with my statement. Here's the corrected statement.

    A horde faction should act in "horde-mode" if they hold no more settlements. Indifferently from how they will spawn, either with the "spawn_army" or the "emergent_faction" command !
    Last edited by Userpro; February 02, 2010 at 03:52 PM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  11. #11
    Userpro's Avatar =RAE= HostedMod Creator
    Join Date
    Jul 2008
    Location
    regno germanicum, teutonical forest
    Posts
    1,673

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    .. but in my modfolder games if there is no horde target my hordes are stationary..
    @ Archaon ...
    I think that your horde army have encountered a serious pathfinding problem. Try out to let them spawn in a slightly different position!
    Last edited by Userpro; February 02, 2010 at 03:58 PM.
    Visit our TWC M2TW-Kingdoms Hosted Mods Forum for...

    !!! RAE Development stopped --- read last Statement here !!!
    M2TW-Kingdoms Mod Creator REDEO AD EXORDIUM ( RAE )
    Progress: 95% internal final beta release - 85% official release
    RAE TWC-Wiki Eagle Standard interview ... RAE.net Homepage ... RAE TWZ-Germany
    Proudly Sega & Steam Boycotter since ETW! See why here or this petition
    Sorry for bad english here, there and in my tutorials > advanced horde invasion & hide/unhide stratmap-ui & Beginners modding



  12. #12
    alhoon's Avatar Comes Rei Militaris
    took an arrow to the knee

    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,763

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)



    I tried using this guide but it didn't work out in the end.
    The horde didn't pick their closer target (2 provinces away) but a distant one (4 or so provinces away), just because it was the first settlement in the regions txt
    Last edited by alhoon; March 14, 2011 at 04:32 PM.
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  13. #13

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    so you mean that the mongols will no longer make peace with the arabs and just be nice little kids and stay in Baghdad or wherever else they came from?

  14. #14
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    BTW, anyone ever tried doing a sea horde? From what I tested, it simply doesnt work for the AI. They never even move the sea armies, while they may move the ground armies that you give them (or spawn via the add_events - region). If the ground armies succeed in taking the horde target, they might eventually move the sea armies, but often they dont even then... (sometimes the ground armies dont do anything as well)

    Though, might be affected by the AI/pathfinding Im using, but probably not..

    The sea_region is probably doing a mess

    Using a faction with no family tree and simply spawn them gives better resuls to archive that as it seems

    EDIT

    And btw, when UserPro uses terms "faction_emerge", I assume he means "emergent_faction" command that you gotta add in "add_events... end_add_events".. or is it really possible to use "faction_emerge" like this?
    Last edited by Jadli; December 14, 2020 at 04:25 AM.

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

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    Also pay attention if you use energent_faction without "manually" spawning horde FL and generals - choose region carefully. If you code like this
    Code:
    add_events
                    event    emergent_faction    mongols
                    date    0
                    region    Suzdal_Province
                    movie    event/mongols_invade.bik
                    event    counter    mongols_invasion
                    date    2
                end_add_events
    then engine spawns characters in random coordinates across designated region. So I got issues when FL and heir were spawned on tiles surrounded by impassiable forest, so invasion was partially broken and Mongol's armies aimlessly went beteween settlements for couple of turns before capture any of them. And after capturing settlement their actions was discoordineted still.

    So I made code like this
    Code:
    add_events
                    event    emergent_faction    mongols
                    date    0
                    ;region    Suzdal_Province
                    movie    event/mongols_invade.bik
                    event    counter    mongols_invasion
                    date    2
                end_add_events
    and wrote spawn cooedinates for all characters below. Now it's all goes just fine.

    Also have to say that you should avoid spawning all characters in one close area. I divided them into 2 groups at one region.

    And don't give siege units to all stacks - they lowering army's movement points and slowing down expansion. I think that 3-4 siege equiped stacks are pretty enough.

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

  16. #16
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    Not sure if it was meant as an answer to me or not

    Previously, I in the end didnt use the horde mechanics or emergence at all, as it simply didnt work with the the armies being spawned at sea. So removed hording from faction, no family tree and simply spawning them, and it worked relatively great. They started moving towards the closest targests (no horde_targets) and took them, then moved the armies to the one took first in general. Though, afterwards, I must have somehow changed something else in the mod, not sure what, and it affected this and it got broken.... the spawned armies still travel to the closest targets, but only stand there, dont take it. So gotta figure out how to fix it in the upcomming verion. I suppose I will just use whats used in vanilla mongol script.. check next to which settlement they are, and spawn an army to take it.

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

    Default Re: Know how about invasions and Ai-horde-mode behavior (for advanced users)

    No, it wasn't an answer, it's just sharing experience of good working horde for Mongol invasion without any scripted sieges and movements.

    I believe it's a powerful mechanics and if used targetly it may be very useful.

    In my Westeros mod horde faction captured several settlements on their way to horde target but didn't settled there just razed and moved avay to their target. Those captured settlements became rebel. I don't think this mechanics deserves to be ignored.

    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
  •