Page 3 of 3 FirstFirst 123
Results 41 to 57 of 57

Thread: MTW2 Battle Scripting

  1. #41
    bitterhowl's Avatar Biarchus
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    609

    Default Re: MTW2 Battle Scripting

    And one more suggestion - maybe someone already tryed this way - if we create many formations with same name and same priorty but each one has different faction_specific parameter. Will the engine match formation to faction in that case or only first in the list to all factions?

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  2. #42
    z3n's Avatar State of Mind
    Patrician Artifex Modding Staff Director

    Join Date
    Aug 2011
    Posts
    3,643

    Default Re: MTW2 Battle Scripting

    From what I remember I tried that way (using multiple versions of the triple missiles) but it didn't really work for me. Maybe I just wasn't doing it the right way though?


    I also find such gta_plan as defend_terrain_featured and some strange parameters as "defending_forest" "defending_foggy" "defending_steppy_hill". And much more interesting "key_battle", "we_elephants"/"they_elephants" "we_missile_overpower"/"they_missile_overpower" etc. I can post full list of this tomorrow. I doubt it 100% tied with gta_plans but why not?
    I thought about what you said here and would appreciate the full list, but can these be used with the scripting commands in any way? Or do you think they are only for within the XML?


    It seems like defend_terrain_featured is some kind of function name with the parameters of the following. Maybe boolean ones which are either true or false? Idk, just guessing.

    I don't think we can really change that directly via scripts but I could be thinking about it the wrong way.
    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)

  3. #43
    bitterhowl's Avatar Biarchus
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    609

    Default Re: MTW2 Battle Scripting

    For my experience of last week tests - deep xml customizing such as you did for EB2 without additional BAI scripts does rather good performance. Seems that all we want to script already present in game engine - my cavalry mostly avoid spearmen and now always attack from flank or rear. Initial formation keeps untouched before the very battle contact with enemy. So I hope that detailed xml coding is enough for good battle behavior, as in early era of Dart Vader's times.

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  4. #44
    z3n's Avatar State of Mind
    Patrician Artifex Modding Staff Director

    Join Date
    Aug 2011
    Posts
    3,643

    Default Re: MTW2 Battle Scripting

    Yeah I actually wanted 0 battle ai scripts because I noticed they can cause crashes after battles. I ended up going with an extremely minimalist script but I'm still not 100% keen on battle scripts in general.


    Really the battle scripts are only there because I wanted to challenge myself by making the AI attack me whenever I sat there and pelted them with 10 archer units (and they never reacted). That's the only part of the script that's really worth it.
    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)

  5. #45
    bitterhowl's Avatar Biarchus
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    609

    Default Re: MTW2 Battle Scripting

    So here is the list of gta_plans
    Code:
    ATTACK_SETTLEMENT   
    SUPPORT_DEFEND_SETTLEMENT   
    DEFEND_SETTLEMENT   
    SCOUT   
    DEFEND_LINE ASSAULT_CROSSING    
    DEFEND_CROSSING 
    DEFEND_TERRAIN_AREA 
    DEFEND_TERRAIN_FOREST   
    DEFEND_TERRAIN_HILL 
    ATTACK_ENEMY_BATTLEGROUP    
    MOVE_TO_POINT
    Here is interesting thing - seems like some kind of operators to strat level for army
    Code:
    do_nothing  
    move_to_region  
    patrol_region   
    merge_armies    
    attack_settlement   
    attack_enemy
    I've interested in merging command - it's very helpful for gathering armies together. I still get multi-single-unit stacks on strat.

    And here is something like Battle analyzer parameters?
    Code:
    BATTLE_TYPE 
    CHEERING_3  
    CHEERING_2  
    CHEERING_1  
    CHEERING    
    STRATEGIC_SITUATION 
    ENEMY_ALLIES    
    ENEMY_ID    
    ALLIES  
    VNV_OPENING 
    ATTACKING_A_CRUSADE_TARGET  
    ATTACKING_A_MAJOR_CASTLE    
    DEFENDING_A_MAJOR_CASTLE    
    ATTACKING_A_MAJOR_CITY  
    LAST_STAND_FOR_OUR_ALLY 
    LAST_STAND_FOR_THEM 
    LAST_STAND_FOR_US   
    VITAL_BATTLE_FOR_THEM   
    VERY_IMPORTANT_BATTLE_FOR_THEM  
    IMPORTANT_BATTLE_FOR_THEM   
    VITAL_BATTLE_FOR_US 
    VERY_IMPORTANT_BATTLE_FOR_US    
    IMPORTANT_BATTLE_FOR_US 
    KEY_BATTLE  
    FIELD_BATTLE_IN_ENEMY_TERRITORY 
    FIELD_BATTLE_IN_OWN_TERRITORY   
    DEFENDING_A_MAJOR_CITY  
    AMBUSH_DEFENCE  
    AMBUSH_ATTACK   
    RIVER_DEFENCE   
    RIVER_ATTACK    
    SIEGE_RELIEVING 
    SIEGE_DEFENCE   
    SIEGE_ASSAULT   
    FIELD_DEFENCE   
    FIELD_ATTACK    
    fears   
    hates   
    NEUTRAL 
    HATES   
    FEARS   
    ATTACKING_MULTI_RING_CASTLE 
    DEFENDING_MULTI_RING_CASTLE 
    ATTACKING_WOODS 
    DEFENDING_WOODS 
    ATTACKING_STEEP_HILLS   
    DEFENDING_STEEP_HILLS   
    ATTACKING_HILLS 
    DEFENDING_HILLS 
    FINE__DESERT__ATTACKING 
    FOGGY__ATTACKING    
    FOGGY__DEFENDING    
    RAINING__THEY_HAVE_MORE_MISSILES    
    FINE_WEATHER__THEY_HAVE_MORE_MISSILES   
    RAINING__WE_HAVE_MORE_MISSILES  
    FINE_WEATHER__WE_HAVE_MORE_MISSILES 
    WE_ELEPHANTS    
    THEY_ELEPHANTS  
    WE_GUNPOWDER    
    THEY_GUNPOWDER  
    WE_HEAVILY_ARMOURED_2   
    THEY_HEAVILY_ARMOURED_2 
    WE_HEAVILY_ARMOURED_1   
    THEY_HEAVILY_ARMOURED_1 
    WE_CANNONS  
    THEY_CANNONS    
    THEY_LOTS_OF_CAVALRY_4  
    WE_LOTS_OF_CAVALRY_3    
    THEY_LOTS_OF_MISSILES   
    WE_LOTS_OF_MISSILES 
    THEY_ELEPHANTS_3    
    WE_ELEPHANTS_1  
    THEY_ELEPHANTS_2    
    THEY_ELEPHANTS_1    
    WE_LOTS_OF_CAVALRY_2    
    WE_LOTS_OF_CAVALRY_1    
    THEY_LOTS_OF_CAVALRY_3  
    THEY_LOTS_OF_CAVALRY_2  
    THEY_LOTS_OF_CAVALRY_1  
    NEVER_WON_A_BATTLE_AGAINST_THEM 
    LOST_LAST_BATTLE_AGAINST_THEM   
    NEVER_LOST_AGAINST_THEM 
    FOUGHT_THEM_BEFORE_A_LOT    
    FOUGHT_THEM_BEFORE_A_BIT    
    NOT_FOUGHT_THEM_BEFORE

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  6. #46
    z3n's Avatar State of Mind
    Patrician Artifex Modding Staff Director

    Join Date
    Aug 2011
    Posts
    3,643

    Default Re: MTW2 Battle Scripting

    Hey, that really is interesting! I wonder how to implement that merge command... Does it give any hint or is it associated with gta_plan? Meaning that command could potentially be used on the strat map?


    Maybe it requires armies to be labelled before you can merge them?
    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)

  7. #47
    bitterhowl's Avatar Biarchus
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    609

    Default Re: MTW2 Battle Scripting

    Code:
    AVAI_CAMPAIGN_OBJECTIVE 
    AVAI_CAMPAIGN_MISSION   
     AVAI_DO_NOTHING 
     AVAI_MOVE_TO_POSITION   
     AVAI_ATTACK_ARMY    
     AVAI_ATTACK_SALLY_FORTH 
     AVAI_DISEMBARK  
     AVAI_BUILD_FORT 
     AVAI_BUILD_WATCHTOWER   
     AVAI_CAMPAIGN_OBJECTIVE_MERGE_ARMY  
     AVAI_CAMPAIGN_OBJECTIVE_SPLIT_ARMY  
     AVAI_CAMPAIGN_OBJECTIVE_SPLIT_GARRISON  
     AVAI_CAMPAIGN_OBJECTIVE_EJECT_GARRISON  
     AVAI_CAMPAIGN_OBJECTIVE_MOVE_NONLOCAL   
     AVAI_CAMPAIGN_OBJECTIVE_DEFEND_BORDER   
     AVAI_CAMPAIGN_OBJECTIVE_DEFEND_WITH_FORTS   
     AVAI_CAMPAIGN_OBJECTIVE_BUILD_WATCHTOWERS   
     AVAI_CAMPAIGN_OBJECTIVE_OCCUPY_WATCHTOWERS  
     AVAI_CAMPAIGN_OBJECTIVE_MOVE_TO_POSITION    
     AVAI_CAMPAIGN_OBJECTIVE_MOVE_TOWARD_CRUSADE_TARGET  
     AVAI_CAMPAIGN_OBJECTIVE_EMBARK_ONTO_SHIP    
     AVAI_CAMPAIGN_OBJECTIVE_MOVE_TO_TAKE_ON_PASSENGERS  
     AVAI_CAMPAIGN_OBJECTIVE_DISEMBARK_PASSENGERS    
     AVAI_CAMPAIGN_OBJECTIVE_PATROL_COASTLINES   
     AVAI_CAMPAIGN_OBJECTIVE_SALLY_FORTH 
     AVAI_CAMPAIGN_OBJECTIVE_HIRE_MERCENARIES    
     AVAI_CAMPAIGN_OBJECTIVE_HIRE_CRUSADE_MERCENARIES    
     AVAI_CAMPAIGN_OBJECTIVE_POP_ACROSS_THE_BORDER   
     AVAI_CAMPAIGN_OBJECTIVE_MOVE_TACTICAL   
     AVAI_CAMPAIGN_OBJECTIVE_REINFORCE_USED_ARMY 
     AVAI_CAMPAIGN_OBJECTIVE_MOVE_FRONTLINE  
     AVAI_CAMPAIGN_MISSION_ATTACK_RESIDENCE  
     AVAI_CAMPAIGN_MISSION_SIEGE_RESIDENCE   
     AVAI_CAMPAIGN_MISSION_SPLIT_ARMY    
     AVAI_CAMPAIGN_MISSION_SPLIT_GARRISON    
     AVAI_CAMPAIGN_MISSION_EJECT_GARRISON    
     AVAI_CAMPAIGN_MISSION_MOVE_TO_REGION    
     AVAI_CAMPAIGN_MISSION_MOVE_TO_POSITION  
     AVAI_CAMPAIGN_MISSION_MOVE_TO_POSITION_TO_TAKE_ON_PASSENGERS        
     AVAI_CAMPAIGN_MISSION_MOVE_TO_POSITION_TO_DISEMBARK_PASSENGERS  
     AVAI_CAMPAIGN_MISSION_DO_NOTHING    
     AVAI_CAMPAIGN_MISSION_WAIT_FOR_PASSENGERS   
     AVAI_CAMPAIGN_MISSION_DEFEND_DEEP   
     AVAI_CAMPAIGN_MISSION_BLOCKADE_PORT 
     AVAI_CAMPAIGN_MISSION_EMBARK_ONTO_SHIP  
     AVAI_CAMPAIGN_MISSION_DISEMBARK_PASSENGERS  
     AVAI_CAMPAIGN_MISSION_BUILD_STRUCTURE   
     AVAI_CAMPAIGN_MISSION_HIRE_MERCENARIES  
     AVAI_CAMPAIGN_MISSION_HIRE_CRUSADE_MERCENARIES  
     AVAI_CAMPAIGN_OBJECTIVE_SPLIT_CRUSADE_GARRISON  
     AVAI_CAMPAIGN_MISSION_SPLIT_CRUSADE_GARRISON    
     AV?$TRACKED_POINTER@VGARRISON_RESIDENCE    
     AVAI_BLOCKADE_PORT  
     AVAI_CAMPAIGN_MISSION_ATTACK_ENEMY  
     AVAI_CAMPAIGN_MISSION_MERGE_GARRISON
    
    AVAI_CAMPAIGN_OBJECTIVE_TAKE_RESIDENCE  
    AVAI_CAMPAIGN_OBJECTIVE_TAKE_CRUSADE_TARGET 
    AVAI_CAMPAIGN_OBJECTIVE_ATTACK_ENEMY    
    AVAI_CAMPAIGN_OBJECTIVE_PROTECT_ARMY    
    AVAI_CAMPAIGN_OBJECTIVE_HOLDOUT 
    AVAI_CAMPAIGN_OBJECTIVE_MERGE_GARRISON  
    AVAI_CAMPAIGN_OBJECTIVE_BLOCKADE_PORT   
    AVAI_CAMPAIGN_MISSION_MERGE_ARMY    
    AVAI_CAMPAIGN_MISSION_SALLY_FORTH   
    AVAI_CAMPAIGN_OBJECTIVE_BLOCK_TRADE_ROUTE   
    AVAI_CAMPAIGN_OBJECTIVE_DEFEND_HIDDEN   
    AVAI_CAMPAIGN_OBJECTIVE_DEFEND_DEEP
    Seems like internal engine commands. But what about DEFEND DEEP?

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  8. #48
    z3n's Avatar State of Mind
    Patrician Artifex Modding Staff Director

    Join Date
    Aug 2011
    Posts
    3,643

    Default Re: MTW2 Battle Scripting

    DEFEND_DEEP is actually a defend decision, so I'm not sure why that's there, maybe what it means is defend anything inside of the frontline. DEFEND_BORDER looks like defend_frontline.


    DEFEND_HIDDEN looks like ambush.


    Eject garrison is very interesting, that explains why the garrison sits next to a town before being called to an invade decision... I wonder if these are actually all functions??


    I wish we had the source code for M2TW exe.
    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. #49

    Default Re: MTW2 Battle Scripting

    Quote Originally Posted by bitterhowl View Post
    Here is interesting thing - seems like some kind of operators to strat level for army
    Code:
    do_nothing  
    move_to_region  
    patrol_region   
    merge_armies    
    attack_settlement   
    attack_enemy
    DO_NOTHING is also/rather a gta_plan

  10. #50
    bitterhowl's Avatar Biarchus
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    609

    Default Re: MTW2 Battle Scripting

    Unit-priority settings are functional, here's the proof. I set attacker right+rear direction for attack plan, 0 priority for attack spearmen and high priority for missile and melee unit. For general highest priority is enemy general. Video is from local Russian SS submod named Staluga.

    https://www.youtube.com/watch?v=unZ7jar79BQ

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  11. #51
    z3n's Avatar State of Mind
    Patrician Artifex Modding Staff Director

    Join Date
    Aug 2011
    Posts
    3,643

    Default Re: MTW2 Battle Scripting

    Interesting, I also thought I noticed it had an effect too but was never 100% sure, thanks for confirming.
    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)

  12. #52
    bitterhowl's Avatar Biarchus
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    609

    Default Re: MTW2 Battle Scripting

    You have to disable any BAI scripts.

    Also - if cavalry unit has attack plan for right flank and there are only spearmen it will attack them. This is the case of false tests when your unit attack unit type that you expect it should ignore.

    If there are any other unit type with priority to be attacked - cavalry will avoid spearmen and attack another unit type.
    Last edited by bitterhowl; May 24, 2019 at 03:03 AM.

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  13. #53
    bitterhowl's Avatar Biarchus
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    609

    Default Re: MTW2 Battle Scripting

    This finding open some interesting possibilities for us. We can create custom formation for custom attack plan and combine them into BAI switcher from G5 system. It allows us to have 5 AiSets, which will switch randomly. This will work for Skynet and mods without Germanicus installed.

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  14. #54
    Lusitanio's Avatar Content Staff
    Join Date
    Jan 2018
    Location
    Portugal
    Posts
    955

    Default Re: MTW2 Battle Scripting

    It sure looks promising!

  15. #55
    bitterhowl's Avatar Biarchus
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    609

    Default Re: MTW2 Battle Scripting

    I'll try to make it for Total Bananas.

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  16. #56
    Lusitanio's Avatar Content Staff
    Join Date
    Jan 2018
    Location
    Portugal
    Posts
    955

    Default Re: MTW2 Battle Scripting

    Please continue to share your findings, it has a lot of potential and may help improving all the mods.

  17. #57
    bitterhowl's Avatar Biarchus
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    609

    Default Re: MTW2 Battle Scripting

    I already have a name for those project - "True General". I have to start from vanilla based mods, it may show to community (and probably to CA) how could M2 engine work on tactics. If the results will be acceptable we can spread it to other mods.

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

Page 3 of 3 FirstFirst 123

Posting Permissions

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