Results 1 to 13 of 13

Thread: Make All AI units just rush me?

Hybrid View

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

    Default Make All AI units just rush me?

    Please explain to me how to make the AI do this very simple thing.

    Battle starts.
    ALL AI units just rush me.
    The end.

    I don't want them to protect the center of their settlement during a siege.
    I don't want them to sit on the other side of the bridge while my archers rain hell down on them.
    I don't want the AI to consider how weak/strong I am.
    I don't want the AI to do anything but rush ALL units into their attack range and swarm me.

    PLEASE.
    THANKS.
    Last edited by shinyhalo; June 08, 2009 at 11:07 AM.

  2. #2
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: Make All AI units just rush me?

    Moved to Text Editing and Scripting. If you aren't posting a tool or a tutorial please don't post a new thread in the tutorial section.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  3. #3

    Default Re: Make All AI units just rush me?

    bump to make my game not boring...
    Every battle = 0-10 losses for me, 1000+ losses for AI

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

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

    Default Re: Make All AI units just rush me?

    To my knowledge battle scripting only works for historical battles. If someone has made battle scripting monitors work effectively in the campaign_script then I've never seen it and I've looked in a lot of mod scripts. If it IS possible, that opens up a lot of potential in the area you're referring to. I haven't delved much into battle scripting though, but my understanding is it hinges on declaring 'unit labels' which would be seemingly impossible for an every battle kind of thing.

    So the short answer is there's no way to do that. Long answer is it may be possible with Battle AI modifications or battle scripting but I've yet to see it.

  5. #5

    Default Re: Make All AI units just rush me?

    Doesn't Germanicus' shieldwall script function in campaign_script?

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

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

    Default Re: Make All AI units just rush me?

    Quote Originally Posted by redxavier View Post
    Doesn't Germanicus' shieldwall script function in campaign_script?
    Not familiar with it. If you can link me to the appropriate mod then I could find out.

  7. #7

    Default Re: Make All AI units just rush me?


  8. #8
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Make All AI units just rush me?

    Shinyhalo, you can do all that in config_ai_battle.xml, just play aropund with it.

    I've seen that kind of AI before but I think it's crap so I didn't pay much attention, or I'd be able to give you more advice.

    You can check out my bai, most of it is in a tiny update on the first post of the thread linked in my sig. The point you make about siege defence is covered well but in many circumstances the other points would cripple the ai commander in DLV.

    Some people seem to think that you can just drop AI from one mod into another and expect great results - flawed thinking. BAI is tuned for unit balance and so must be playtested and tweaked over and over to get it right.

    Even so, solving one problem often creates another. BAI design is mostly a process of choosing the lesser of 2 evils. I'm not being pessimistic I'm just noting that the ideal is unachieveable with the means available.

    Good luck with your modding

    edit: BTW about scripting AI troops, the BAI needs turning off to manage this which means you need a script which doesn't cripple the AI... a script which is better than or as good as the AI in response to the players actions... yeah, good luck making that script...

    Germanicu5' stakes script is brilliant but it only works well because it fires at the start of the battle when the AI is far enough away from you to not suffer badly from having it's 'brain' disabled.

    Here's my modified version of it where I force the enemy to change formation before deployment. From the moment 'ai_active_set off' fires the enemy is utterly passive until 'ai_active_set on' fires. Because it takes around a minute for the script to complete a skilled player can charge the AI army with cav and hit them just before the stakes deploy... if prepared and lucky. So anyway here it is:

    monitor_event BattleConflictPhaseCommenced FactionIsLocal
    and I_BattlePlayerArmyIsAttacker
    and ! I_ConflictType Siege
    and ! I_ConflictType SuccessfulAmbush
    and I_BattleEnemyArmyNumberOfAttribute stakes > 0
    and I_BattlePlayerArmyNumberOfUnitCategory cavalry > 0
    and I_BattleEnemyArmyNumberOfUnitCategory cavalry < 1

    prepare_for_battle

    ;;;Player general
    label_unit 0 0 0 General1

    ;;;AI general
    label_unit 1 0 0 General2

    label_unit 1 0 1 unit20
    label_unit 1 0 2 unit21
    label_unit 1 0 3 unit22
    label_unit 1 0 4 unit23
    label_unit 1 0 5 unit24
    label_unit 1 0 6 unit25
    label_unit 1 0 7 unit26
    label_unit 1 0 8 unit27
    label_unit 1 0 9 unit28
    label_unit 1 0 10 unit29
    label_unit 1 0 11 unit30
    label_unit 1 0 12 unit31
    label_unit 1 0 13 unit32
    label_unit 1 0 14 unit33
    label_unit 1 0 15 unit34
    label_unit 1 0 16 unit35
    label_unit 1 0 17 unit36
    label_unit 1 0 18 unit37
    label_unit 1 0 19 unit38

    define_unit_group army2 General2 unit20 unit21 unit22 unit23 unit24 unit25 unit26 unit27 unit28 unit29 unit30 unit31 unit32 unit33 unit34 unit35 unit36 unit37 unit38

    ai_active_set off

    unit_group_order_change_group_formation army2 ordered_triple_line_1 run

    battle_wait 50

    unit_group_order_halt army2

    unit_deploy_stakes General2
    unit_deploy_stakes unit20
    unit_deploy_stakes unit21
    unit_deploy_stakes unit22
    unit_deploy_stakes unit23
    unit_deploy_stakes unit24
    unit_deploy_stakes unit25
    unit_deploy_stakes unit26
    unit_deploy_stakes unit27
    unit_deploy_stakes unit28
    unit_deploy_stakes unit29
    unit_deploy_stakes unit30
    unit_deploy_stakes unit31
    unit_deploy_stakes unit32
    unit_deploy_stakes unit33
    unit_deploy_stakes unit34
    unit_deploy_stakes unit35
    unit_deploy_stakes unit36
    unit_deploy_stakes unit37
    unit_deploy_stakes unit38

    unit_group_order_change_group_formation army2 triple_missiles_in_front run

    release_unit General2
    release_unit unit20
    release_unit unit21
    release_unit unit22
    release_unit unit23
    release_unit unit24
    release_unit unit25
    release_unit unit26
    release_unit unit27
    release_unit unit28
    release_unit unit29
    release_unit unit30
    release_unit unit31
    release_unit unit32
    release_unit unit33
    release_unit unit34
    release_unit unit35
    release_unit unit36
    release_unit unit37
    release_unit unit38

    ai_active_set on

    end_monitor

    Like I say this is just a modified version of Germanicu5' original, I might never have discovered this by myself, he deserves full credit.
    Last edited by Taiji; June 16, 2009 at 06:53 AM.

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

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

    Default Re: Make All AI units just rush me?

    That's definitely an interesting script. So in regards to the function of labels used in the campaign script, it seems like it's only possible to give general orders? Like all units are labeled generally and given a general order to deploy stakes and change formation. Beyond knowing exactly the composition of an army(as in a scripted historical battle) is there then no way to determine what type each unit is before labeling it and giving it specific orders? This is the sort of thing I'm looking into at the moment so any knowledge of campaign battle scripting experiences that could be imparted is appreciated.

    I'm also curious what the '!' signs are used for. I've never seen them before. I assume that it's always true that the player alliance is 0 and the AI alliance is 1(or does it have to do with who is attacking and who is defending?). Beyond that it seems harder to determine if more than one army on either side come into play.
    Last edited by Augustus Lucifer; June 19, 2009 at 12:40 AM.

  10. #10
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Make All AI units just rush me?

    It might be possible to label them by type but I can't see a way of doing it.

    I believe '!' is an alternative to 'not'. In the script above it prevents the script firing if it's a siege battle or ambush defence.

  11. #11
    xeryx's Avatar Follow the White Rabbit
    Join Date
    Nov 2006
    Location
    Wyoming, Usa
    Posts
    4,337

    Default Re: Make All AI units just rush me?

    NM
    Last edited by xeryx; June 22, 2009 at 07:02 PM.
    Proudly patronized by B. Ward Click Sig Logo for Downloads, Click forums here and here
    "Do not try and bend the spoon, that is impossible, instead only try and realize the truth.
    There is no spoon, and you will see, it is not the spoon that bends, only yourself."-The Matrix


  12. #12

    Default Re: Make All AI units just rush me?

    Bump. Still need an AI that ignores all other factors and just rushes all units at me. I thought this would be simple...
    Thanks

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

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

    Default Re: Make All AI units just rush me?

    Quote Originally Posted by shinyhalo View Post
    Bump. Still need an AI that ignores all other factors and just rushes all units at me. I thought this would be simple...
    Thanks
    Take a look at the campaign AI file in the Britannia campaign. They have a couple AI Labels that activate later in the campaign which tell the AI to focus on the player to prevent you from achieving victory. Tweak it some and it could probably do what you're looking for. This is just Campaign AI though, for Battle AI there doesn't seem to be something of this nature.

Posting Permissions

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