Results 1 to 3 of 3

Thread: Darth Tutorials

  1. #1

    Default Darth Tutorials

    battle_config.xml

    <combat-balancing>
    <missile-target-accuracy>
    <infantry>0.75</infantry>
    <cavalry>0.95</cavalry>
    <elephants>0.95</elephants>
    </missile-target-accuracy>

    <melee-hit-rate>0.55</melee-hit-rate>
    I increased the missile cavalry hit rate from 0,9 to 0,95. Small change, but it creates the exact impact I wanted to have, concerning my other battle stats.


    THIS IS EXTRA DARTH CODE ADDED
    <melee-hit-rate>
    <infantry>22.0</infantry>
    <cavalry>3.50</cavalry>
    <elephants>1.5</elephants>
    </melee-hit-rate>
    </combat-balancing>
    THIS IS EXTRA DARTH CODE ADDED


    During my creation of DarthMod, I risked to add these lines in order to control the melee hit rate individually for each weapon arm. It has worked!
    I increased the number of Infantry to 22.0. This creates much more effective infantry melees and more endurance against cavalry. Of course do not expect much against a super charge of heavy Knights.

    config_ai_battle.xml

    <melee-manager>
    <attack-dist-multiplier>10.0</attack-dist-multiplier>
    This is the range which the AI sees other units and interacts. I made it very large and I created a very good effect of proper AI reaction and defence preparation. I have not tested much, but this, together with some other aspects below, corrects a lot of Siege AI problems. Modders should try this idea. Together with the below:

    <open>
    <infantry>
    <max-engage-dist>
    <easy>1</easy>
    <medium>1</medium>
    <hard>1</hard>
    <very_hard>1</very_hard>
    </max-engage-dist>
    </infantry>
    <missile>
    <max-engage-dist>
    <easy>125</easy>
    <medium>125</medium>
    <hard>125</hard>
    <very_hard>125</very_hard>
    </max-engage-dist>
    </missile>
    <cavalry>
    <max-engage-dist>
    <easy>360</easy>
    <medium>450</medium>
    <hard>900</hard>
    <very_hard>900</very_hard>
    </max-engage-dist>
    </cavalry>
    THIS IS EXTRA DARTH CODE ADDED
    <general_unit>
    <max-engage-dist>
    <easy>5</easy>
    <medium>5</medium>
    <hard>5</hard>
    <very_hard>5</very_hard>
    </max-engage-dist>
    </general_unit>
    THIS IS EXTRA DARTH CODE ADDED

    </open>

    <settlement>
    <infantry>
    <max-engage-dist>
    <easy>10</easy>
    <medium>10</medium>
    <hard>10</hard>
    <very_hard>10</very_hard>
    </max-engage-dist>
    </infantry>
    <missile>
    <max-engage-dist>
    <easy>125</easy>
    <medium>125</medium>
    <hard>125</hard>
    <very_hard>125</very_hard>
    </max-engage-dist>
    </missile>
    <cavalry>
    <max-engage-dist>
    <easy>900</easy>
    <medium>900</medium>
    <hard>900</hard>
    <very_hard>900</very_hard>
    </max-engage-dist>
    </cavalry>
    </settlement>
    If you notice the values you will notice the following:
    -Infantry has a too small value, maybe the minimum possible for the effect.
    -Missile has much bigger values.
    -Cavalry has enormously bigger values
    -I created an extra general_unit behaviour AI slot code, to help him last longer. It works!

    The engage distance is the distance in which the AI will actually start to engage the target. So, by also increasing much more the AI visual attack scanner, I create the effect of AI to anticipate the target and attack on time than react as idle or in very small radius as before. (For example it will deploy the troop line that is not engaging with the correct facing opposite to human missile attacks coming from afar and not just stand there...)Cavalry is the military arm which will decide the battle at all situations if it is plenty and… heavy!
    Researching many years in Military History as a hobby and now as a part time job I know of the following: Military tactics of the Medieval Era were simple but involved careful examination of the ground in order to use the Heavy Cavalry properly and the usage of many types of infantry troops operating en mass. This is the effect I wanted to give and this is what you will get if you play some battles with DarthMod 1.4D 1.3 patch and this addon. The infantry will stay together as a solid heavy mass, seldomly separating in a lot of single blocks (typical vanilla setting) and the Cavalry will move around it to flank or support the attack. Battles will gain a character you have never withessed so far.

    AI will examine much better the situations and use his army like a true Medieval force. This is also enhanced by these new addons:

    <attack-brace>
    <distance>50.0</distance>
    <time-to-change-formation>0.1</time-to-change-formation>
    <time-to-phalanx>0.1</time-to-phalanx>
    <time-to-schiltrom>0.1</time-to-schiltrom>
    </attack-brace>
    THIS IS EXTRA DARTH CODE ADDED
    <defend-brace>
    <distance>100.0</distance>
    <time-to-change-formation>0.1</time-to-change-formation>
    <time-to-phalanx>0.1</time-to-phalanx>
    <time-to-schiltrom>0.1</time-to-schiltrom>
    </defend-brace>
    THIS IS EXTRA DARTH CODE ADDED
    I feel that this code affects the battle reaction time in a large proportion. It seems that it works as a “bar” which fills as the units engages and moves around and toggles after it finishes the distance and waits for the time interval. So by using a large distance you create a determination of frontal assault as they attack and by lowering the time intervals you give them fast pace reactions. Small values of distance especially with long intervals, create “scattering” (the common idiotic bug of vanilla).

    I added the extra code of defend-brace which adds to the melee mechanics as counter ratio of moves (as I feel it). I have added it in old versions of DarthMod, removed it from DarthMod 1.4D but use it now again, as I feel that it works perfectly!

    I remind that the above are alterations involving my own mod. Some negative values introduced in the previous version are abandoned here because they do not create so good effects although they can be used but create a more “layed back” stance of the troops. DarthMod uses many other innovations, not explained here, cooperating with the above. I tested the new effects only in my own mod and I recommend everybody who plays with it to add it, just for his own satisfaction.

    Expert modders should be able to read the above mentioned and adapt these ideas separately to their mods or try new values working better to them. I have been summoned with Xeryx’s spell, which will last for some time. So I will be around for conversation if you wish to.

  2. #2

    Default Re: Darth Tutorials

    As I have promised to my friend Xeryx I will look the pathfing matter and try to explain some sections I remember I had modded there:

    DarthMod uses these parameters for this code section:

    ; low load config
    load low
    {
    max_paths 6 ; maximum paths till shifting to the next loading
    total_nodes 600 ; total nodes allocated across all paths
    }

    ; medium load config
    load medium
    {
    max_paths 10 ; maximum paths till shifting to the next loading
    total_nodes 1000 ; total nodes allocated across all paths
    }

    ; high load config
    load high
    {
    max_paths 20 ; maximum paths till shifting to the next loading
    total_nodes 8000 ; total nodes allocated across all paths
    }

    ; low priority config
    priority low
    {
    budget 0.85 ; percentage of budget for these paths
    max_nodes 3000 ; maximum nodes per path
    max_zone_nodes 2000 ; maximum zone nodes per path
    }

    ; medium priority config
    priority medium
    {
    budget 0.88 ; percentage of budget for these paths
    max_nodes 35000 ; maximum nodes per path
    max_zone_nodes 12000 ; maximum zone nodes per path
    }

    ; high priority config
    priority high
    {
    budget 0.88 ; percentage of budget for these paths
    max_nodes 25000 ; maximum nodes per path
    max_zone_nodes 10000 ; maximum zone nodes per path
    }

    ; real time priority config
    priority real_time
    {
    budget 0.85 ; percentage of budget for these paths
    max_nodes 93000 ; maximum nodes per path
    max_zone_nodes 22000 ; maximum zone nodes per path
    }

    ; quick test priority config
    priority quick_test
    {
    budget 0.65 ; percentage of budget for these paths
    max_nodes 1200 ; maximum nodes per path
    max_zone_nodes 700 ; maximum zone nodes per path
    }
    }
    As I remember the pattern, I have understood that the game engine groups the automated patterns into 3 speed groups. The low is the low speed, the high is the Highest speed.

    This creates a realistic effect of movement so that not all troops to have the same speed and scatter depending their physical attributes or will to run as in real life.

    So by having a big ratio of High creates faster response but unrealistic visuals (Insect movement).
    I remember CA had a norm 1.0 for the budget allocation (proportionally give for example 20% Low, 50% Medium 30% High and then give some patterns.)
    I tested values and overrided the norm so that there is a trully random proportion of budget allocation of nodes each moment. Human cannot really see a computer like movement in DarthMod although...sometimes may witness too many troops being slow or the opposite, but never trace a predictable pattern.

    For this code:

    ; Heuristic configuration
    heuristic_configuration
    {
    invalid_zone_cost 4.0
    I kept the 4.0 because it creates a penalty for the AI not to choose an invalid or very difficult terrain and stuck. Bigger values may be better also.

    VERY IMPORTANT IS THE FOLLOWING:

    ; Movement configuration
    movement_configuration
    {
    formation_hold_distance 40.0
    DarthMod uses 40 as a value here... play with it and put it 10 for example. You will notice that cavalry charges are far less powerful because in the middle of their distance, AI will try to change facing....DarthMod uses 40 meters for charge for Cavalry (as default I can remember)... this is not a lucky number.

    Put the same number according to charge of your Mod's horses.


    silhouette_configuration
    {
    silhouette_ratio 0.86 ; Silhouette points are 75% of unit width(enabled)
    enabled yes
    }
    I have enabled also this to magnify the effect of Mass... be careful with this attribute. It may spoil all your stats.

    Also for the following sections for example here:

    unit_type_configuration
    {
    default
    {
    min_slope 15 ; minimum slope before penalty applies
    max_slope 40 ; maximum slope the unit can handle
    penalty 1.03 ; penalty per degree ; 1.5 for 40 degrees
    min_width 25.0 ; minimum width = 0m
    max_width -25.0 ; maximum width = 0m(paradox effect)

    content_costs
    {
    free 1.0
    obstructed inf
    water 1.1
    swamp 1.2
    tall_vegetation 1.2
    average_vegetation 1.1
    short_vegetation 1.0
    large_rocks 1.2
    small_rocks 1.2
    platform 1.0
    bridge_platform 1.0
    steep_terrain inf
    ford 1.1
    }
    }

    infantry
    {
    min_slope 15 ; minimum slope before penalty applies
    max_slope 45 ; maximum slope the unit can handle
    penalty 1.025 ; penalty per degree
    min_width 0.0 ; minimum width = 0m
    max_width 0.0 ; maximum width = 0m(paradox effect)

    content_costs
    {
    free 1.05
    obstructed inf
    water 1.1
    swamp 1.2
    tall_vegetation 1.0
    average_vegetation 1.0
    short_vegetation 1.0
    large_rocks 1.0
    small_rocks 1.0
    platform 1.1
    bridge_platform 1.1
    steep_terrain inf
    ford 1.2
    }
    }

    cavalry
    {
    min_slope 20 ; minimum slope before penalty applies
    max_slope 45 ; maximum slope the unit can handle
    penalty 1.021 ; penalty per degree
    min_width 15.0 ; minimum width = 0m
    max_width 45.0 ; maximum width = 0m(paradox effect)

    content_costs
    {
    free 0.6
    obstructed inf
    water 1.2
    swamp 1.2
    tall_vegetation 1.3
    average_vegetation 0.8
    short_vegetation 0.7
    large_rocks 1.2
    small_rocks 1.1
    platform 1.25
    bridge_platform 1.3
    steep_terrain inf
    ford 1.35
    }
    }
    DarthMod uses a "paradox" method of unit pathfinding radius.

    For example for the center troop behaviour I used:

    min_width 25.0 ; minimum width = 0m
    max_width -25.0 ; maximum width = 0m(paradox)
    I added extra code of max width and gave smaller values than the min!
    This creates the effect of units to move more randomly. As I have understood it, the default unit behaviour is set then are filtered the infantry, cavalry etc. So the stats on the default affect also the seperate stats of the infantry for example. The width determines how far is expected from a soldier of the unit to get afar from each other.(As I see it). So I created for example large probability of Horses to move around and scatter from the basic unit. For the infantry I wanted cohesion so I forced them to try to stick with each other and not scatter a lot.

    Also I gave different penalties to horses and different ground penalties.
    This are creating an ENORMOUSLY different AI. Cavalry becomes even more powerful (secret DarthMod stat) and AI also uses terrain more efficiently.

    Compare the ground penalties between Infantry and Cavalry for instance. AI cavalry will not choose as a 1st option to get in the woods because it has a secret penalty. In terrains it has huge advantage (real life) and this is how the AI will choose the node. Infantry has an all around balance.
    Try playing with these values by keeping your battle stats the same.

    You will see what I am saying.

    End of small tutorial...out

  3. #3

    Default Re: Darth Tutorials

    Continuing my commentation:

    In the XAI mod I have noticed:

    Quote:
    <settlements>
    <inside-gate-dist>20</inside-gate-dist>
    <surprise-attack>
    <units-per-wall>2</units-per-wall>
    <!--percentage of units to try and place on the walls of the settlement -->
    <percent-on-walls>0.2</percent-on-walls>
    <!--percentage of units that are randomly scattered -->
    <percent-scattered>0.8</percent-scattered>
    <!--bias towards defenders -->
    <defender-bias>0.1</defender-bias>
    <!--controls the spread of the units along the wall as a percentage of unit width -->
    <unit-spread>10.0</unit-spread>
    </surprise-attack>
    <expected-attack>
    <units-per-wall>3</units-per-wall>
    <!--percentage of units to try and place on the walls of the settlement -->
    <percent-on-walls>0.6</percent-on-walls>
    <!--percentage of units that are randomly scattered -->
    <percent-scattered>0.4</percent-scattered>
    <!--bias towards defenders -->
    <defender-bias>0.2</defender-bias>
    <!--controls the spread of the units along the wall as a percentage of unit width -->
    <unit-spread>10.0</unit-spread>
    </expected-attack>
    </settlements>
    All stats are according to preference of the modder. What I do not recommend is the <defender-bias>X</defender-bias>.(Given by default vanilla 0.1 and 0.2)
    By putting there 0.1 for example is giving 10% enhance of their battle stats. It may have a sense because the defenders should have an advantage but...why to have a "God" gift without reason?
    -This makes the attacking AI even more useless in its attack against Human.
    -The handicaps are already obvious since the attacker is showered by archery, has to climp and attack in narrow battlements etc.

    So no reason to have a stat there.

    The biggest topic is here of course:

    In DarthMod I have:

    Quote:
    <retreat-analyser>
    <retreat-counter>
    <easy>150</easy>
    <medium>130</medium>
    <hard>120</hard>
    <very_hard>100</very_hard>
    </retreat-counter>
    <retreat-point>
    <default>
    <distance>30</distance>
    </default>
    <cavalry>
    <multiplier>1.5</multiplier>
    </cavalry>
    </retreat-point>
    </retreat-analyser>

    A lot has been said about this AI code. Here is my explaination which may all help you (As I remember when I modded it):

    This code handles the way that units receive morale penalties making them to rout or ... vice versa morale benefits to make them rally.
    I repeat.... 1 stat for 2 Opposite Factors.

    In plain words:
    The <retreat-counter> is the "Acceleration Bar" which gives the 0-100% morale strength of each unit.
    The <retreat-point> is something like a point which handles the Line of Battle. AI units will try to form around it as it seems and rally while trying to do fake attacks from this base.

    Also each unit has its own morale stats which work as the base to all this.

    The bigger is the acceleration bar, the more time it takes to rout and.... rally.(Small values create the back and forth retreat-rally, Big values give more rout endurance but will not rally easily... probably retreat for ever.)
    The bigger it is the retreat point, so much away from the heat of battle is set the rally point which AI struggles to maintain... it affects AI behaviour as I have seen)

    In DarthMod I use a default retreat point, same to Human and AI (?).

    In XAI I noticed there is extra code, distinguishing difficulty levels.
    First of all Bravo to Xeryx for being valiant to test extra code, secondly I feel that it should work but I cannot verify for the time being.


    Quote:
    <retreat-analyser>
    <retreat-counter>
    <default>
    <easy>60</easy>
    <medium>75</medium>
    <hard>115</hard>
    <very_hard>130</very_hard>
    </default>
    </retreat-counter>
    <retreat-point>
    <default>
    <distance>
    <easy>50</easy>
    <medium>45</medium>
    <hard>40</hard>
    <very_hard>35</very_hard>
    </distance>
    </default>
    <cavalry>
    <multiplier>2.5</multiplier>
    </cavalry>
    </retreat-point>
    </retreat-analyser>
    Now for my proposal:

    Quote:
    <retreat-analyser>
    <retreat-counter>
    <easy>150</easy>
    <medium>130</medium>
    <hard>120</hard>
    <very_hard>100</very_hard>
    </retreat-counter>
    <retreat-point>
    <default>
    <distance>5</distance>
    </default>
    <infantry>
    <multiplier>0.0</multiplier>
    </infantry>
    <general_unit>
    <multiplier>1.0</multiplier>
    </general_unit>
    <cavalry>
    <multiplier>5.0</multiplier>
    </cavalry>
    <missile>
    <multiplier>20.0</multiplier>
    </missile>
    </retreat-point>
    </retreat-analyser>

    <outflank-analyser>
    <unit-priority>
    <cavalry-vs-phalanx>10</cavalry-vs-phalanx>
    <vs-infantry>90.0</vs-infantry>
    <vs-routers>2.0</vs-routers>
    <behind-stakes>0.0</behind-stakes>
    </unit-priority>
    </outflank-analyser>
    These are the new settings I am currently testing and work tremendously great to DarthMod 1.4D. (I will make available soon for the public)

    I have put much smaller distance and a special infantry multiplier for compensation because I increased too much the Cavalry multiplier.
    This causes the effect of the AI battle line to be thin around the player and the cavalry to have the special freedom.

    Watch the new settings of the outflank analyser... just copy paste them to any mod...they work brilliantly because they create the effect of:
    1)Stakes avoid (as much as possible)
    2)Whole AI army tries to flank the main infantry body of the Human player
    3)AI Heavy Cavalry and Infantry now advances together and the missiles are a free body because are not mentioned in the code.

    The proportions I use are easy to understand for a Mod creator but I will explain later if I can.

    Try them in your mods and tell me.
    This setting is causing very cautious AI envelopment in my opinion

    I used the xeryx gta code, I am not sure if it is the vanilla code but I trusted it worked OK after the Siths have tested so much.

    Next I tested the extra code in outflank analyser....they are not placebo effect. They work very very well and once again bravo to the Darth Team. I tested the code to my mod and they certainly had an impact. So I cannot understand why some have not seen that until now.

    But...
    I think that the infantry lines must be dropped because they cause infantry to lose the en mass capability and try to attack like maniples which is not historically correct and also break the infantry to small pieces trying to flank or chase cavalry.

    I propose this code:

    <outflank-analyser>
    <unit-priority>
    <general_unit-vs-general_unit>10.0</general_unit-vs-general_unit>
    <general_unit-vs-heavy-cavalry>40.0</general_unit-vs-heavy-cavalry>
    <general_unit-vs-light-cavalry>30.0</general_unit-vs-light-cavalry>
    <general_unit-vs-missile-cavalry>40.0</general_unit-vs-missile-cavalry>
    <general_unit-vs-heavy-infantry>60.0</general_unit-vs-heavy-infantry>
    <general_unit-vs-light-infantry>20.0</general_unit-vs-light-infantry>
    <general_unit-vs-missile-infantry>10.0</general_unit-vs-missile-infantry>
    <general_unit-vs-spearmen>75.0</general_unit-vs-spearmen>
    <general_unit-vs-phalanx>90.0</general_unit-vs-phalanx>
    <general_unit-vs-schiltrom>65.0</general_unit-vs-schiltrom>
    <general_unit-vs-shield_wall>80.0</general_unit-vs-shield_wall>
    <heavy-cavalry-vs-heavy-cavalry>30.0</heavy-cavalry-vs-heavy-cavalry>
    <heavy-cavalry-vs-light-cavalry>35.0</heavy-cavalry-vs-light-cavalry>
    <heavy-cavalry-vs-missile-cavalry>30.0</heavy-cavalry-vs-missile-cavalry>
    <heavy-cavalry-vs-heavy-infantry>45.0</heavy-cavalry-vs-heavy-infantry>
    <heavy-cavalry-vs-light-infantry>55.0</heavy-cavalry-vs-light-infantry>
    <heavy-cavalry-vs-missile-infantry>10.0</heavy-cavalry-vs-missile-infantry>
    <heavy-cavalry-vs-spearmen>70.0</heavy-cavalry-vs-spearmen>
    <heavy-cavalry-vs-phalanx>65.0</heavy-cavalry-vs-phalanx>
    <heavy-cavalry-vs-schiltrom>70.0</heavy-cavalry-vs-schiltrom>
    <heavy-cavalry-vs-shield_wall>80.0</heavy-cavalry-vs-shield_wall>
    <light-cavalry-vs-heavy-cavalry>70.0</light-cavalry-vs-heavy-cavalry>
    <light-cavalry-vs-light-cavalry>10.0</light-cavalry-vs-light-cavalry>
    <light-cavalry-vs-missile-cavalry>35.0</light-cavalry-vs-missile-cavalry>
    <light-cavalry-vs-heavy-infantry>65.0</light-cavalry-vs-heavy-infantry>
    <light-cavalry-vs-light-infantry>20.0</light-cavalry-vs-light-infantry>
    <light-cavalry-vs-missile-infantry>10.0</light-cavalry-vs-missile-infantry>
    <light-cavalry-vs-spearmen>80.0</light-cavalry-vs-spearmen>
    <light-cavalry-vs-phalanx>85.0</light-cavalry-vs-phalanx>
    <light-cavalry-vs-schiltrom>80.0</light-cavalry-vs-schiltrom>
    <light-cavalry-vs-shield_wall>80.0</light-cavalry-vs-shield_wall>
    <missile-cavalry-vs-heavy-cavalry>80.0</missile-cavalry-vs-heavy-cavalry>
    <missile-cavalry-vs-light-cavalry>20.0</missile-cavalry-vs-light-cavalry>
    <missile-cavalry-vs-missile-cavalry>25.0</missile-cavalry-vs-missile-cavalry>
    <missile-cavalry-vs-heavy-infantry>60.0</missile-cavalry-vs-heavy-infantry>
    <missile-cavalry-vs-light-infantry>30.0</missile-cavalry-vs-light-infantry>
    <missile-cavalry-vs-missile-infantry>10.0</missile-cavalry-vs-missile-infantry>
    <missile-cavalry-vs-spearmen>70.0</missile-cavalry-vs-spearmen>
    <missile-cavalry-vs-phalanx>90.0</missile-cavalry-vs-phalanx>
    <missile-cavalry-vs-schiltrom>90.0</missile-cavalry-vs-schiltrom>
    <missile-cavalry-vs-shield_wall>90.0</missile-cavalry-vs-shield_wall>
    <behind-stakes>80.0</behind-stakes>
    <vs-heavy-infantry>55.0</vs-heavy-infantry>
    <vs-light-infantry>30.0</vs-light-infantry>
    <vs-missile-infantry>20.0</vs-missile-infantry>
    <vs-spearmen>65.0</vs-spearmen>
    <vs-routers>20.0</vs-routers>

    I just removed the special lines of infantry and together with my proposal of retreat analyser code they create (in my mod) a very solid mass of infantry and excellent cavalry and missile support, not seen before as I can remember.

    It depends from the mod of course.

Posting Permissions

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