Results 1 to 12 of 12

Thread: Skirmish Mode Optimisation

  1. #1
    Medusa0's Avatar Artifex
    Join Date
    Apr 2009
    Location
    Nowhere
    Posts
    379

    Default Skirmish Mode Optimisation

    Hello all, it has been a while, hope these findings are still useful for those who are still around.

    As we know however, the default skirmishing abilities for units in this title pales in comparison to that from Rome: Total War and its expansions (horse archers and chariots are nigh game breaking when used against the AI, and are frustrating to catch even for players), and ironically, foot javelin "skirmishers" even has that ability disabled by default.

    Skirmish mode in M2TW is actually very modifiable via a combination of battle_config.xml, export_descr_unit.txt (short-hand to EDU for the rest of the tutorial), and animation speeds. This tutorial will mostly cover the first two aspects, and briefly explain the third (partly due to its complexity, and resource limitation on my part).

    Backgrounds and explanations:
    Spoiler Alert, click show to read: 

    First, inside battle_config.xml, we could find some entries, helpfully labelled as skirmish configurations with some explanations.
    Code:
            <!-- skirmish configuration -->
            <skirmish>
                <infantry>
                    <default>
                        <!-- ignore targets at a distance greater than the maximum range times this scale factor -->
                        <max-range-scale>1.5</max-range-scale>
                        
                        <!-- must skirmish if within this range -->
                        <min-range>40</min-range>
                        
                        <!-- stop at this distance if the enemy is blocking the path -->
                        <min-stopping-range>50</min-stopping-range>
                        
                        <!-- time to react to being intercepted -->
                        <collision-reaction-time>8</collision-reaction-time>
                        
                        <!-- retreat buffer time -->
                        <retreat-time>12</retreat-time>
                        
                        <!-- don't skirmish until attackers are within this fraction of the missile range -->
                        <range-factor>
                            <moving>1.1</moving>
                            
                            <shooting>0.80</shooting>
                        </range-factor>
                    </default>
                    
                    <gunpowder>
                        <!-- ignore targets at a distance greater than the maximum range times this scale factor -->
                        <max-range-scale>1.5</max-range-scale>
                        
                        <!-- must skirmish if within this range -->
                        <min-range>40</min-range>
                        
                        <!-- stop at this distance if the enemy is blocking the path -->
                        <min-stopping-range>50</min-stopping-range>
                        
                        <!-- time to react to being intercepted -->
                        <collision-reaction-time>12</collision-reaction-time>
                        
                        <!-- retreat buffer time -->
                        <retreat-time>14</retreat-time>
                        
                        <!-- don't skirmish until attackers are within this fraction of the missile range -->
                        <range-factor>
                            <moving>1.15</moving>
                            
                            <shooting>0.80</shooting>
                        </range-factor>
                    </gunpowder>
                </infantry>
                
                <cavalry>
                    <default>
                        <!-- ignore targets at a distance greater than the maximum range times this scale factor -->
                        <max-range-scale>1.5</max-range-scale>
                        
                        <!-- must skirmish if within this range -->
                        <min-range>30</min-range>
                        
                        <!-- stop at this distance if the enemy is blocking the path -->
                        <min-stopping-range>50</min-stopping-range>
                        
                        <!-- time to react to being intercepted -->
                        <collision-reaction-time>8</collision-reaction-time>
                        
                        <!-- retreat buffer time -->
                        <retreat-time>12</retreat-time>
                        
                        <!-- don't skirmish until attackers are within this fraction of the missile range -->
                        <range-factor>
                            <moving>1.1</moving>
                            
                            <shooting>0.80</shooting>
                        </range-factor>
                        
                        <!-- reaction time for cantabrian circle -->                    
                        <cantabrian-reaction-time>20</cantabrian-reaction-time>
                    </default>
                    
                    <gunpowder>
                        <!-- ignore targets at a distance greater than the maximum range times this scale factor -->
                        <max-range-scale>1.5</max-range-scale>
                        
                        <!-- must skirmish if within this range -->
                        <min-range>30</min-range>
                        
                        <!-- stop at this distance if the enemy is blocking the path -->
                        <min-stopping-range>50</min-stopping-range>
                        
                        <!-- time to react to being intercepted -->
                        <collision-reaction-time>8</collision-reaction-time>
                        
                        <!-- retreat buffer time -->
                        <retreat-time>12</retreat-time>
                        
                        <!-- don't skirmish until attackers are within this fraction of the missile range -->
                        <range-factor>
                            <moving>1.1</moving>
                            
                            <shooting>0.80</shooting>
                        </range-factor>
                        
                        <!-- reaction time for cantabrian circle -->                    
                        <cantabrian-reaction-time>20</cantabrian-reaction-time>
                    </gunpowder>
                </cavalry>            
                
            </skirmish>
    (A useful note to know is that M2TW uses metres to calculate for its distance in both the EDU and battle_config.)

    From the get-go, we can see that the skirmishing parameters are divided into four unit categories: infantry default, infantry gunpowder, cavalry default, and cavalry gunpowder - this will be a very important part to making short-ranged cavalry skirmishers (javelins and pistols) effective later. Distances as mentioned can be considered as the radius from the "middle" of a unit, roughly where the banner appears on top of it. Let's go down each parameters one by one, as they interact with each others in many ways:
    Code:
    <max-range-scale>
    
    Is written as a multiplier, by default identical in all four unit categories as 1.5.  Defining the upper range, distance at which the unit can start running away from a threatening unit.
    Know that this is a "soft" number, in which the unit may not start skirmishing if it is firing a salvo or reloading.  This is a multiplier to the next line.
    When multiplied, should not yield a number greater than the missile range of the unit as defined in the EDU or the unit will never attack as it is constantly running!
    Default is 1.5 for all units.
    Code:
    <min-range>
    
    Is the only "hard" number in this case, and forces the unit to run away from the enemy if it is less than this distance from the skirmishing unit, overriding any other parameters.
    Multiply this number by <max-range-scale> to acquire the upper range.  Default is 40 for infantries, 30 for cavalries which is identical to that of the normal infantry charge distance.
    Setting it to a greater number yields much better results as the unit can start running before being charged, may prevent short-ranged units from ever attacking if set too high.
    Code:
    <min-stopping-range>
    
    This is almost exactly as written by the devs, the distance that the skirmishing unit considered itself to be "safe" from enemy units other than the one it has been targeting.
    This line is useful if the skirmishing unit go deep inside an enemy formation, but only the targeted unit is pursuing it as it consider other units to be less of a "threat".
    Default is 50 for all units.
    Code:
    <collision-reaction-time>
    
    A controversial line, popular AI mods such as ReallyBadAI set this value to zero, assuming instant reaction times from the unit's "AI", which actually cripples the skirmishing unit.
    In reality, this is a "smart" parameter for the unit to predict how soon an enemy unit will reach it in seconds based and how soon to start running away.
    Should be based on how fast the skirmishing unit as well as its missile range, so slower units with short ranges such as foot skirmishers will need a higher value than cavalry archers.
    Default is 8 seconds for non-gunpowder foot skirmishers, cavalry skirmishers both non-gunpowder and gunpowder. 12 seconds for foot gunpowder units.
    Code:
    <retreat-time>
    
    An interesting parameter as skirmishing units in M2TW actually skirmishes in "bursts", in that they re-evaluate their current safety state after each bursts of speed.
    While setting this to a low value such as 1 would make the unit much more agile, it actually affects when gunpowder units with "reload" animations will attempt to stop and reload.
    So having a large number here would actually benefit units such as infantry gunners, in which they should only attempt to reload when they are in a safe distance away from the enemy.
    Default is 12 seconds for all units.
    Code:
    <range-factor>, <moving>, <shooting>
    
    These are again multipliers, however they are based on the missile range of the unit as defined in the EDU. These are the distances at which a unit will turn around during skirmish mode.
    The <moving>, and <shooting> parameters is defined by the current status of the skirmishing unit, moving however only refers when the unit is not actively using its ranged attacks.
    Shooting is when the unit is either in its "reload" or "firing" states. Keep in mind that cavalry skirmishers are considered to be <shooting> if attacking on the move.
    It is important to know that this distance will actually be overrode by the actual distance covered by the skirmishing unit from <retreat-time> multiplied by its speed.
    Again, this is great for infantry gunners who may actually want to run a little out of the range of their weapon to reload before returning to attack again.
    Cavalry skirmishers should have a smaller multiplier than 1.0 for <shooting> than <moving> as it allows them to keep in range of their weapon while skirmishing.
    Code:
    <cantabrian-reaction-time>
    
    Only applies for cavalry skirmishers as they are the only ones capable of the ability.
    Appears to overrides the <collision-reaction-time> parameter for units currently in the shooting circle formation.  Time in seconds.
    Probably put in place as a balancing mechanic to make units using the Cantabrian circle more susceptible to melee as the ability allows for excellent missile evasion rates.
    Second is the EDU, as we know as the basis to most mods as it offers an easy access to unit attributes. Below are three typical missile unit with the relevant information highlighted in red:
    Code:
    type             Aztec Archers
    dictionary       Aztec_Archers      ; Aztec Archers
    category         infantry
    class            missile
    voice_type       Light
    banner faction   main_missile
    soldier          Aztec_Archers, 64, 0, 0.8
    attributes       sea_faring, hide_forest, can_withdraw, very_hardy, free_upkeep_unit
    move_speed_mod   1.3
    formation        1.2, 1.2, 2.4, 2.4, 4, square
    stat_health      1, 0
    stat_pri         7, 1, arrow, 140, 25, missile, missile_mechanical, piercing, none, 25, 1
    ;stat_pri_ex      0, 0, 0
    stat_pri_attr    no
    stat_sec         5, 1, no, 0, 0, melee, melee_blade, blunt, mace, 25, 1.2
    ;stat_sec_ex      0, 0, 0
    stat_sec_attr    no
    stat_pri_armour  2, 3, 5, leather
    ;stat_armour_ex   2, 0, 0, 0, 3, 5, 5, leather
    stat_sec_armour  0, 0, flesh
    stat_heat        0
    stat_ground      1, 2, 3, -2
    stat_mental      6, normal, trained
    stat_charge_dist 30
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 260, 60, 55, 135, 380, 4, 110
    armour_ug_levels 1
    armour_ug_models Aztec_Archers
    ownership        aztecs, slave
    era 0            aztecs
    era 1            aztecs
    era 2            aztecs
    ;unit_info        5, 5, 8
    recruit_priority_offset    15
    
    type             ME Hand Gunners
    dictionary       ME_Hand_Gunners      ; Hand Gunners
    category         infantry
    class            missile
    voice_type       Light
    banner faction   main_missile
    banner holy      crusade
    soldier          ME_Hand_Gunners, 56, 0, 0.8
    attributes       sea_faring, hide_forest, hardy, can_withdraw, gunpowder_unit, cannot_skirmish, gunmen
    formation        1.2, 1.2, 2.4, 2.4, 3, square
    stat_health      1, 0
    stat_pri         14, 3, hand_gun_bullet, 100, 15, missile, missile_gunpowder, piercing, none, musket_shot_set, 25, 1
    ;stat_pri_ex      0, 0, 3
    stat_pri_attr    ap
    stat_sec         9, 3, no, 0, 0, melee, melee_blade, piercing, sword, 25, 1
    ;stat_sec_ex      0, 0, 0
    stat_sec_attr    no
    stat_pri_armour  3, 4, 0, metal
    ;stat_armour_ex   3, 5, 0, 0, 4, 0, 0, metal
    stat_sec_armour  0, 0, flesh
    stat_heat        1
    stat_ground      1, 1, 0, -2
    stat_mental      8, normal, trained
    stat_charge_dist 30
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 550, 100, 60, 140, 580, 4, 210
    armour_ug_levels 2, 3
    armour_ug_models ME_Hand_Gunners, ME_Hand_Gunners_ug1
    ownership        moors, turks, timurids
    era 1            moors, turks, timurids
    era 2            moors, turks, timurids
    ;unit_info        9, 13, 7
    recruit_priority_offset    15
    
    type             Jinetes
    dictionary       Jinetes      ; Jinetes
    category         cavalry
    class            missile
    voice_type       Light
    banner faction   main_cavalry
    banner holy      crusade_cavalry
    soldier          Jinetes, 24, 0, 1
    mount            fast pony
    mount_effect     elephant -4, camel -4
    attributes       sea_faring, hide_forest, can_withdraw, cantabrian_circle
    formation        2, 4.4, 3, 6, 3, square
    stat_health      1, 0
    stat_pri         9, 2, cav_javelin, 60, 8, thrown, missile_mechanical, piercing, spear, 25, 1
    ;stat_pri_ex      0, 0, 0
    stat_pri_attr    ap, thrown
    stat_sec         7, 2, no, 0, 0, melee, melee_blade, piercing, sword, 25, 1
    ;stat_sec_ex      0, 0, 0
    stat_sec_attr    no
    stat_pri_armour  2, 4, 6, leather
    ;stat_armour_ex   2, 3, 0, 0, 4, 6, 6, leather
    stat_sec_armour  0, 0, flesh
    stat_heat        1
    stat_ground      0, 0, 0, 0
    stat_mental      5, normal, trained
    stat_charge_dist 45
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 640, 130, 65, 155, 640, 4, 190
    armour_ug_levels 1, 2
    armour_ug_models Jinetes, Jinetes_ug1
    ownership        spain, portugal, slave
    era 0            spain, portugal
    era 1            spain, portugal
    ;unit_info        7, 9, 12
    recruit_priority_offset    10
    The first highlighted line is category, followed by infantry (or cavalry in the Jinetes unit below), this line defines whether the unit is considered a foot unit or a mounted unit. Mounted missile units are allowed to attack while moving if "fire at will" is enabled in battle, or while they are moving as a result of a skirmish action while firing. Foot units may not use their ranged attacks while moving.

    The second line is an unique addition to M2TW after RTW, "move_speed_mod 1.3" is a special modifier for the designated unit for it to move at the multiplier of speed over other units that uses the same animation set, in this case covers 30% more ground in the same time. This is a very useful line for the optimisation as we will discuss later.

    The third unique highlighted number 140 is the "normal" maximum missile attack range for the "Aztec Archers" unit, that is, the distance at which the unit is allowed to make a ranged attack without taking into range modifiers such as elevations (where as generally, units in higher elevations can release their missiles as a longer range than units on flat grounds). This normal range is mainly used in the <range-factor> parameters in the battle_config file, but also interacts with other lines indirectly.

    The fourth highlighted word is gunpowder_unit, this is an unit attribute which makes the unit use the <gunpowder> parameters over <default> in the battle_config file as well as applying some hard-coded behaviour into the unit. A basic hard-coded behaviour is that the unit will have an extra "reload" animation after firing if the animation exists in the soldier's animation set. (An interesting design choice in M2TW is how gunpowder units pre-load their weapons, as opposed to crossbowmen, who keeps their weapons unloaded until just before they are ready to loose.)

    Fifth is cannot_skirmish, which dictates that the missile unit will not be able to engage in skirmish mode (nothing to stop manual control by the player of course). The devs likely implemented this for very short-ranged units such as foot javelin skirmishers, hand gunners, and grenadiers as a band-aid fix for them never using their ranged attacks due to skirmishing all the time rather than making them skirmish properly, we can get rid of this line completely once optimisation is complete.

    Sixth is cantabrian_circle attribute, only used for cavalries to engage in a rapidly spinning formation in battle to avoid missiles, unique, but not important to the optimisation process.

    The seventh and the last highlight is thrown, this is a special weapon attribute that makes the weapon disappear from the hand of the individual soldiers after the firing state. While this is great as eye candy, it is not so great for efficiency as the unit will take an extra ~2 seconds to "reload" after releasing a salvo, slowing down their fire rates significantly. Note that this attribute also gives the unit a great boost in damage versus elephant type units, as well as a different ranged attack cursor.

    Outside of battle_config.xml and the EDU, the speeds at which unit can discharge their weapon are largely decided by their animations, which is defined in descr_skeleton.txt. There are several lines of codes that does just that:
    Code:
    anim        attack_missile_ready
    anim        attack_missile_hold
    anim        attack_missile_release
    anim        attack_missile_reload
    anim        attack_missile_reload_extended
    Without working with the actual animation files themselves, the most that could be done is really the addition or the removal of lines (gunner animations with the reload/reload_extended lines removed are absolutely devastating), and the modification of "-if", or impact frames, which determines when the projectile is released at the defined frame in the animation. Animation files must be repacked after each modification, and the process is very involved, will not be covered here. (The animations themselves can also be sped up via a process known as SLERP.)

    Optimisations:
    Spoiler Alert, click show to read: 

    As we know, skirmish mode for javelin/naphtha grenade/hand gun armed infantry units are by default completely disabled, skirmish mode is broken for mounted javelin skirmishers as they will run away from an enemy before they get a chance to throw their missiles, and musketeers never get to finish reloading before running, even away from the slowest infantries, so here are what we can do to fix those issues:

    1. In the EDU, we give ALL skirmish capable, javelin armed infantry units a range and speed boost. Add the move_speed_mod line to any units desired, a multiplier of 1.15 (or 15% faster) is sufficient without making them too fast (comparatively, Aztec infantry units on average move at 30% faster than normal to make up for the fact that they do not have cavalries). Increase their missile range from 55 to 60. Remove cannot_skirmish. Optionally, remove the thrown weapon attribute for one more attack speed boost, but know that doing so will significantly decrease their performance against elephant, so it is far more preferable to sped up their animations instead!

    2. Increase grenadier/hive thrower unit range to 45 ~ 55. Remove cannot_skirmish and gunpowder_unit attributes. (May have to edit descr_projectile.txt to increase the velocity of their projectiles)

    3. Increase hand gunner unit range to 80 ~ 100. Remove cannot_skirmish.

    4. We are going to exploit the fact that there is an interesting quirk with cavalry units and the gunpowder_unit attribute - they never needed to stop moving to reload! We will apply the gunpowder_unit attribute to all short-ranged missile cavalries - namely javelin and pistol armed cavalries (Jinetes, Granadine Jinetes, and Reiters), and remove them from long-ranged missile cavalries (Camel Gunners). The short ranged missiles' ranges should be modified to be at least 50.

    5. Now modify battle_config to apply to the EDU settings. Below is an example of an optimised battle_config skirmish section for reference:
    Code:
            <skirmish>
                <infantry>
                    <default>
                        <!-- Optimised for javelin skirmishers, range = 60 -->
                        <max-range-scale>1.5</max-range-scale>
                        <min-range>36</min-range>
                        <min-stopping-range>80</min-stopping-range>
                        <collision-reaction-time>20</collision-reaction-time>
                        <retreat-time>10</retreat-time>
                        <range-factor>
                            <moving>0.6</moving>
                            <shooting>0.6</shooting>
                        </range-factor>
                    </default>
                    
                    <gunpowder>
                        <max-range-scale>2.0</max-range-scale>
                        <min-range>40</min-range>
                        <min-stopping-range>50</min-stopping-range>
                        <collision-reaction-time>12</collision-reaction-time>
                        <retreat-time>20</retreat-time>
                        <range-factor>
                            <moving>1.8</moving>
                            <shooting>1.8</shooting>
                        </range-factor>
                    </gunpowder>
    
    
                </infantry>
                
                <cavalry><!-- Generic mounted missiles with range greater than 100 -->
                    <default>
                        <max-range-scale>1.5</max-range-scale>
                        <min-range>45</min-range>
                        <min-stopping-range>50</min-stopping-range>
                        <collision-reaction-time>8</collision-reaction-time>
                        <retreat-time>12</retreat-time>
                        <range-factor>
                            <moving>1.1</moving>                        
                            <shooting>0.80</shooting>
                        </range-factor>                
                        <cantabrian-reaction-time>20</cantabrian-reaction-time>
                    </default>
                    
                    <gunpowder><!-- Since gunpowder_unit has a different effect when applied to cavalries (no rank firing), use it for mounted javelins, pistoliers, and repeating crossbows with their short ranges -->
                        <max-range-scale>2.0</max-range-scale>
                        <min-range>15</min-range>
                        <min-stopping-range>45</min-stopping-range>
                        <collision-reaction-time>8</collision-reaction-time>
                        <retreat-time>10</retreat-time>
                        <range-factor>
                            <moving>1.1</moving>                        
                            <shooting>0.95</shooting>
                        </range-factor>                                    
                        <cantabrian-reaction-time>15</cantabrian-reaction-time>
                    </gunpowder>
    
    
                </cavalry>            
                
            </skirmish>
    Basically, we are setting up non-gunpowder foot skirmishers to react rapidly to incoming threats, with a slightly-longer-than-infantry-charge-distance minimal skirmishing range, they can safely stay away, keeping ample buffering time (20 seconds) to predict movements in their direction, while their small range-factor and retreat times allow them to keep punishing slow moving infantries, such as spear walls at close ranges.

    Hand guns, arquebus, and musket armed infantries will tend to operate at long ranges, their high retreat times and range factors give them plenty of time to reload their slow weapons before firing again. (This is less optimised for hand gunners due to their short ranges, but equally slow reaction times)

    Normal missile cavalries such as horse archers, mounted crossbowmen, and long range gunners will be able to skirmish away even from other cavalries due to their increased minimal range, but reaction times are generally the same as before. Their longer ranges mean that a slightly longer shooting range-factor could be used.

    Short-ranged cavalries have been re-defined as gunpowder units, and will attempt to release their salvos close to the target with tiny minimal ranges, and will re-evaluate their distances more often with short retreat times so will be less likely to outrun the ranges of their weapons.

    Notes on animations
    Spoiler Alert, click show to read: 
    BM309K58SMERCH has made a great tutorial about this topic some times back: http://www.twcenter.net/forums/showt...-MS3D-for-M2TW

    The gist is that the SLERP Animation function of GOAT can be used to shorten (therefore speed up) certain animation files, making the unit that uses it much more responsive. An example animation that can be sped up without really affecting how the unit looks for javelin throwers/grenadiers in descr_skeleton is attack_missile_hold. In addition, the vanilla foot javelin throw animation is also mis-timed, so the -if for attack_missile_release can also be changed from 34 to 31.


    Thanks for reading, feel free to test out these changes and please let me know if there are improvements to make!
    Last edited by Medusa0; February 19, 2018 at 11:46 PM. Reason: Corrected notes about the thrown weapon attribute and added notes on animations.

  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,679
    Blog Entries
    35

    Default Re: Skirmish Mode Optimisation

    Great stuff, it will hopefully find use in mods.










  3. #3
    GRANTO's Avatar Domesticus
    Join Date
    Dec 2010
    Location
    glastonbury uk
    Posts
    2,201

    Default Re: Skirmish Mode Optimisation

    That all looks like good stuff, Great info +REP!

  4. #4
    Medusa0's Avatar Artifex
    Join Date
    Apr 2009
    Location
    Nowhere
    Posts
    379

    Default Re: Skirmish Mode Optimisation

    Quote Originally Posted by Gigantus View Post
    Great stuff, it will hopefully find use in mods.
    Thanks! Though hand gunners, even with their increased missile ranges, are still in an awkward spot with these changes as they will actually retreat far out of their attack ranges to reload, and have to walk back to release a second volley against slow infantries such as halberdiers (less problematic against units that could actually run to give chase ). It may even be useful to re-classify them as a non-gunpowder unit, but modify their missile release animation to include the reload animation, decrease their missile ranges, and ammo count as the entire unit will discharge their weapons instead of only a single rank...

    Will see what changes I could cook up.

    Edit:
    Just combined a few sets of hand gunner animation with GOAT to yield two different animation changes, below are the codes to add to descr_skeleton (don't forget to repack animations afterward if using them!). These should only be used for hand gunners without the gunpower_unit attribute as it will incorporate reloading into their attack cycle.
    Code:
    type        MTW2_Handgun_No_Reload
    parent        MTW2_Handgun
    
    anim        default                    data/animations/MTW2_Musket/MTW2_Musket_basepose.cas
    
    ; Load weapon before firing
    ;anim        attack_missile_ready            data/animations/MTW2_Handgun/MTW2_Handgun_attack_missile_reload_then_ready.cas                -fr        -evt:data/animations/MTW2_Handgun/MTW2_Handgun_attack_missile_reload_then_ready.evt
    ; Reload after firing
    anim        attack_missile_release            data/animations/MTW2_Handgun/MTW2_Handgun_attack_missile_release_then_reload.cas            -fr        -id:0.0, 1.5, 1.0    -if:3,     -evt:data/animations/MTW2_Handgun/MTW2_Handgun_attack_missile_release_then_reload.evt
    The file names should be fairly self-explanatory, the attack_missile_ready variation will let the gunner load a shot into their weapon, and then discharge their weapon (this is commented out as it makes the unit too slow to respond to incoming threat for my tastes), and the attack_missile_release variant will let them reload after release their payload instead.

    These changes are suitable for "skirmish" class of gunners, without rank fire (skirmish class will however give them a similar staggered firing style) and with decreased projectile accuracy to adjust their firepower at range.

    Download in attachment. Please feel free to test both variants out!
    Attached Files Attached Files
    Last edited by Medusa0; April 28, 2018 at 04:05 PM. Reason: Animation attachment added

  5. #5
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,566

    Default Re: Skirmish Mode Optimisation

    Great findings and +rep.

    Finally with this optomosed settenigs I got skrimishers I always wanted to be in my mod. Also with start_no_skrimishing and javelin range 45 and attribute prec and charge_distance 35 - I got correctly working prec-wearpon units, which launch their primary projectile wearpon and then run to attack the enemy.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  6. #6
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,566

    Default Re: Skirmish Mode Optimisation

    This great material also should definitely be replaced into AI Workshop.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  7. #7
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,566

    Default Re: Skirmish Mode Optimisation

    How do you think, do these settings actual when scripted BAI such as G5 works? Seems that from the moment when unit has been labeled engine has no influence on it and only script operators are executed.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  8. #8
    z3n's Avatar State of Mind
    Moderator Emeritus

    Join Date
    Aug 2011
    Posts
    4,636

    Default Re: Skirmish Mode Optimisation

    What script operators?
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  9. #9
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,566

    Default Re: Skirmish Mode Optimisation

    Such as in G5 code.

    I'll explain in another way. Just label AI army units in custom battle without any next commands and don't release labels. Attack them and what do you see? In my case they just stand on one place, I even hear marching sounds but units are fixed at starting position.

    That's why I suggested that labelled AI unit couldn't be managed by engine and ruled only by script until label release.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  10. #10
    z3n's Avatar State of Mind
    Moderator Emeritus

    Join Date
    Aug 2011
    Posts
    4,636

    Default Re: Skirmish Mode Optimisation

    I've got no insight into this, I always found labels must be released. In fact they mostly seem useless to me but I suspect that's because you have to use them exactly like they were in the historical battles.
    The AI Workshop Creator
    Europa Barbaroum II AI/Game Mechanics Developer
    The Northern Crusades Lead Developer
    Classical Age Total War Retired Lead Developer
    Rome: Total Realism Animation Developer
    RTW Workshop Assistance MTW2 AI Tutorial & Assistance
    Broken Crescent Submod (M2TW)/IB VGR Submod (BI)/Animation (RTW/BI/ALX)/TATW PCP Submod (M2TW)/TATW DaC Submod (M2TW)/DeI Submod (TWR2)/SS6.4 Northern European UI Mod (M2TW)

  11. #11
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,566

    Default Re: Skirmish Mode Optimisation

    Well, you may have seen in Germanicus labels are released only in the end of the battle. So entire battle in Germanicus mod is like historical one. It's not bad, it's just another way to improve AI behavior.

    But I believe that M2 engine has enough possibilities to be good itself, just with right numbers in .xml files.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  12. #12
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,566

    Default Re: Skirmish Mode Optimisation

    Important note - preparing my release of reboot of old Westeros project with XAI - those optimisations of battle_config from OP doesn't work alone if config_ai_battle works wrong. Spent 2 days for fixing battle_config for foot skirmishers while tried to set another version of config_ai_battle - and only then it works. You may try it yourself.

    Therefore it's an important finding, thanks to XAI anyway!

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

Posting Permissions

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