Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: Pikemen begin with guard state?

Hybrid View

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

    Default Pikemen begin with guard state?

    I just found this thread :
    http://www.twcenter.net/forums/showt...lt_melee_state


    I was so excited that I can set my pikemen as original M2TW.

    But soon I got frustrated, because I can't even find this line "default_melee_state" which is referred to pikemen in the descr_formation_ai.txt.

    Should I add something manually?


    Could anyone you help me or upload the formations_ai file for me as example?

    Thankyou!
    My English is poor...

    Thanks for reading

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

    Default Re: Pikemen begin with guard state?

    There's info at the top of the file:

    ;
    ; This file describes the unit group formation templates, any number of group formations can be specified
    ; these templates are used to give a group of units a formation, the units available in the group may not
    ; totally fit the template in which case a best-fit is determined when the formation is created
    ;
    ; Formation block positions can either be specified with a relative normalised (x,z) or they can be specified
    ; relative to another formation block (when specifying in this manner rotation CANNOT be given)
    ; a formation must be described entirely in one method or the other
    ;
    ;
    ; formation the name given to this formation template
    ;
    ; formation purposes hints to ai for using this formation
    ;
    ; ai_priority hint to the ai, denotes priority of using this template
    ;
    ; BLOCK SPEC
    ;
    ; min_units <VALUE> minimum number of units block can have
    ; max_units <VALUE> maximum number of units block can have
    ; not_general this block cannot contain the general unit
    ; unit_type specifies units that can be allocated to the block
    ; either : -
    ; any
    ; phalanx
    ; non_phalanx_spear
    ; chanting_screeching
    ; ranged_missile_infantry
    ; elephants
    ; heavy_chariots
    ; pilum_infantry
    ; general_unit
    ; <UNIT_CLASS> <UNIT_CATEGORY> <PRIORITY>
    ; the priority dictates the order of assigning different unit types
    ; a priority of zero means that type will only ever be assigned to this block
    ; to fulfill block minimums
    ; default_melee_state <OPTIONAL> the melee state that will be assigned to units
    ; in the formation
    ; unit_formation the formation the units within this block will be in (wedge, square, ...)
    ; unit_density either loose or close
    ; min_unit_width minimum unit width in men
    ; max_unit_width maximum unit width in men
    ; block_formation the formation to organise the block into (square, column, line)
    ; normalised_pos (x,z) position relative to the center of the template (in normalised coords)
    ; normalised_rot rotation in degress relative to the orientation of the template
    ; block_relative_pos b x z (x,z) position (in metres) relative to formation block b
    ; inter_unit_spacing distance to space units (in metres)
    ; priority dictates the order in which units are assigned to the block

    To set a block to guard mode use 'default_melee_state defend'.

    But it was RTW not M2TW that had this as default IIRC. So if you're after something you remember from M2TW then I think you'll be disappointed.
    Last edited by Taiji; December 13, 2011 at 09:57 AM.

  3. #3

    Default Re: Pikemen begin with guard state?

    Taiji:

    I feel so embarrassed that my English is too poor to understand what you are trying to teach me.


    This is the descr_formations_ai.txt that I downloaded it from Xeryx.(please check the attached file)

    I search the key words "default_melee_state" but all lines have already set as "default_melee_state defend".


    Thankyou for your helping.
    My English is poor...

    Thanks for reading

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

    Default Re: Pikemen begin with guard state?

    You are going to need to explain what you want - I have no idea so far.

    By the way I wouldn't use pikes in guard state, it messes them up too badly.
    Last edited by Taiji; December 14, 2011 at 08:06 AM.

  5. #5

    Default Re: Pikemen begin with guard state?

    Quote Originally Posted by Taiji View Post
    You are going to need to explain what you want - I have no idea so far.

    By the way I wouldn't use pikes in guard state, it messes them up too badly.

    I want to make all pike units in game use the guard mode as a default , just like in the vanilla game.
    My English is poor...

    Thanks for reading

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

    Default Re: Pikemen begin with guard state?

    If you want something formation related from vanilla then why don't you use the vanilla formations?

    Just delete your descr_formations_ai.txt and you will be using vanilla. If it doesn't work then you will know it isn't vanilla stuff that you want.

    If you want to add 'default_melee_state defend' to your existing formation blocks then... Umm just do it

    You can see where the code needs adding by reading the top of the file and noting the order in which the different elements of coding are explained. Plus in that file you uploaded there are examples using this code.

    I guess the tricky thing might be knowing which formation the AI defaults to. This is set in config_ai_battle.xml:
    Code:
            <attack-battlegroup>
    .....
    			<formation>
    				<easy>ai_triple_missiles_in_front</easy>
                    <medium>ai_triple_missiles_in_front</medium>
                    <hard>ai_triple_missiles_in_front</hard>
                    <very_hard>ai_triple_missiles_in_front</very_hard>
    			</formation>
            </attack-battlegroup>
    So you can see it's ai_triple_missiles_in_front in vanilla.
    Last edited by Taiji; December 14, 2011 at 10:12 AM.

  7. #7
    Valiant Champion's Avatar Praepositus
    Join Date
    Jun 2008
    Location
    Central Kentucky
    Posts
    5,402

    Default Re: Pikemen begin with guard state?

    it makes sense that the guard mode for spearmen units by default has been changed by something in the kingdoms folder, but what?

    Neither formation file has default melee state added anywhere in them. The option exists but is not used in either vanilla or kingdoms.

    Also doesn't default melee state set an entire block to either guard mode or attack mode and not a certian unit class specifically?

    So the question is what in each of the kingdoms folders changed the guard mode by default for spear/pike/ halberd units?

    I think the issue merits some serious attention as it gives modders a wider selection of options in how to use spear units in their mods, or how the AI will use spearmen in a mod.

  8. #8

    Default Re: Pikemen begin with guard state?

    that's right. before in tha vanila pikemen started in guard mode but later in kingdoms SOMETHING in the kingdoms files changed it. it surely isn't the descr_formations_ai.txt or the edu because i've looked at both of these files both in the vanila and kingdoms and there is NO DIFFERENCE in point of guard mode between these 2 files. i've tryed asking the game producers CA about the problem but the guys couldn't care less as i didn't even get a response. if more people are interested in this issue i think we should start posting this question on the CA site or anyway let these guys from the CA know about us being stuck with this issue. in my opinion this is the only way to make pikemen start with guard mode by default just like in the vanila game. wouldn't it be a good idea also to respectfully ask someone important from twc centre to send a mail to someone from the CA and put forward this problem, because he wouild stand a better chance than us to get a response?

    if anyone still has any doubt about the problem this is it cristal clear: how to make ONLY pikemen(pikemen= spear-wall/phalanx capable units) start any combat with guard mode turned on as a default. i need this because we could then mode pikemen to act more realisticaly and more important STOP THEIR GRAVITY CENTRE SHIFTING ERRATICALLY AND ENDING UP WITH THE "PHALANX" POINTING PIKES IN THE OPPOSITE DIRECTION TO WHERE THE FIGHT IS?

    for any doubts of what this bug is play a custom battle in any kingdom based mod or even the unmodified kingdoms campaigns use these troop: AI: - general and 4 units of dismounted feudal knights
    you: - general 4 units of heavy pike militia
    strategy: 1) put your pikes in a line in front of your general
    2) start battle and let the AI come to you, DO NOT DO ANYTHING JUST LET THE BATTLE GO ON WITHOUT DOING ANYTHING.
    3) you should see that after a while your "phalanx" has turned thir backs at the enemy and you should recognize this by the row of lowered spears at the back of your unit while the enemy is engaging them in the front.

    so please help me in geting a response from the CA because i hate this bug from all my heart.

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

    Default Re: Pikemen begin with guard state?

    Why all this fuss when I've already explained how to get it if you want it?

    Read my posts maybe, there's a thought.

  10. #10

    Default Re: Pikemen begin with guard state?

    sorry taiji but i believe that you've told us how to put defeult_melee_state defend in the descr_formations_ai.txt. but this will make all the units in that block be in defence which is not good for the AI. we're talking about different things me and you.

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

    Default Re: Pikemen begin with guard state?

    Quote Originally Posted by alexgold View Post
    sorry taiji but i believe that you've told us how to put defeult_melee_state defend in the descr_formations_ai.txt.
    Yeah, because that's the only way to do it.

    Quote Originally Posted by alexgold View Post
    but this will make all the units in that block be in defence which is not good for the AI.
    You have seen this? What happened exactly?

    Quote Originally Posted by alexgold View Post
    we're talking about different things me and you.
    You aren't talking about pike units turning their backs to the enemy while fighting?

    Then what are you talking about?

    Quote Originally Posted by Valiant Champion View Post
    show me an entry out of descr_formations that is modified to enable guard mode for spearmen and phalanx so I can copy paste it over one of the entries in my descr_formations and I will test what you claim will work.
    No.

    Quote Originally Posted by Valiant Champion View Post
    personally I don't believe you have tested this yourself.
    How valiant. (It earned you the 'No.' above )

    Quote Originally Posted by Valiant Champion View Post
    There should be quite a fuss if no one has solved something with such a great benefit for modders
    I guess there was. It was years ago. But guard mode sucks for pike.

    Quote Originally Posted by Valiant Champion View Post
    .and to my knowledge I havent even seen a kingdoms mod where spearmen and phalanx units start out in battle in guard mode. If there is please point me to that mod so I can see how they did it?
    For example mine before I decided guard mode was too crap for pikes. I don't know of any mod that uses it.

    Quote Originally Posted by Valiant Champion View Post
    we are also not discussing blocks of units or battle formations. We are talking about a default setting for individual units or a class of units.
    Can't be done except via formations.

    And it's crap
    Last edited by Taiji; January 20, 2012 at 06:08 PM.

  12. #12

    Default Re: Pikemen begin with guard state?

    taiji please make a single battle with the vanila pikemen and then tell us weather they started with guard mode on and weather with guard mode turned on they still turned their backs at the enemy. then extract the descr_formations_ai.txt from the vanilla game and tell us weather you saw any default melee state defend inside the block that has pikemen.

    what me and valiant champ want to point is that by editing the formations txt is not the only neither the best way to do the guard mode stance. what were trying to do is find out how did the pikemen in the vanila start with guard mode and how can we implement this in our own personal mods and of course share this knowledge with the comunity. so please before any other agrumen on this topic please tell all of us what were your findings after u did what i adviced in paragraph 1.
    thank you

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

    Default Re: Pikemen begin with guard state?

    Quote Originally Posted by alexgold View Post
    taiji please make a single battle with the vanila pikemen and then tell us weather they started with guard mode on and weather with guard mode turned on they still turned their backs at the enemy. then extract the descr_formations_ai.txt from the vanilla game and tell us weather you saw any default melee state defend inside the block that has pikemen.
    You have a modfolder? Delete descr_formations_ai from it and you are using vanilla's.

    Quote Originally Posted by alexgold View Post
    what me and valiant champ want to point is that by editing the formations txt is not the only neither the best way to do the guard mode stance. what were trying to do is find out how did the pikemen in the vanila start with guard mode and how can we implement this in our own personal mods and of course share this knowledge with the comunity.
    It's the only feasible way. Otherwise the answer is it's hardcoded. There aren't that many files dealing with unit behaviour. The behaviour in question is only addressed in descr_formations_ai - Draw your own conclusions from that.

    VC, sorry, what you are trying to say is mainly too hard to follow. With regards applying default_melee_state defend, the top of the file shows the order the items come in. IIRC I think I use guard mode on my spearmen in some formations, necessary because they use the 'spear' attribute, along with altered anim setup.
    Last edited by Taiji; January 21, 2012 at 05:25 PM.

  14. #14
    Valiant Champion's Avatar Praepositus
    Join Date
    Jun 2008
    Location
    Central Kentucky
    Posts
    5,402

    Default Re: Pikemen begin with guard state?

    Quote Originally Posted by Taiji View Post
    Why all this fuss when I've already explained how to get it if you want it?

    Read my posts maybe, there's a thought.
    show me an entry out of descr_formations that is modified to enable guard mode for spearmen and phalanx so I can copy paste it over one of the entries in my descr_formations and I will test what you claim will work.

    personally I don't believe you have tested this yourself.

    There should be quite a fuss if no one has solved something with such a great benefit for modders

    .and to my knowledge I havent even seen a kingdoms mod where spearmen and phalanx units start out in battle in guard mode. If there is please point me to that mod so I can see how they did it?

    we are also not discussing blocks of units or battle formations. We are talking about a default setting for individual units or a class of units.
    Last edited by Valiant Champion; January 20, 2012 at 05:41 PM.

  15. #15
    Valiant Champion's Avatar Praepositus
    Join Date
    Jun 2008
    Location
    Central Kentucky
    Posts
    5,402

    Default Re: Pikemen begin with guard state?

    This example here has only one unit. only thing missing here that could be added optionally is a line called "spans 3 6 8 (example)"

    I would like to know exactly why this unit is by itself, will it still be included in a large formation or is it when it is only by itself on the battlefield, is this entry a way to modify the ai behaviour of only that unit in the larger formation?

    ;;; special general block
    begin_block 37
    min_units 1
    max_units 1
    unit_type general_unit 1.0
    unit_density close
    block_formation line
    block_relative_pos 36 0 -2.0
    inter_unit_spacing 20.0
    priority 1.0
    end_block

    main_line 5

    in this example is it possible to create a block that will be used in the entire ID formation such as the "triple line missiles in front" that will only effect spearmen or phalanx, spearmen (assuming that seperate identifiers are used in the EDU, which I suspect is not done in vanilla or Kingdoms retrofit, which unless I am mistaken are all listed as spearmen)

    of course assuming that the entry "default melee state defend" will work properly once the block outs are removed

    begin_block 10
    max_units 1
    unit_type phalanx 1.0
    unit_type spearmen 0.9
    unit_type heavy infantry 0.8
    unit_type light infantry 0.7
    ;unit_formation square, phalanx, schiltrom
    ;;default_melee_state defend
    unit_density close
    min_unit_width 15
    max_unit_width 20
    block_formation line
    block_relative_pos 8 -1.0 0.0
    inter_unit_spacing 0.0
    priority 0.6
    end_block

    Is it possible to make a special block that will cover all formations in the "descr formations" and "descr formations ai" that will affect that unit class specifically but not other units?

    I notice general unit is not listed in any of the lines in a formations such as for example "triple line missiles in front". only in its on special block. relative position usually places it at the rear of a battle formation seperate from the other units. however if there are multiple general units than the subordinates are usually placed in the ranks according to its class type.

    ------------------------------------------------------------------

    in this entry I have questions.

    how exactly does the span entry work? I know that it references block numbers in a formation but why?

    what is the difference between "dummy block" and "block"?

    Spoiler Alert, click show to read: 
    begin_dummy_block 4
    spans 0 1 2 3
    end_dummy_block

    begin_block 5
    max_units 2
    unit_type phalanx 1.0
    unit_type spearmen 0.9
    unit_type heavy infantry 0.8
    unit_type light infantry 0.7
    ;unit_formation square, phalanx, schiltrom
    ;;default_melee_state defend
    unit_density close
    min_unit_width 15
    max_unit_width 20
    block_formation line
    block_relative_pos 4 0.0 -1.0
    inter_unit_spacing 0.0
    priority 0.9
    end_block
    begin_block 6
    max_units 1
    unit_type phalanx 1.0
    unit_type spearmen 0.9
    unit_type heavy infantry 0.8
    unit_type light infantry 0.7
    ;unit_formation square, phalanx, schiltrom
    ;;default_melee_state defend
    unit_density close
    min_unit_width 15
    max_unit_width 20
    block_formation line
    block_relative_pos 5 -1.0 0.0
    inter_unit_spacing 0.0
    priority 0.8
    end_block
    begin_block 7
    max_units 1
    unit_type phalanx 1.0
    unit_type spearmen 0.9
    unit_type heavy infantry 0.8
    unit_type light infantry 0.7
    ;unit_formation square, phalanx, schiltrom
    ;;default_melee_state defend
    unit_density close
    min_unit_width 15
    max_unit_width 20
    block_formation line
    block_relative_pos 5 1.0 0.0
    inter_unit_spacing 0.0
    priority 0.8
    end_block
    begin_block 8
    max_units 1
    unit_type phalanx 1.0
    unit_type spearmen 0.9
    unit_type heavy infantry 0.8
    unit_type light infantry 0.7
    ;unit_formation square, phalanx, schiltrom
    ;;default_melee_state defend
    unit_density close
    min_unit_width 15
    max_unit_width 20
    block_formation line
    block_relative_pos 6 -1.0 0.0
    inter_unit_spacing 0.0
    priority 0.7
    end_block
    begin_block 9
    max_units 1
    unit_type phalanx 1.0
    unit_type spearmen 0.9
    unit_type heavy infantry 0.8
    unit_type light infantry 0.7
    ;unit_formation square, phalanx, schiltrom
    ;;default_melee_state defend
    unit_density close
    min_unit_width 15
    max_unit_width 20
    block_formation line
    block_relative_pos 7 1.0 0.0
    inter_unit_spacing 0.0
    priority 0.7
    end_block
    begin_block 10
    max_units 1
    unit_type heavy infantry 1.0
    unit_type light infantry 0.9
    unit_type spearmen 0.8
    unit_type phalanx 0.7
    ;unit_formation square, phalanx, schiltrom
    unit_density close
    min_unit_width 15
    max_unit_width 25
    block_formation line
    block_relative_pos 9 0.0 -8.0
    inter_unit_spacing 1.0
    priority 0.6
    end_block
    begin_block 11
    max_units 1
    unit_type heavy infantry 1.0
    unit_type light infantry 0.9
    unit_type spearmen 0.8
    unit_type phalanx 0.7
    ;unit_formation square, phalanx, schiltrom
    unit_density close
    min_unit_width 15
    max_unit_width 25
    block_formation line
    block_relative_pos 8 0.0 -8.0
    inter_unit_spacing 1.0
    priority 0.6
    end_block
    begin_block 12
    max_units 1
    unit_type phalanx 1.0
    unit_type spearmen 0.9
    unit_type heavy infantry 0.8
    unit_type light infantry 0.7
    ;unit_formation square, phalanx, schiltrom
    ;;default_melee_state defend
    unit_density close
    min_unit_width 15
    max_unit_width 20
    block_formation line
    block_relative_pos 8 -1.0 0.0
    inter_unit_spacing 0.0
    priority 0.5
    end_block
    begin_block 13
    max_units 1
    unit_type phalanx 1.0
    unit_type spearmen 0.9
    unit_type heavy infantry 0.8
    unit_type light infantry 0.7
    ;unit_formation square, phalanx, schiltrom
    ;;default_melee_state defend
    unit_density close
    min_unit_width 15
    max_unit_width 20
    block_formation line
    block_relative_pos 9 1.0 0.0
    inter_unit_spacing 0.0
    priority 0.5
    end_block
    begin_dummy_block 14
    spans 5 6 7 8 9 12 13
    end_dummy_block
    begin_block 15
    max_units 2
    unit_type phalanx 1.0
    unit_type spearmen 0.9
    unit_type heavy infantry 0.8
    unit_type light infantry 0.7
    unit_type missile infantry 0.6
    ;unit_formation square, phalanx, schiltrom
    unit_density close
    min_unit_width 20
    max_unit_width 25
    block_formation line
    block_relative_pos 4 0.0 -20.0
    inter_unit_spacing 0.0
    priority 0.4
    end_block
    begin_block 16
    max_units 1
    unit_type spearmen 1.0
    unit_type light infantry 0.9
    unit_type heavy infantry 0.8
    unit_type phalanx 0.7
    ;unit_formation square, phalanx, schiltrom
    unit_density close
    min_unit_width 15
    max_unit_width 25
    block_formation line
    block_relative_pos 11 0.0 -13.0
    inter_unit_spacing 1.0
    priority 0.3
    end_block
    begin_block 17
    max_units 1
    unit_type spearmen 1.0
    unit_type light infantry 0.9
    unit_type heavy infantry 0.8
    unit_type phalanx 0.7
    ;unit_formation square, phalanx, schiltrom
    unit_density close
    min_unit_width 15
    max_unit_width 25
    block_formation line
    block_relative_pos 10 0.0 -13.0
    inter_unit_spacing 1.0
    priority 0.3
    end_block
    begin_block 18
    max_units 4
    unit_type infantry 0.1
    unit_type missile infantry 0.5
    ;unit_formation square, phalanx, schiltrom
    unit_density close
    min_unit_width 25
    max_unit_width 30
    block_formation line
    block_relative_pos 15 0.0 -5.0
    inter_unit_spacing 0.0
    priority 0.2
    end_block
    begin_block 19
    max_units 4
    unit_type missile infantry 0.4
    ;unit_formation square, phalanx, schiltrom
    unit_density close
    min_unit_width 25
    max_unit_width 30
    block_formation line
    block_relative_pos 18 0.0 -2.0
    inter_unit_spacing 0.0
    priority 0.1
    end_block
    begin_block 20
    max_units 4
    unit_type missile infantry 0.3
    ;unit_formation square, phalanx, schiltrom
    unit_density close
    min_unit_width 15
    max_unit_width 25
    block_formation line
    block_relative_pos 19 0.0 -2.0
    inter_unit_spacing 0.0
    priority 0.1
    end_block

    begin_dummy_block 21
    spans 4 10 11 15
    end_dummy_block

    begin_dummy_block 22
    spans 3 21
    end_dummy_block


    perhaps someone can post some examples of entries that would possibly target spearmen only that would work in a formation such as "triple line missiles in front" that would effect only the spearmen?

  16. #16
    Valiant Champion's Avatar Praepositus
    Join Date
    Jun 2008
    Location
    Central Kentucky
    Posts
    5,402

    Default Re: Pikemen begin with guard state?

    can a block be created in a formation set that will give only the spearmen guard mode? what would this block look like?

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

    Default Re: Pikemen begin with guard state?

    begin_block 10
    max_units 6
    unit_type spearmen 1.0
    default_melee_state defend

    unit_density close
    min_unit_width 25
    max_unit_width 30
    block_formation line
    block_relative_pos 8 -1.0 0.0
    inter_unit_spacing 0.0
    priority 1.0
    end_block
    Last edited by Taiji; January 21, 2012 at 06:59 PM.

  18. #18
    Valiant Champion's Avatar Praepositus
    Join Date
    Jun 2008
    Location
    Central Kentucky
    Posts
    5,402

    Default Re: Pikemen begin with guard state?

    I will give it a shot and see how it goes

  19. #19
    Valiant Champion's Avatar Praepositus
    Join Date
    Jun 2008
    Location
    Central Kentucky
    Posts
    5,402

    Default Re: Pikemen begin with guard state?

    another question. will I need to remove spearmen from the other blocks in the dummy block?

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

    Default Re: Pikemen begin with guard state?

    Just prioritise the block higher than other blocks that can have spearmen.

Page 1 of 2 12 LastLast

Posting Permissions

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