Results 1 to 14 of 14

Thread: Need Help. AI armies stuck forever.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    =NF= Vasileios_the2nd's Avatar Semisalis
    Join Date
    Sep 2008
    Location
    Athens.Greece
    Posts
    404

    Default Need Help. AI armies stuck forever.

    We all have experienced this, more or less. Sometimes AI looses any goal, and thus just sits on the map doing absolutely nothing.
    In my case, I have Scotland as a horde faction. They sack the first 3 towns via a script, but after that, they end in a rebel area, where they cannot find a good enough target to move forth, reasulting in all the armies waiting endlessly in the same position.

    I have made this trigger in the export_descr_character_traits.txt:
    Trigger NoMoreDevastation
    WhenToTest GeneralDevastatesTile

    Condition FactionType Scotland
    and IsGeneral
    and CharacterNumTurnsIdle > 1

    Affects MoveUDog 1 Chance 100
    Which works nicely. Problem is that I can't find any good command to give them through the campaign_script, so that they start moving again.

    The general idea is:

    Code:
    If 
         general hasn't moved for 2 turns
    do 
         something
    I don't want this to happen exclusively. I mean, I could give them a "sige this settlement" command, but I want to give them a generic one. Something that will work in any circumstances.


    So, any ideas?
    Note that as I have said again and again, I am (unfortunatelly) working on medieval2.exe and not on the kingdoms one.

    Any help greatly appreciated.
    "Greeks dont mod like modders, modders mod like greeks." -PorkyJack
    10 new captain models (campaign map) to download

  2. #2
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: Need Help. AI armies stuck forever.

    How about in the descr_regions file add the line horde_target like below. Maybe this will direct them to the cities you want.

    HTML Code:
    Smolensk_Province
    	Smolensk
    	russia
    	Rus_Rebels
    	177 110 83
    	horde_target
    	5
    	4
    	religions { catholic 2 orthodox 74 islam 2 pagan 20 heretic 2 }

  3. #3

    Default Re: Need Help. AI armies stuck forever.

    there is a limit on how far away the target is and if there is sea in the way, so maybe try moving the horde target around (or the spawn location) to get the desired effect.

  4. #4
    alhoon's Avatar Comes Rei Militaris
    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,233

    Default Re: Need Help. AI armies stuck forever.

    Interesting question.

    I also would like a solution to this problem, although I don't encounter it very often. Also, for more aggressiveness, the spawned generals have a label that I use to send them attacking pre-specified cities.
    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).

  5. #5
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Need Help. AI armies stuck forever.

    Perhaps try increasing the horde_disband_percent_on_settlement_capture value in the descr_sm_factions.txt so that their horde armies will diminish after they take the first few cities. Either that or decrease it so they have more strength to carry on with.

  6. #6
    alhoon's Avatar Comes Rei Militaris
    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,233

    Default Re: Need Help. AI armies stuck forever.

    They usually don't capture the cities. They exterminate and move away. Also, does the disband horde army works in Med2?

    I have put the disband on 20% and even used the can_horde command, made a horde, captured a city... and nothing happened. Not a single unit was disbanded.
    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).

  7. #7

    Default Re: Need Help. AI armies stuck forever.

    If they reach the horde_target, they will occupy, guaranteed.
    Anything that is not a horde target is sacked, guaranteed.

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

    Default Re: Need Help. AI armies stuck forever.

    Give al look at this little research-thread about horde-behaviour, maybe it can help you in in some manner.
    http://www.twcenter.net/forums/showthread.php?t=198357

    Stucking armies are almost always due to mapping-Ai-pathfinding issues!
    Last edited by Userpro; September 30, 2009 at 11:27 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



  9. #9
    Byg's Avatar Read The Manual
    Patrician

    Join Date
    Nov 2005
    Posts
    4,569

    Default Re: Need Help. AI armies stuck forever.

    Yes, regarding stuck ai armies, make a map with no obstacles so that no single settlement, army or fort can block any pass, crossing or destination of any kind completely via its zone of control and I bet you won't get any stuck armies. If I were a mapper I would have done this years ago.

    Far better to let the ai have a fully traversible map and be able to shine a little with its basic capabilities than to have a map full of human player exploits and nonsensical ai behaviour.
    Last edited by Byg; October 01, 2009 at 11:27 AM.

    NEW BGR V 20150324! . . . . . . . .. . . .BGRIV_E

  10. #10
    alhoon's Avatar Comes Rei Militaris
    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,233

    Default Re: Need Help. AI armies stuck forever.

    Quote Originally Posted by Archaon View Post
    If they reach the horde_target, they will occupy, guaranteed.
    Anything that is not a horde target is sacked, guaranteed.
    Really, really, not happening. I have moded many of the cities as horde targets and they just burn them. I have hordes spawn in the province of horde targets. They just burn and move away... then they return and burn again. I have seen cities exterminated thrice.
    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).

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

    Default Re: Need Help. AI armies stuck forever.

    Horde settings in the descr_campaign_db.xml file will prevent the horde to settle down in the same province where they're spawned (they don't accept this as horde targed).
    If they reach the horde_target, they will occupy, guaranteed.
    Anything that is not a horde target is sacked, guaranteed.
    Archaon is right, but only if the horde-ai has set the horde targed as "recognized" and valid (see horde limits)!
    Last edited by Userpro; October 03, 2009 at 08:46 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

    Default Re: Need Help. AI armies stuck forever.

    Quote Originally Posted by Userprobe View Post
    Horde settings in the descr_campaign_db.xml file will prevent the horde to settle down in the same province where they're spawned (they don't accept this as horde targed).
    Archaon is right, but only if the horde-ai has set the horde targed as "recognized" and valid (see horde limits)!
    Hey, i didn't know that a horde doesn't recognize the region it spawned in as a horde target.. Because in my mod (DaC) we use a character called Nagrat who spawns in and takes a region back immediately after it is lost, until we used horde_target he used to sack, now when he spawns in sieging and takes it he occupies.. Which is opposite to your findings..
    Perhaps my character doesn't recognise himself as a horde, but then it makes no sense that when the region didn't have horde_target it would be sacked..

    I'm sorry to not help with this post, as the information has made my personal tests and results seem invalid, yet they work, so i am trying to understand the conditions that may be different..

  13. #13
    alhoon's Avatar Comes Rei Militaris
    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,233

    Default Re: Need Help. AI armies stuck forever.

    Quote Originally Posted by Userprobe View Post
    Horde settings in the descr_campaign_db.xml file will prevent the horde to settle down in the same province where they're spawned (they don't accept this as horde targed).


    I didn't know. OK a few hours of playtesting hordes out of the window for this small detail.

    Also I didn't know hordes were so complicated.
    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).

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

    Default Re: Need Help. AI armies stuck forever.

    Because in my mod (DaC) we use a character called Nagrat who spawns in and takes a region back immediately after it is lost
    I'm not sure about the behavior when taking back a previous lost settlement.
    I think it depends also from, if you use commands like spawn_character or create_army for this character!? It seems not to be the same for the horde behavior, as the first-time "emergent_faction" command.
    If you use vanilla-horde-settings in the descr_campaign_db.xml file, it is as i said (for the first-time-emergent_faction). ATM, i cant remember which of the horde command line of them, is responsible for (will prevent the horde to settle down in the same province where they're spawned), but i think it was the starting_region_bonus entry!
    Last edited by Userpro; October 07, 2009 at 11:50 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



Posting Permissions

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