Results 1 to 14 of 14

Thread: How to make mongol Ai continue attacking?

  1. #1

    Default How to make mongol Ai continue attacking?

    I observe mongol Ai in late era and it stops attacking other settlement around turn 80 and or it has around 40 settlement.
    I changed to have mongol ai to have a lot of money so it does not bankrupt. Even if mongol ai has a lot of money, it stops attack when above condition.
    I guess I should fix campaign_script.
    Let me know how to change mongol ai to keep attacking vigorously so mongol can attack and take Rome?

  2. #2

    Default Re: How to make mongol Ai continue attacking?

    Probably you'll have to mess up with the descr_campaign_ai_db.xml.

  3. #3

    Default Re: How to make mongol Ai continue attacking?

    Quote Originally Posted by gsthoed View Post
    Probably you'll have to mess up with the descr_campaign_ai_db.xml.
    in descr_campaign_ai_db.xml, i found mongol part. how can I fix it ? help me plz

  4. #4

    Default Re: How to make mongol Ai continue attacking?

    It wouldn't call it a fix; it is a matter of modification to your personal liking. It also depends from which AI (gracul, Savage, Lusted or something else?) you begin with.
    Changing the AI is a rather difficult task which involves a lot of trial-and-error search, until you make the mongols to be as aggressive as you like.
    Now, although the descr_campaign_ai_db.xml is the file to begin with, probably you 'll have to check ai_labels in descr_strat and campaign_script too, king's purse, treasuries, spawned armies etc. It might even involve changing unit morale values and similar stuff in EDU, changes in EDCT and maybe more. Balance the campaign for all these new settings and we 're talking about a whole new project.

  5. #5

    Default Re: How to make mongol Ai continue attacking?

    Quote Originally Posted by gsthoed View Post
    It wouldn't call it a fix; it is a matter of modification to your personal liking. It also depends from which AI (gracul, Savage, Lusted or something else?) you begin with.
    Changing the AI is a rather difficult task which involves a lot of trial-and-error search, until you make the mongols to be as aggressive as you like.
    Now, although the descr_campaign_ai_db.xml is the file to begin with, probably you 'll have to check ai_labels in descr_strat and campaign_script too, king's purse, treasuries, spawned armies etc. It might even involve changing unit morale values and similar stuff in EDU, changes in EDCT and maybe more. Balance the campaign for all these new settings and we 're talking about a whole
    new project.
    I found this part from campaign_script

    ;mongols weaken and no longer are a superpower
    monitor_event PreFactionTurnStart FactionType mongols
    and not FactionIsLocal
    and I_EventCounter mongols_invasion = 5


    set_event_counter is_the_ai 0


    end_monitor


    declare_counter attack_khiva
    set_counter attack_khiva 0


    monitor_event FactionTurnStart FactionType mongols
    and not FactionIsLocal
    and I_CharacterExists mongols4jebe
    and I_CharacterExists mongols4bayan


    if I_CompareCounter attack_khiva = 1
    siege_settlement mongols4jebe, Khiva, attack
    siege_settlement mongols4bayan, Khiva, maintain
    set_counter attack_khiva 2
    terminate_monitor
    end_if


    if not I_SettlementUnderSiege Khiva
    if I_CompareCounter attack_khiva = 0
    siege_settlement mongols4jebe, Khiva, maintain
    siege_settlement mongols4bayan, Khiva, maintain
    set_counter attack_khiva 1
    end_if
    end_if


    end_monitor


    declare_counter attack_konjikala
    set_counter attack_konjikala 0


    monitor_event FactionTurnStart FactionType mongols
    and not FactionIsLocal
    and I_CharacterExists mongols4chindu
    and I_CharacterExists mongols4nayuk


    if I_CompareCounter attack_konjikala = 1
    siege_settlement mongols4chindu, Konjikala, attack
    siege_settlement mongols4nayuk, Konjikala, maintain
    set_counter attack_konjikala 2
    terminate_monitor
    end_if


    if not I_SettlementUnderSiege Konjikala
    if I_CompareCounter attack_konjikala = 0
    siege_settlement mongols4chindu, Konjikala, maintain
    siege_settlement mongols4nayuk, Konjikala, maintain
    set_counter attack_konjikala 1
    end_if
    end_if


    end_monitor


    ;================== TIMURIDS INVASION ===================


    this may affect mongol not to attack?

  6. #6

    Default Re: How to make mongol Ai continue attacking?

    Quote Originally Posted by wscha231 View Post
    this may affect mongol not to attack?
    [Please, next time you'll post any code lines, try to use the # button to wrap it up: it keeps the formatting and it is more easy to read . ]
    This code makes mongols to attack.

    Dude, maybe it would be easier if you just try some of the major sub-mods like SSHIP (MWY has posted some screenshots of quite interesting mongols' expansion) to see if their mongols' expansion fits to your liking better than vanilla.
    Last edited by gsthoed; December 07, 2014 at 09:21 AM.

  7. #7

    Default Re: How to make mongol Ai continue attacking?

    The code in the campain script you posted just forces the initial sieges and attacks of the mongols. Everything else the AI decides via the descr_campaign_ai_db.xml file, as gsthoed posted.

    It's actually not that hard to force them to attack all the time, the essential code is this:

    <!-- NEIGHBOUR, DEFAULT IS INVADE_BUILDUP -->
    <decision_entry>
    <min_entry is_neighbour="true"/>
    <max_entry is_neighbour="true"/>
    <faction_attitude invade="invade_buildup" invade_priority="5000" can_force_invade="false" continue="true"/>
    </decision_entry>

    <!-- NON-NEIGHBOUR, DEFAULT IS INVADE_NONE -->
    <decision_entry>
    <min_entry is_neighbour="false"/>
    <max_entry is_neighbour="false"/>
    <faction_attitude invade="invade_none" can_force_invade="false" continue="true"/>
    </decision_entry>

    Copy this into your invasion_decisions part of the mongol AI. Then delete every other entry showing <faction_attitude invade="something"... from the mongol AI part.
    You now have an AI that attacks as much as it can (only neighbours though).
    Note that this doesnt make much sense though.

  8. #8

    Default Re: How to make mongol Ai continue attacking?

    Quote Originally Posted by MWY View Post
    The code in the campain script you posted just forces the initial sieges and attacks of the mongols. Everything else the AI decides via the descr_campaign_ai_db.xml file, as gsthoed posted.

    It's actually not that hard to force them to attack all the time, the essential code is this:

    <!-- NEIGHBOUR, DEFAULT IS INVADE_BUILDUP -->
    <decision_entry>
    <min_entry is_neighbour="true"/>
    <max_entry is_neighbour="true"/>
    <faction_attitude invade="invade_buildup" invade_priority="5000" can_force_invade="false" continue="true"/>
    </decision_entry>

    <!-- NON-NEIGHBOUR, DEFAULT IS INVADE_NONE -->
    <decision_entry>
    <min_entry is_neighbour="false"/>
    <max_entry is_neighbour="false"/>
    <faction_attitude invade="invade_none" can_force_invade="false" continue="true"/>
    </decision_entry>

    Copy this into your invasion_decisions part of the mongol AI. Then delete every other entry showing <faction_attitude invade="something"... from the mongol AI part.
    You now have an AI that attacks as much as it can (only neighbours though).
    Note that this doesnt make much sense though.
    hmm I changed descr_campaign_ai_db.xml file in data folder the same as you mentioned but mongol stops attacking around 85 again for 15 turns. Plus, I also changed mongol to have extra money so it is not bankrupt. but still... I am not sure which trigger mongol stop invasion.

  9. #9

    Default Re: How to make mongol Ai continue attacking?

    Quote Originally Posted by wscha231 View Post
    I am not sure which trigger mongol stop invasion.
    There is no trigger that stops mongols' invasion.

  10. #10

    Default Re: How to make mongol Ai continue attacking?

    This is not always straightforward to solve. If you use the Gracul AI, it will be about as aggressive as it can possibly be.

    Consider that all factions but yours belong to the AI. The AI is not interested to attack any factions other than yours, although sometimes it does by accident. That is not its main aim though. The AI is looking for your faction.

    If your faction is militarily the strongest in the game, the AI will not attack you. Even if it is only in the top 4-6, the AI will only attack you based on a number of conditions set out in descr_campaign_ai_db. If your faction is locally the strongest, the AI will not attack you there. If you have an army in a settlement that is about 2/3 as strong as one of the AI armies, that AI army will not attack that settlement.

    Beyond all that, the script you identified has something to do with the Mongol invasion. However, changes will not take effect until you start a new campaign. That file gets saved at the beginning of the game and the engine ignores any subsequent edits you make to that file. That would mean you would have to edit that file, start a new campaign, find out if the AI will behave to your liking and if not you will have to re-edit, start a new campaign and so on. That is too much work.

    It is possible you will get more Mongol armies by deleting anything referring to stage 5, but there are several parts of the campaign script that refer to stage 5 and you will have to be careful. It is better not to mess around unless you are experienced enough (and even then it is better not to mess around). Otherwise you may have unpredictable results, such as the campaign crashing halfway through and you may be unable to recover it. Your best bet is to pick a faraway faction like England with Gracul AI on very hard to get the most out of the Mongol invasion.

    If that is not enough and if you feel brave, also change the turn numbers for stage 5

    I_EventCounter mongols_invasion = 5

    Before you make any changes, back up the campaign script.

    Stage 5 I think comes at game turn 80 or 100, if I remember correctly. It is stated somewhere within the Mongol script. Make that 200 or something. You may want to check what stage 4 is and extend that to a later date, too. It may work, but considering the other factors involved, it may not. Remember that your changes will not take effect until you start a new campaign and may have unpredictable results, including crashing your game.

  11. #11

    Default Re: How to make mongol Ai continue attacking?

    I guess the fact that mongols lose most AI bonuses because of their scripted "decline" which basically cripples irremediably their economy. Has it's fair contribution to stop them being aggresive.

    In fact i think this scripted decline is just plain wrong, mongols should retain at least the basic AI financial help script so they don't go bankrupt forever, I don't think the Bugfix Compilation adresses this yet.

  12. #12

    Default Re: How to make mongol Ai continue attacking?

    It is not really a bug. If you play one of the Eastern factions it would be near hopeless if the Mongols were any stronger. I think I posted somewhere a campaign screenshot where on lifting the fog of war I counted 65 Mongol full stacks. To my mind that encourages cheating and using exploits.

    Defending your settlements against 65 full stacks is not really an option. Also the way I think the script works is that if the Mongols suffer a setback, such as losing a battle, they get a number of full stacks, so they keep multiplying as long as you are opposing them. The thing to do, knowing all this, would be to migrate to Cyprus or something and wait until the fury passes then start the campaign on game turn 100. Or make an alliance with the Mongols. Or use any other kind of exploit you can think of. If the strength of the Mongols lasted any longer, then most eastern factions would be near unplayable.

  13. #13

    Default Re: How to make mongol Ai continue attacking?

    I usually find that vigorously insulting their mothers gets them in the mood to start attacking.
    Honest and truly, I AM Robin Hood!

  14. #14
    Libertus
    Join Date
    Aug 2010
    Location
    Chicago
    Posts
    85

    Default Re: How to make mongol Ai continue attacking?

    Didn't Menth have a mod that did something like this? Kept the mongols moving west?

Posting Permissions

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