Results 1 to 2 of 2

Thread: AI help for config_ai_battle

Hybrid View

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

    Default AI help for config_ai_battle

    I am currently making a personal mod consisting of fights with pike/musket/cavalry/archer/heavy infantry armies. The army balance is nice, but battles seem to go the same way. ie: AI attacks straight down the middle - direct style! I was trying to alter the config_ai_battle stats to make the cavalry only engage the cavalry. Hopefully in the future I would have several scripts with different AI attack preferences and have a random switcher between them ie:
    option 1: cavalry vs cavalry, pike vs pike, musket vs musket, heavy infantry vs heavy infantry
    option 2: cavalry vs musket, pike vs pike, musket vs heavy infantry, heavy infantry vs musket
    option 3: cavalry vs heavy infantry, pike vs cavalry, musket vs heavy infantry, heavy infantry vs musket
    etcetc

    To effect this, I have tried to encourage cavalry to attack a row of pikes instead of a row of DFK by altering the following but I am unsure whether it has an effect (actually, it doesn't seem to have an effect).

    <melee-manager>
    <modifiers>
    <cavalry>
    <vs-pike-melee-strength-multiplier>9.05</vs-pike-melee-strength-multiplier>
    <vs-spearmen-melee-strength-multiplier>9.05</vs-spearmen-melee-strength-multiplier>
    and

    <melee-analyser>
    <unit-priority>
    <cavalry>
    <heavy>
    <vs-pike>5.0</vs-pike>
    <vs-spearmen>60.0</vs-spearmen>
    Is there a limit to this type of coding in terms of the figures?

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

    Default Re: AI help for config_ai_battle

    My investigation of this kind of code showed that it won't have an effect on the AI. The engine will ignore it at best. At worst it will break the section it is contained in and force the .exe to use internal defaults.

    You'd have to come up with some pretty amazing battle script to get what you want. Sorry but you will not achieve it via config_ai_battle.xml.

    Check out the historic battles' scripts in vanilla. I warn you though, you're probably looking at doing a huge amount of work if your goal stays the same. A single battle wouldn't be so difficult to script, but with campaign stuff you'd essentially be replacing the AI with one you've scripted.

    edit:

    It just occured to me you can do something like this:
    Code:
    		<outflank-analyser>
    			<unit-priority>
    				<vs-behind-stakes>100</vs-behind-stakes>
    				<vs-cavalry>200</vs-cavalry>
    It might help a little, units chosen for flanking are more often attacked. But revert to a vanilla config_ai_battle before proceeding, or at least one with none of that code in your post.
    Last edited by Taiji; September 13, 2010 at 08:22 AM.

Posting Permissions

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