Page 1 of 4 1234 LastLast
Results 1 to 30 of 93

Thread: Animations in MTW - how, what, where, why and \"lots more\"

  1. #1
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    Hi Guys,.

    It would be great if everyone could collect their knowledge, re animations and graphics, in order to create an 'image modding guide' that can be downloadable from The Org.

    That is the intended purpose of this thread.

    Here's what I know/suspect regarding the animations in MTW. I don't think this type of info has been completely documented yet, although there are many bit's and pieces scattered throughout threads. A lot of this may be known or self evident but I've tried to cover as much as I can, for both established modders and newbies.

    I've split my contributions to this thread into parts (in seperate posts) in order to make it more readable. How many parts? Don't know yet. Depends on what else I manage to figure out.

    Please contribute what you know, add whatever I've overlooked, and correct any misconceptions/mistakes I may post.

  2. #2
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default


    PART 1: Basics, Images and BIF's

    There are over 120 individual units in the game. Each unit is built up from a combination of the following -

    - a generic unit
    - a generic mount (for cavalrymen)
    - a specific weapon (optionally)
    - a specific shield (optionally)


    For example, the generic unit 'Peasant' is used for multiple specific units -

    - Peasant
    - Spearman
    - Pikeman
    - FeudalSergeants

    .... and MANY others!

    These specific units are different insomuch as they carry different weapons/shields, and (in the case of cavalry) may use different mounts.


    The generic units are contained in their own folders within the folder 'Textures\Men'. The images for these are contained in 2 BIF's in each of the generic-unit folders.

    The relationship between a specific-unit and the generic-unit (in terms of which generic-unit and, optionally, generic-mount to use for any specific-unit) is contained in the crusader_prod11.txt file.


    Most graphics associated with the generic-units are contained in their own folders, within the folder 'Textures\Men' (flags and banners are not). These generic-units are represented by 2 BIF files, for the low res and high res images. Each of these 2 BIF's contain 12 frames.


    The lowres BIF frames are all 256x256, the hires ones 512x512. Images in the high res BIFs are twice the size of the low res ones. This is important for weapons/shields resizing when a specific unit is being 'built' in the MTW engine.

    These BIF files also contain images of all weapons and shields that may be used, in conjuction with the generic unit, in order to create a specific unit.

    Both BIF graphics plates have the same name as the folder, with the high res BIF plate adding "_H" for differentiation. For example, the unit plates for the specific-unit Longbows are contained in the folder 'Textures\Men\Bowman', along with several related text files, and be named -

    - Bowman.bif
    - Bowman_H.bif

    (Note: within the generic unit folders there is also a TGA file - ignore it - it is'nt used)

    Any figure image, shield image or weapon image in a BIF is defined by its own 'image rectangle', the size of this image-rectangle being constant for all 12 frames.



  3. #3
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    PART 2: Camera angles and frames

    The number of images in any BIF, or frame, is always a multiple of 4. Why ? Well each action a figure is capable of performing (walk/run/die etc) is always represented by exactly 4 images on a frame.

    Each figures actions can be represented on the MTW battlefield from any one of 8 angles, for each of the hires or lowres definitions. If you consider scanning a camera all around a figure (0 to 360 degrees) on the battlefield, the 4 images for each action represent 'camera angles' between 0 and 180 degrees (at 36, 72, 108 and 144 degrees - roughly speaking). There are no exact front or rear images. However, the MTW engine 'flips' these 4 images along their vertical axis to represent the 4 camera-angles on the other side (between 180 to 360 degrees), thus allowing 8 camera-angles from 4 images.

    The different generic plates may well contain a different number of images - always in multiples of 4. However, the number of images in any generic unit plate will differ; you may see 24, 28, 32 or even more images per frame. Why ? For 2 reasons -

    1) some specific units have more possible actions than others
    2) these are generic-units, used for multiple specific units

    Note that, in most case, a specific-unit does'nt use all the figure images defined (un the BIF's) for a generic-unit.

    Each image in a frame (figure, weapon or shield) is a stand-alone image, and can be thought of as being encapsulated in its own invisible 'image rectangle'. These image-rectangles don't overlap and are important to consider when adding or changing unit images. Think of each frame in these BIF's as being comprised of multiple rectangles.

    Each action associated with a figure has 4 'camera angle' images associated with it in the BIF's. Considering each image can be flipped on its horizontal axis, this provides a total of 8 camera angles, per action, in the animation).

    Each of these 4 camera-angles has 12 frames that serve to represent the movement sequence for the action and camera-angle.

    Now lets call any image (what you see if you pause the game and don't move the camera) a figure-image. Thus, any single figure-image is defined by 3 criteria -

    1) the action the figure is performing (1 of 6/9 or more)
    2) the camera-angle for that action (1 of 4)
    3) the position of the figure in a movement-sequence (1 of 12), for the action and camera-angle

    There is no other 'real' relationship between any of the images on any single frame, but there is a critical relationship between any image (defined by the image-rectangle) throughout all 12 frames.

    The 12 frames in each BIF contain 1 of 12 'image cycles' for each figures image-rectangle (pertaining to a specific action/camera-angle. Each of these 12 image-cycles serve to define the next movement for the figure image, and if shown in frame order comprise a cyclic sequence of movements that (when looped continuously) ensure the smooth animation of any figures action. The image-rectangles for any figure image will be exactly the same across all 12 frames.

    (TIP: Open one of the generic-unit BIF's and try using the "Timer(Go)" option in the Shogun 2.1 BIF editor - you'll see the relationship between all 12 frames very clearly)

    Note that whilst there is no 'real' relationship (in animation terms) between any of the images on any one single frame, there is a critical relationship between any figure image (defined by the image-rectangle) throughout all 12 frames that comprise that figure images image-cycle.


    Why are some of the images in the frames displayed horizontally instead of vertically ? Purely to get all required images within the confines of the high res and low res BIF frames, and within non-overlapping image-rectangles. The orientation of any image in the BIF's does'nt matter as the x/y coordinates of any image-rectangle will serve to inform the MTW engine whether or not re-orientation is required before use (think about it!).


  4. #4
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    PART 3: Actions

    A variety of actions may be associated with any specific-unit. Six actions are generally standard (walk/run/idle/die/fight/charge) and are associated with most units. Other actions may also be specified for specific types of units.

    For example -

    - Bowmen also have a 'shoot' action, giving 7 performable actions.
    - Arbalesters also have 'standing_shoot' and 'kneeling_shoot', giving 8 performable actions
    - Arquebusiers also have 'standing_shoot', 'kneeling_shoot', 'standing_reload' and 'kneeling_reload' actions (but no 'charge' action!), giving 9 performable actions.

    (Note: two actions are generally the same 'idle' and 'stand')

    The main criteria to consider in all of the animation process for a figure is action. The current action of a figure in a specific-unit will serve to determine -

    - which image to use for the figure in the generic-unit BIF's
    - which image to use for the mount (if it's a cavalry figure)
    - which weapon to use (if a figure has a choice of weapons)
    - where/how the weapon is positioned on the figure
    - where/how the shield is positioned on the figure


    There are multiple text files within MTW pertaining to a units action. Each specific-unit MUST have it's own set of actions (with all that this implies) defined.

    The primary files pertaining to a units actions are contained within the folder 'Textures\Men\ActionsPage'. This folder contains a text file for every specific-unit in the game (eg: Pikemen.txt, Peasants.txt etc). This text file basically contains -

    1) a list of all the possible actions this specific-unit can perform, each action followed by:
    2) 4 lines of parameters (1 per camera-angle), each line referencing the correct image to be used
    in the generic-unit BIF's for this combinationof specific-unit/action/camera-angle

    Each line in 2) also defines an x/y co-ordinate (which I refer to as the 'xy-origin'; more of this later!).

    Other files/folders pertaining to a specific-units actions are also contained within the general folder 'Textures\Men\Items'. This 'Items' folder serves to define the positioning of shields/weapons on any specific-units figure-image, for the action being performed. More of this later!


    (Note: there is another folder that also appears to define specific-units and actions, 'Textures\Men\ActionsDiddy' - ignore it - it is'nt used)


    Note that some of the various actions, and hence the parameters/files associated with that action, may be very similar across several units (eg: 'stand' or 'walk' actions for Spearmen/Peasants/FeudalSergeants). Other actions will be very different (eg: 'fight' action for a Spearman/Billman/MedievalManatArms).

    Therefore, whilst many of the parameters/files pertaining to action may be re-usable across some types of specific-unit, others will most certainly not be.

  5. #5
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    PART 4: Weapons/Shields and specific-units

    Each specific unit may have weapons and shields defined for them.

    All weapon/shield images are also defined by their image-rectangles, but as shields and weapons are always generic the xy-coords of these are defined by 1 line in either weapons.txt or shields.txt - two files contained within each generic-unit folder.

    These 2 files contain 1 line per shield/weapon in the BIF, each line giving the xy-coords of the image-rectangle. Any specific-unit defines its weapon and shield by referencing the line number, in the weapons.txt/shields.txt files, that define that weapon/shield.

    This reference is contained in the appropiate '_S' or '_W' suffixed text file for that specific unit.

    For example, if we consider a generic unit folder (the negro infantry generic unit - folder 'NegInf'), it will define the following generic files -

    - NegInf.bif
    - NegInf_H.bif
    - Weapons.txt (2 lines defining a spear and axe image-rectangles)
    - Shields.txt (1 line defining the shield image-rectangle)

    This generic unit is used as the basis for 2 specific units, NegroSpearmen (shield and spear) and AbyssinianGuard (axe). Therefore the specific files required to define these specific units are -

    - AbyssinianGuard_W.txt (contains the number '2' indicating the 2nd weapon in 'weapons.txt')
    - NegroSpearmen_W.txt (contains the number '1' indicating the 1st weapon in 'weapons.txt')
    - NegroSpearmen_S.txt (contains the number '1' indicating the 1st shield in 'shields.txt')

    Hence we now have our specific units, defined via the '_W' and '_S' files.

    However, some specific units may contain more than 1 weapon number in order to use different weapons for different actions. Missile units may have a bow/javelin/gun defined as a 'shoot action' weapon, and a sword for a 'charge action' weapon. For example, the file Arquebusier_W.txt (Within the 'HlPlArHm' generic unit folder) defines 2 weapons - the primary weapon being an arquebus and the secondary being a sword.

    Note that, so far, we have only managed to associate shields/weapons with a specific-unit - and not with a specific figure-image.

  6. #6
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    More to follow - but right now I'm going to bed!!!

  7. #7
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    PART 5: More on weapons and shields


    Weapons resizing

    Weapons.txt also contains 2 more numbers. These are used for the rescaling of weapons, relative to the figure-image, BEFORE a full image is rendered. For example, look at the weapons.txt in Peasant folder. A single image-rectangle (representing the spear) is defined twice -

    Line 6: 125,252,254,254,3,1
    Line 7: 125,252,254,254,5,1

    Line 6 defines a spear, line 7 a pike. The image is the same but the last 2 numbers serve to resize the length of the image in order to represent either a spear or a pike (in the ratio 3:5 respectively).

    Likewise within the weapons.txt in MShelm folder we have -

    Line 3: 92,216,172,230,2,3
    Line 4: 92,216,218,230,1,3

    Both lines define the image-rectangle for a poleaxe weapon. Line 4 is used for Crossbows, line 3 for MilitiaSergeants. You should now read the last 2 figures as fractions. For MilitiaSergeants this means the size of the poleaxe should be 2/3rds of it's defined image-rectangle when rendered on the figure. For Crossbows the size should be 1/3rd. The size of this 'poleaxe' image as rendered for the 2 units will now be in the ration 2:1, and for the Crossbows it now appears as a 'handaxe' as opposed to a 'poleaxe' .


    Therefore the last 2 numbers in a weapons.txt line serve 2 purposes -

    1) to resize a weapon relative to a figure
    2) to portray a different type of weapon - by virtue of size


    Weapons/Shields

    I should now say that there is a major difference between shields and weapons (and its NOT the obvious one). For the purposes of animation shields and weapons are built differently onto the figure-image. The critia is "would that object look different if viewed from a different camera-angle?" - object meaning weapon or shield. Any object that may look different (shield, crossbow) is defined as a shield. Those that would not (spear, pike, arquebus, sword) are defined as a weapon.

    For example, if you look at a shield from the front and then the side, it obviously looks different. If you look a spear or pike it does'nt (ok, halbards and swords are still defined as weapons - this is because the difference, when viewed from front/side is so little as to be irrespective).

    Therefore, the MTW engine, when rendering an object that has been defined as a WEAPON on an image need only consider the length perspective (ie: a line). When rendering an object defined as a SHIELD, however, it must consider both the length and the width perspectives (ie: a rectangle - or more precisely a quadrilateral!).

    (Note: that is why a crossbow is defined as a shield - instead of a weapon!)

    Some objects may be difficult to determine whether or not they should be represented as a weapon or shield. That is why (presumably!) archers/bowmen don't have their weapons defined in the standard manner but have their bows already drawn onto the actual images.

  8. #8
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    PART 6: Defining object parameters for positioning

    Before we can look at how any object (weapon/shield) is 'positioned' in order to look realistic on each figure-image, we have to ascertain "where everything is".

    In order to perform this positioning MTW defines 8 weapon folders ('weapon1' - 'weapon8') and 8 shield folders ('shield1' - 'shield5' and 'shields'), all within the folder 'Textures\Men\Items'. For reference, lets call each of these folders an 'object folder'.

    Note: the folders 'shields' and 'weapons', also defined, don't appear to be used.

    The number suffixes relate directly to specific lines in the weapons.txt/shields.txt files contained in the generic-unit folders.

    Any specific-unit that references one of these lines must also have its own folder defined in the appropiate object-folder. These folders will have the same name as the specific-unit. For reference, lets call each of these folders a 'unit object folder'.


    Considering the previous example -

    - AbyssinianGuard_W.txt (containing '2') requires an 'AbyssinianGuard' folder within the 'weapon2' folder.
    - NegroSpearmen_W.txt (containing '1') requires a 'NegroSpearmen' folder within the 'weapon1' folder.
    - NegroSpearmen_S.txt (containing '1') requires a 'NegroSpearmen' folder within the 'shield1' folder.


    Why have all these object-folders? Why not just have 1 folder for weapons objects and 1 for shields objects ? Well, that is because some specific-units have 2 weapons or 2 shields (remember - a crossbow is actually defined as a shield!), thus requiring 2 unit-object-folders.


    I should now stress that the use of objects is directly related to the action being performed. For example Arquebusiers have an arquebus (used for shoot action) and a sword (used for fight action).

    Now, what are all these unit-object-folders actually used for ?

    Well, each unit-object-folder contains 1 or more text files, each text file pertaining to the positioning of the object for any specific action the figure may perform. Lets refer to these files as the 'action object file'.

    There is a major different between unit-object-folders, containing action-object-files, pertaining to shields and those pertaining to weapons -

    - for shields, almost ALL actions require an action-object-file
    - for weapons, an action-object-file is only required if the weapon is relevent (ie: in use or visible) for the action


    For example, consider EarlyRoyalKnights -

    - the ActionPage defines 6 actions for this unit (charge/die/fight/run/stand/walk)
    - EarlyRoyalKnights_W.txt defines weapon 2 (Lance)
    - EarlyRoyalKnights_S.txt defines shield 4
    - weapons2 defines an EarlyRoyalKnights unit-object-folder, which contains 6 text files (1 per action)
    - shields4 defines an EarlyRoyalKnights unit-object-folder, which contains 6 text files (1 per action)

    Therefore, we see that both the Shield and the Lance for this unit are either visible or in use for all actions.


    Now consider Arquebusiers -

    - the ActionPage defines 9 actions for this unit
    - Arquebusiers_W.txt defines weapon 2 (Arquebus) and weapon 1 (Sword)
    - weapons2 defines an Arquebusiers unit-object-folder, which contains 8 text files (1 per action excluding 'fight')
    - weapons1 defines an Arquebusiers unit-object-folder, which contains 1 text file (the action 'fight')

    Hence, Arquebusiers use their arquebus for all actions except fight. For the fight action which they use a sword and the arquebus is not shown on the image for this action. Arquebusiers carry no shield - hence no shield folder required.


    A point to note here. Missile troops are defined as having missile type weapons in the crusader_prod11.txt file. If you wish to change an Arquebusiers weapon image from a gun to an axe, the unit will still be capable of 'firing the axe' on the battlefield !!! These are IMAGES only!



  9. #9

    Default

    Please don't stop! This is some good stuff!

  10. #10
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    PART 7: Positioning of objects on a figure-image


    So we now know that an action-object-file is required to "define the positioning of any object, weapon or shield, for any figure-image performing a specific action".

    Ok, but what about the 4 different camera-angles and 12 different frames for each action ?

    Well, if we look into any of these text files, for either shield or weapon objects, we see that they ALL contain 48 lines (although the number of parameters per line are slightly different for weapon and shield action-object-files).

    The 48 lines in each of these action-object-files should be thought of as 4 groups of 12 lines, representing -

    - 1st 12 lines; parameters for each of the 12 frames for camera-angle 1
    - 2nd 12 lines; parameters for each of the 12 frames for camera-angle 2
    - 3rd 12 lines; parameters for each of the 12 frames for camera-angle 3
    - 4th 12 lines; parameters for each of the 12 frames for camera-angle 4

    Let's call each set of 12 lines an 'action object set', and each line an 'action object line'.

    (apologies for all the terminology/definitions - it IS important to track of what I'm trying to say - if only for me!)


    Thus, we have finally reached the point whereby we can say that - "an action-object-line serves to define the position of a specific object, within one specific frame in the movement-cycle, for the figure image of a specific unit, performing a specific action, for a specific camera-angle".


    Phew! At this point I should also say that whilst all of this 'MTW animation system' may appear to be overly complicated, it is also EXTREMELY FLEXABLE.

    To continue, however, action-object-lines for shields contain 9 parameters, whilst for weapons they only have 5. Why? We'll see why a bit later. For now lets just say they represent xy-coords in order to provide a degree of 'fine tuning' for any object on any figure-image frame.


    Let's now look at a few examples of these action-object-lines, for both weapons and spears. Let's use the Spearmen specific-unit to illustrate. Spearmen have 1 shield and 1 weapon defined for them. Let's also consider three actions for the Spearmen - 'stand', 'walk' and 'die', but only for camera-angle 1 (ie: we'll only look at the 1st action-object-set - the 1st 12 lines - we'll ignore the other 36 lines).


    So, the 6 files we'll be looking into are -

    a) Textures\Men\Items\Shield3\Spearmen\stand.txt
    b) Textures\Men\Items\Weapon6\Spearmen\stand.txt
    c) Textures\Men\Items\Shield3\Spearmen\walk.txt
    d) Textures\Men\Items\Weapon6\Spearmen\walk.txt
    e) Textures\Men\Items\Shield3\Spearmen\fight.txt
    f) Textures\Men\Items\Weapon6\Spearmen\fight.txt


    We don't have to understand (yet) all the numeric parameters contained in these files. Some things should become evident. So, what do the 1st 12 lines (the action-object-set) of these files actually contain -


    Example 1: Action stand
    -----------------------


    Shield3 Weapon6

    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0
    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0
    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0
    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0
    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0
    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0
    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0
    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0
    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0
    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0
    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0
    10 -38 8 -38 10 -15 8 -15 1 -3 -25 -3 -5 0


    Ok, so the numbers above represent positions on a figure image.

    The first thing we see is that each action-object-set is different for weapon and shield. In other words, these 2 objects are in different positions on the figure image. Obvious! The shield is in one hand and the spear is in the other!!

    The next thing we see is that each action-object-line is the same, for each shield and weapon set. In other words for all 12 frames representing the 'movement sequence' for Spearmen standing. What does this tell us? It tells us that the shield and weapon images remain in exactly the same place RELATIVE TO THE FIGURE IMAGE. In other words THEY DONT MOVE. As these 2 sets are specifically for a spearman standing still - only to be expected.

    Why 'relative to the figure image'? Well, in this example all 12 frames for the figure-image don't move much either (the head bob's back and forth but that's about all!). However, IF the 12 frames in the movement-sequence for Spearmen standing were redrawn to show the whole figure moving slightly back and forth (let's say to stretch their legs!) then the above 2 set's of parameters would probably have to be amended slightly to ensure the weapon and shield stay in-sync with each new/redrawn figure-image for each frame in the movement-cycle.

    Example 2: Action 'walk'
    ------------------------


    Shield3 Weapon6


    7 -35 7 -30 15 -18 15 -13 0 -9 -22 -16 -17 0
    6 -38 5 -35 16 -16 15 -13 0 -9 -21 -17 -18 0
    6 -39 5 -38 15 -15 13 -14 0 -10 -20 -18 -19 0
    7 -39 5 -39 15 -14 13 -14 0 -10 -19 -18 -19 0
    7 -38 5 -37 15 -14 13 -13 0 -9 -19 -18 -18 0
    7 -37 6 -34 16 -15 14 -12 0 -9 -20 -19 -17 0
    6 -35 6 -30 16 -18 15 -13 0 -8 -22 -19 -17 0
    7 -33 8 -26 14 -20 14 -13 0 -7 -24 -19 -17 0
    8 -30 9 -23 13 -21 14 -14 0 -6 -25 -18 -16 0
    9 -28 11 -20 11 -22 12 -15 0 -6 -25 -17 -15 0
    9 -29 11 -22 10 -21 11 -14 0 -7 -23 -17 -13 0
    9 -31 11 -24 11 -19 12 -12 0 -8 -22 -18 -13 0


    Now the Spearman is walking we see a slight change in the parameters for both the weapon and the shield. This tells us that the positions of each object differ for each frame of the movement-cycle for Spearmen walking. This makes sense. We'd expect both objects to swing/shuffle as the figure walks. They would'nt remain 'still' for this specific action.

    Two things to note with the parameters in these 2 action-object-sets -

    First, the values don't change much. In other words the 'movement' of these objects is not great in respect to the figure-image.

    Second, the parameters in the first and last action-object-lines stay relatively close together (in terms of the numeric values specified). This is VERY IMPORTANT, and is generally the case for most actions!

    Why? Well, consider each of the 12 action-object-lines in an action-object-set that represent object positioning for a movement-cycle - CYCLE being the operative word! As these movement cycles are looped continuously for the animations, you have to ensure any object ends up in roughly the same place from where it started. If the parameters for object-action-line 12 were VASTLY different to those in object-action-line 1 you would witness great 'jumps' in the positioning of an object within a movement-cycle. Not conjucive to smooth animation!

    The exception to the rule is our final example.


    Example 3: Action 'die'
    -----------------------


    Shield3 Weapon6

    10 -25 13 -34 14 -27 15 -36 0 -3 -34 4 -23 0
    7 -25 8 -34 18 -21 19 -29 0 -6 -33 2 -30 0
    11 -25 12 -33 18 -17 16 -26 0 -6 -30 1 -32 0
    19 -23 15 -31 17 -20 13 -27 0 -5 -23 -4 -25 0
    23 -14 22 -22 12 -19 10 -27 0 -5 -5 -10 -5 0
    24 -1 29 -8 9 -10 13 -18 0 2 -2 -11 -10 0
    22 3 27 4 18 -19 22 -19 0 6 5 -10 1 0
    9 -1 10 4 33 -6 35 -1 0 9 5 -8 3 0
    9 -1 10 3 32 -6 34 -3 0 8 5 -8 3 0
    9 0 10 3 32 -6 34 -3 0 8 5 -8 3 0
    9 0 10 3 32 -6 34 -3 0 8 5 -8 3 0
    9 0 10 3 32 -6 34 -3 0 8 5 -8 3 0


    So now we have the 'die' action.

    Now we see that the parameters are changing rapidly at first, then eventually remain constant. In other words, the object images for both shield and weapon move about a bit at first then remain in the same place (all relative to the frame of course!). This also makes sense.

    Obviously, as our Spearman is dying the movement-cycle for the figure-image will show him dropping to the ground then remaining there. Therefore the first few action-object-lines change position rapidly in order to show his objects falling with him. The last few action-object-lines are the same, which tells us the objects ar'nt moving (these last few lines actually position the objects on the ground - whilst the final 4/5 cycles of the figure-image show him oozing blood!).

    Our Spearman has now died and after this movement-cycle all animation ends in respect of this single figure-image in the specific-unit Spearmen. Note - he is only one of the figure-images in this unit of 100 or whatever. However, he is now replaced by an image in the Deadpage (more of this later!).

    Therefore, the 'die' action is the one movement-cycle whereby the final positions of the figure-images objects are totally unrelated to the starting position. Why? Because this specific movement-cycle for the action 'die' in NOT looped continuously - it only happens once. Cat's may have nine lives; Spearmen don't!

    'Hands on' Example!
    -------------------

    If you feel adventurous and are eager for more punishment, try the following example! It's for the Pikemen specific-unit (as the change/amendment to the weapon is far more visible).

    We are going to change the Pike parameters for the 'stand' action, in order to make it 'sway' a little instead of remaining still.


    1) Make a backup of the 'Textures\Men\Items\Weapon7\Pikemen\stand.txt' file.

    2) Replace EACH of the 4 action-object sets in this stand.txt file with the action-object-set below (in other words delete the whole contents of the original and copy the 12 lines below 4 times) -

    9 -21 10 0 1
    9 -21 10 0 1
    9 -21 10 0 1
    10 -21 9 0 1
    10 -21 9 0 1
    10 -21 9 0 1
    10 -21 9 0 1
    10 -21 9 0 1
    10 -21 9 0 1
    9 -21 10 0 1
    9 -21 10 0 1
    9 -21 10 0 1

    3) Next time you play MTW in the Late Period (or if you wish - create a Historical Battle/Campaign and define a Pikemen unit) start a battle with an army that contains a Pikemen unit and see what happens to the weapon whilst the Pikemen are standing still.

    4) Position the camera in front of, or behind,the middle of the unit. Watch the Pike! Notice how some figures 'sway the Pike inwards' whilst others 'sway it outwards'. Can you see why this is? (Remember: 4 camera-angles that serve to represent 8 animations).

    Note: if you try this make sure you have 48 lines in the stand.txt file. Any less and you'll experience a crash to desktop whilst the battle is loading.

    Example Summary
    ---------------

    Well, we still don't know what these numbers represent. Hopefully, though, the above examples haven given a 'feeling' for how these parameters work in respect of object positioning on a figure-image.

    I've tried to stress that the parameters in any single action-object-line are ALWAYS relative to the figure-image in the movement-cycle frame. Two things to note in this respect (which don't occur often and are only an 'aside') -

    First, any object may appear to be 'not moving' in the animations, but the action-object-lines comprising the action-object-set may be slightly different. This is because the actual figure-image frame may be moving, and as the object must remain relative to each of these frames repositioning of the object may be necessary.

    Second, and conversely, the object may appear to move in the animations, but the action-object-lines comprising the action-object-set may be exactly the same. Same reason as above!


    As a final note to this PART - if you take a look at enough of these action-object-sets and action-object-lines, after a while you can often have a good 'guess' as to what the object is 'doing' - roughly speaking. Alternately ... doing this may drive you mad!!!

  11. #11
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    Hhmmm - posting this last part f****d up the text file positions for the shield/weapon definitions. Shit!

    Never mind - I'll repost this PART in a different manner -

  12. #12
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    The parameters for the shield/weapons lines for Spearmen in the previous PART 7 for the 3 Examples were intended to read -

    Example 1: Action stand
    -----------------------


    Shield3

    10 -38 8 -38 10 -15 8 -15 1
    10 -38 8 -38 10 -15 8 -15 1
    10 -38 8 -38 10 -15 8 -15 1
    10 -38 8 -38 10 -15 8 -15 1
    10 -38 8 -38 10 -15 8 -15 1
    10 -38 8 -38 10 -15 8 -15 1
    10 -38 8 -38 10 -15 8 -15 1
    10 -38 8 -38 10 -15 8 -15 1
    10 -38 8 -38 10 -15 8 -15 1
    10 -38 8 -38 10 -15 8 -15 1
    10 -38 8 -38 10 -15 8 -15 1
    10 -38 8 -38 10 -15 8 -15 1

    Weapon6

    -3 -25 -3 -5 0
    -3 -25 -3 -5 0
    -3 -25 -3 -5 0
    -3 -25 -3 -5 0
    -3 -25 -3 -5 0
    -3 -25 -3 -5 0
    -3 -25 -3 -5 0
    -3 -25 -3 -5 0
    -3 -25 -3 -5 0
    -3 -25 -3 -5 0
    -3 -25 -3 -5 0
    -3 -25 -3 -5 0


    Example 2: Action 'walk'
    ------------------------


    Shield3

    7 -35 7 -30 15 -18 15 -13 0
    6 -38 5 -35 16 -16 15 -13 0
    6 -39 5 -38 15 -15 13 -14 0
    7 -39 5 -39 15 -14 13 -14 0
    7 -38 5 -37 15 -14 13 -13 0
    7 -37 6 -34 16 -15 14 -12 0
    6 -35 6 -30 16 -18 15 -13 0
    7 -33 8 -26 14 -20 14 -13 0
    8 -30 9 -23 13 -21 14 -14 0
    9 -28 11 -20 11 -22 12 -15 0
    9 -29 11 -22 10 -21 11 -14 0
    9 -31 11 -24 11 -19 12 -12 0


    Weapon6

    -9 -22 -16 -17 0
    -9 -21 -17 -18 0
    -10 -20 -18 -19 0
    -10 -19 -18 -19 0
    -9 -19 -18 -18 0
    -9 -20 -19 -17 0
    -8 -22 -19 -17 0
    -7 -24 -19 -17 0
    -6 -25 -18 -16 0
    -6 -25 -17 -15 0
    -7 -23 -17 -13 0
    -8 -22 -18 -13 0

    Example 3: Action 'die'
    ------------------------


    Shield3

    10 -25 13 -34 14 -27 15 -36 0
    7 -25 8 -34 18 -21 19 -29 0
    11 -25 12 -33 18 -17 16 -26 0
    19 -23 15 -31 17 -20 13 -27 0
    23 -14 22 -22 12 -19 10 -27 0
    24 -1 29 -8 9 -10 13 -18 0
    22 3 27 4 18 -19 22 -19 0
    9 -1 10 4 33 -6 35 -1 0
    9 -1 10 3 32 -6 34 -3 0
    9 0 10 3 32 -6 34 -3 0
    9 0 10 3 32 -6 34 -3 0
    9 0 10 3 32 -6 34 -3 0


    Weapon6

    -3 -34 4 -23 0
    -6 -33 2 -30 0
    -6 -30 1 -32 0
    -5 -23 -4 -25 0
    -5 -5 -10 -5 0
    2 -2 -11 -10 0
    6 5 -10 1 0
    9 5 -8 3 0
    8 5 -8 3 0
    8 5 -8 3 0
    8 5 -8 3 0
    8 5 -8 3 0

    Hopefully these parm's will show up being a little bit better spaced.

  13. #13
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    Still shit! This forum does'nt like multiple spaces in lines. It reduces them all to 1 space.

    Any ideas anyone?

  14. #14
    CA CA GilJaysmith's Avatar
    Join Date
    Aug 2002
    Location
    Creative Assembly / Littlehampton
    Posts
    884

    Default

    Try the code tag... see http://www.totalwar.org/ubb/ubbcode.html

    e.g.

    code:#!/usr/bin/perl

    I'd like two spaces between each word here please.

    print "Content-type: text/html

    ";
    print "Hello World!"; [/QUOTE]


    [This message has been edited by GilJaysmith (edited 10-14-2002).]
    Gil ~ CA

    This Panda

  15. #15

    Default

    Message from my Khan...

    "Hi Wellington )"
    quote:I gallop messages around, dont track me I can bring war as well

  16. #16
    Senior Member Senior Member Lord Krazy's Avatar
    Join Date
    Jul 2002
    Location
    Elephant Free State
    Posts
    1,638

    Default

    you wrote in one of my threads that ratio at the
    end of the the line in weapon.txt

    e.g.
    Line 6: 125,252,254,254,3,1

    did not make any difference to the pespective
    of the weapon and weapon movement


    Now if one of the 0 point is in the
    center of the image and another
    on the ground so to speak and you
    change the length of an object
    and make it longer for example
    you must change the weapons files too
    if they are set for a differant weapon
    with different dynamanics
    and if you don't change the width
    then it should appear thiner and at
    somepoints make the object dissapear.
    This in my mind is changing the perspective.

    Do you understand what I mean?
    This question is for Welly btw.

    LK

  17. #17
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    PART 8: Object parameters for positioning

    Let's now look at the specific parameters that make up an action-object-line, and the considerations for object positioning on a figure-image.


    The xy-origin
    -------------

    In PART 3 above we mentioned the xy-origin, this xy-origin being the first 2 values defined on every parameter line of a specific-units action file in the ActionsPage folder.

    Remember, each of these lines also contain parameters that define the image-rectangle in the BIF's to be used for a specific action/camera-angle. Thus, the xy-origin is DIRECTLY RELATED to any figure-image for both an action and a camera-angle. Therefore, it is constant for all of the 12 frames comprising the movement-cycle, just as the other parameters on the same line (the image-rectangle coords) are.

    From this we can see there is an xy-origin for EVERY action/camera-angle, and it is defined as a pair of x/y coord parameters in a line pertaining to action/camera-angle.


    Why so many xy-origin's for just 1 specific-unit ?

    Well, unfortunately not all image-rectangles are the same size. Consider an Arbalest standing shooting and kneeling shooting. Different sizes (heights) of image-rectangles. Also, consider any unit walking. The image rectangles may be different (widths) depending on the camera-angle.

    Therefore, any figure-images image-rectangle size will differ for different actions and camera-angles. although they will be constant for a movement-cycle.

    The only image-rectangle we know is constant (for any specific-unit) for several images is the one that relates to all 12 frames in a movement-cycle - ie: the figure-image. Make sense?

    We can now say that THE XY-ORIGIN IS CONSTANT FOR ALL 12 FRAMES IN A MOVEMENT-CYCLE.


    Ok, so what is the purpose of the xy-origin?

    We have seen in the previous PART that the numeric parameters within an action-object-line may well be negative as well as positive. Why is this ?

    Well, up to this point, all image-rectangles and all x/y coordinates defining them, have been specified in numeric terms RELATIVE TO THE LOW RES BIF FRAME in which the image-rectangles are contained. In other words, relative to a 0,0 origin that is defined as the top left hand corner of the low res BIF frame. As all coords are relative to a BIF's origin point in a corner - hence all numbers are positive.


    Rescaling and reorientation
    ---------------------------

    Let's now digress a little.

    We have seen that rescaling of a figure-images image-rectangle, and perhaps reorientation also, is necessary before rendering objects onto the figure-image. After these 2 processes the image-rectangle of the figure-image can now been considered to have its OWN origin. The 0,0 origin of the image-rectangle that defines the figure-image - as opposed to the 0,0 origin of the BIF that contains image-rectangles for multiple figures, as well as image-rectangles for shields and weapons.


    To illustrate this consider the text file 'Textures\Men\ActionsPage\Pikemen'. The 1st 5 lines specify the parameters for all 4 image-rectangles (1 for each of the 4 camera-angles) for pikemen walking.

    "walk
    11 44 1 39 23 88
    16 43 221 56 253 104
    12 43 48 184 1 213
    12 44 84 80 108 130"

    Ignore the 1st 2 values per line (the xy-origin) for the moment.

    If we rescale each of the image-rectangle parameters, relative to their own x/y origins (not THE xy-origin!) we get -

    "walk
    11 44 0 0 24 48
    16 43 0 0 33 49
    12 43 0 0 -50 30
    12 44 0 0 25 51"

    (remember the last 4 values represent 2 pairs of xy-coords - all we have done is subtract the 1st x value from the 2nd, and the 1st y value from the 2nd, then added 1 - than we have the true size of the image-rectangle - relative to its own 0,0 x/y origin)

    We now see that a negative value appears in line 3. This tells us (and also tells the MTW engine) that this image-rectangle is lying horizontally in the BIF; therefore it requires reorientation. To do this merely swop the values and make all negative values positive (we are only concerned with the size of the image-rectangle - the MTW engine would have to perform a similar process for every pixel!).

    We then have -

    "walk
    11 44 0 0 24 48
    16 43 0 0 33 49
    12 43 0 0 30 50
    12 44 0 0 25 51"

    Now we have the TRUE sizes of the image-rectangles defined (the last 2 values), no longer relative to the BIF but relative to their own origins (the middle 2 values - 0,0).


    We can also now see that the xy-origin-coords (the 1st 2 values) serve to define a point (the xy-origin) in rescaled, and if necessary reoriented, image-rectangles for any figure-image.

    (Note: the image-rectangle of a figure-image only defines the maximum size of an image in a BIF - the actually fully rendered image in an animation, once shield/weapon/mount have been added, may be larger than this rectangle)

    Now lets move on to the actual parameter values.


    Weapons parameters
    ------------------

    When rendering weapons onto a figure we MUST think of the weapon image-rectangle as a line. Therefore, in order to position a weapon for any image in any frame we need 2 pairs of x/y coords to define the position of the 2 ends of the line; relative to the figure-image xy-origin.

    For weapons folders each action-object-line contains 5 parameters as follows -

    a) 2 xy-origin-positions for top left of the image-rectangle
    b) 2 xy-origin-positions for bottom right of the image-rectangle
    c) 1 rendering sequence value

    The numbers contained in a) and b) are used to reposition a weapon RELATIVE TO THE XY-ORIGIN. As the xy-origin is constant for all 12 frames in a movement-cycle this means that the positioning of weapons (and also shields) is NOT relative to any single frame but to ALL 12 FRAMES comprising the movement-cycle - regardless of what each individual frames depicts as an image.

    Two points to note here -

    First, the xy-origin may appear to be an 'arbitory position' in an image, but it is generally specified as a point that serves as the 'centre of gravity' for objects on that figure-image. For example, Pikemen may have an xy-origin close to the head for many figure-images. Specific units with smaller weapons will tend to have the xy-origin defined closer to their chest.

    Second, as the xy-origin (0,0) is a point defined somewhere in the 'middle' of any figure-image, we can expect the 2 pairs of xy-origin-positions to specify both positive and negative values, as they will have to define coords in the negative quadrents of the image-rectangle.


    The rendering-sequence-value is either '0' or '1' and merely determines which image-rectangle is rendered first.

    '0' means render the weapon before the figure
    '1' means render the figure before the weapon

    Hence the '0' and '1' really specify whether or not the weapon may be partially obscured by the figure. Obviously, this depends on the specific camera-angle for the figure-image/action.

    How much of a weapon is obscured will also depend upon the size of the weapon and the positioning of it relative to the size/position of the figure-image.

    (TIP: when building new specific units its a good idea to always specify '1' whilst testing, as this ensures that you can ALWAYS see the weapon)

    Shields parameters
    ------------------

    When rendering shields onto a figure we should think of the shield image-rectangle as a quadrilateral. Therefore, in order to position a shield for any image in any frame we need 4 pairs of x/y coords to define the position of all 4 corners of the quadrilateral; relative to the images xy-origin.

    For shields folders each action-object-line contains 9 parameters as follows -

    - 2 xy-origin-positions for top left of the image quadrilateral
    - 2 xy-origin-positions for bottom right of the image quadrilateral
    - 2 xy-origin-positions for top right of the image quadrilateral
    - 2 xy-origin-positions for bottom left of the image quadrilateral
    - 1 rendering sequence value

    (PS: I may have got the exact corners of the quadrilateral incorrect - a minor point)

    Therefore, by considering a shield image-rectangle as a quadrilateral, we can reconfigure such an image in any manner (size AND perspective) by amending 4 xy-coords. We can amend these cordinates to show a full frontal view, a side view, a tilted view - and almost anything else in between.


    'Hands on' examples!
    --------------------

    As a bit of fun only, the following example is merely to illustrate the possibilities implicit in defining an object as a shield. I'm not interested in a 'perfect images here - only to show what's possible with a little 'tweaking' of values. The following example pertains to the shield image for the French Gendarmes in the 'stand' action.

    As before -

    1) Make a backup of the 'Textures\Men\Items\Shield2\Gendarmes\stand.txt'

    2) Replace the 1st action-object-set in this stand.txt file with the action-object-set below (leave the other 36 lines as is) -

    10 -48 8 -49 10 -27 10 -28 1
    15 -48 8 -49 15 -27 10 -28 1
    20 -48 8 -49 20 -27 10 -28 1
    25 -48 8 -49 25 -27 10 -28 1
    30 -48 8 -49 30 -27 10 -28 1
    35 -48 8 -49 35 -27 10 -28 1
    40 -48 8 -49 40 -27 10 -28 1
    45 -48 8 -49 45 -27 10 -28 1
    50 -48 8 -49 50 -27 10 -28 1
    55 -48 8 -49 55 -27 10 -28 1
    60 -48 8 -49 60 -27 10 -28 1
    65 -48 8 -49 65 -27 10 -28 1

    3) Start a battle with an army that contains a French Gendarme unit, and move the camera arounf the unit whilst they are standing still.

    4) Now try playing around a little with the paramters above. See what's possible!

    5) After you've finished 'playing around' don't forget to replace the stand.txt file with the original saved backup.

    Summary
    -------

    I think by now you can see that the whole MTW animation process is governed by numbers which define positions of images, origins, coordinates, line references, values etc etc. Looks daunting at first but they DO make sense.

    I hope by this time you will have developed an appreciation of the flexabilty in the 'MTW animation system' and (maybe) you now can see the potential for amending values to change the 'effect' of some animations.

    Later on we'll look at the potential implicit in this flexability a bit more.

  18. #18
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    LK,

    I think I understand your question, and your quite correct in that I've not made this too clear -

    this feedback is good! I may have said 'rescaling' in my reply to a previous post. If so, my

    apologies for poor terminology.

    Let me try to explain like this (a bit long-winded for your specific question LK but I'm thinking

    in terms of documenting something I've overlooked so please bear with me!). If it does'nt answer

    your question let me know.


    Object and figure-image sizes in BIF's
    --------------------------------------

    Any generic-unit folder contains BIF image-rectangles for both figure-images and weapons/shields.

    Considering these image-rectangles we see 3 things -

    1) the size of all figure-images are ALWAYS constant to each other
    2) the size of all shield images are also constant to each other, but not always constant to the

    size of the figure-image that will 'carry' the shield.
    3) the size of all weapons images are NOT constant to either each other (ie: other weapons

    images) or the figure-images


    Considering 2) above we see that in the generic-unit plate for Peasants the single shield image

    defined looks fine (in terms of size) in respect of the figure images within that BIF.

    Now look in the generic-unit plate for ChainHlm. We see 5 shields, and some of them are certainly

    NOT good (in respect of size) for the figure-images defined on that plate.

    Does it matter? Absolutely not! As any shield image is always positioned by virtue of the

    parameters (4 sets of xy-coords for each corner of the shield) defined for an

    action/camera-angle/frame in an action-object-line, the size of the original image in the BIF is

    not important. In other words, a shield image is CONSTANTLY BEING RESIZED during animations.

    You can make a shield image 10 times larger than the figure-image in the BIF (if it would fit!).

    It matters not one iota!


    Two points to note for shield images -

    a) the shields.txt file within a generic-unit folder only contains parameters defining the

    image-rectangle.

    b) a shield image can only ever represent that specific shield image. It CANNOT represent any

    other object.


    Considering 3) above we see that (in any generic plate) the weapons images appear to be somewhat

    'erratic' (in terms of size) relative to the figure-images defined on any plate. Far more so than

    shield images.

    Note: a weapon image in a BIF may serve to represent many different weapons. It CAN represent

    other objects (weapons).


    Two points to note for weapons images -

    a) the weapons.txt file within a generic-unit folder contains parameters defining the

    image-rectangle, and also 2 more parameters that serve to define the size of the weapon (relative

    to the figure-image). Let's call these 2 parameters the 'weapon scaling parameters'.

    b) a weapons image can represent multiple weapons, by virtue of the 2 'extra' parameters for

    weapons referenced in a) above . It CAN represent any object that differs only in terms of size.

    For example, a spear weapon may also be used to represent a pike - a poleaxe weapon may also be

    used to represent a 'hand axe', etc, etc, etc.


    The two stages of object scaling
    --------------------------------

    We can now say, in terms of object images -

    - a shield image represents a single specific shield; full stop!
    - a weapon image may represent multiple weapons (accomplished via the last 2

    weapon-scaling-parameters as defined in the weapons.txt files).


    Therefore, before any figure-image is rendered (with it's weapon/shield/mount) a rescaling

    process must take place ONLY IN RESPECT OF WEAPONS, before the actual positioning of weapons and

    shields relative to a figure-image frame can take place.

    Hence, the MTW engine must consider 2 stages in respect of object scaling, and must 'ask itself'

    the following questions -.

    Stage 1: Do any weapons require rescaling, in respect of their size relationship with the

    figure-image, in order to portray a different type of weapon. Should a weapon image really

    portray a spear or a pike (sizewise)? Let's check the last 2 parameters of the appropiate line in

    the weapons.txt file. If we have to rescale, let's do it now before the second stage (which

    allows for positioning as opposed to size!). We can ignore shield images - they can only ever

    represent 1 image (and hence don't have the same last 2 parameters that weapons images have for

    rescaling).

    Stage 2: Ok, any weapons that may have been resized are now THE CORRECT SIZE, IN TERMS OF A

    SPECIFIC WEAPON OBJECT THEY ARE INTENDED TO PORTRAY, AND IN RELATIONSHIP WITH THE FIGURE-IMAGE.

    Now let's look at how the weapons and shields objects require positioning on the figure-image,

    via the action-object-sets and action-object-lines in order to change the perspective of these

    objects, if necessary, for any frame in the movement-cycle.


  19. #19
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    At this stage I should say 2 things -

    a) I don't knoe exactly where my contributions to this thread will end, but my final PART will cover a checklist for creating new units within MTW. Probably be named 'PART x: Checklist for adding new units' or something similar.

    b) Please feel free to question, and/or correct anything I've written. First, I certainly don't 'know it all' and I'm sure other people can contribute. Second, as the info in this thread is intended to serve as the basis for an 'MTW Animations modding guide' I would appreciate comments in respect of mistakes/omissions/repetition/bad terminology/confusing points/insufficient examples etc, etc

  20. #20
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    Quote Originally posted by GilJaysmith:
    Try the code tag... see http://www.totalwar.org/ubb/ubbcode.html

    e.g.

    code:#!/usr/bin/perl

    I'd like two spaces between each word here please.

    print "Content-type: text/html

    ";
    print "Hello World!"; [/QUOTE]


    [This message has been edited by GilJaysmith (edited 10-14-2002).]
    [/QUOTE]

    Thanks for the tip GilJay.

    However, considering my last post for LK ...

    ... any ideas on prevent multiple spaces between lines ?

    I HATE documentation on PC's. Give me ISPF or Script any day!

  21. #21
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    PART 9: Mounts (camels and horses)


    Up to this point we have only considered infantry figures. Now let's take a look at the cavalry.

    There are 5 generic-unit folders that contain images for mounts -

    1) Armhorse (an armoured horse)
    2) Camel (an african camel)
    3) Ehorse (an East-european style horse)
    4) Khorse (a Knights horse)
    5) Lihorse (a light horse)

    Mounts are ALWAYS generic. Therefore, unlike the generic-unit folders for figure-images

    (infantrymen/cavalrymen), the generic-unit folders for mount-images contain nothing else. There is

    nothing specific to associate with a mount within its folder.

    These folders each contain a hi res and a low res BIF, depicting 16 images only.

    These 16 images represent 4 actions, and 4 camera-angles per action, for any mount.

    Mount-images only have 4 actions associated with them (stand, walk, run and die). Why? Because

    although the figure-images of the cavalryman may have multiple actions associated with them, the

    mount-image is not capable of some of these actions (eg: fight, shoot).

    Therefore, an appropiate action for the mount must be considered depending on the actual action of

    the cavalryman.

    For example -

    - figure-image action stand/shoot/fight = mount-image action stand
    - figure-image action run/charge = mount-image action run
    - figure-image action walk = mount-image action walk
    - figure-image action die = mount-image action dies .... and so on and so forth

    Therefore we can see that mount-images, just like figure-images, are also 'action driven', but are

    directly related to the action being performed by the cavalyman.

    As all mounts are generic, any specific-units (representing a cavalryman - not an infantryman!)

    may be associated with any mount. This association is, again, contained in the crusader_prod11.txt

    file.


    Mount definitions
    -----------------

    Where are the actions and image-rectangles for mount-images defined? In there own text file within

    the same 'Textures\Men\ActionsPage' folder that also contains the specific-unit definitions. Let's

    call these text files the 'mount definition' file. For mounts the names of the mount-definition

    files are exactly the same as those of the generic-unit folders for mounts.

    The contents of these mount-definition files contain similar lines and parameters as for

    specific-units (an action followed by 4 camera-angle parameter lines), BUT ARE USED FOR 2 SLIGHTLY

    DIFFERENT PURPOSES -

    1) the actions do NOT represent the mount actions, but the actions of any specific-unit that may

    be associated with this mount.
    2) the xy-coords are NOT used for the positioning of weapons/shields, but for the positioning of

    the Cavalrymans image-reactangle relative to the image-rectangle of the mount.


    For example, consider the mount-definition file 'Textures\Men\ActionsPage\Lihorse.txt' for the

    action standing_shoot -

    "standing_shoot
    14 54 195 1 138 29
    21 50 195 125 246 175
    19 44 165 124 121 175
    12 40 37 95 65 142"


    The parameters still represent 2 xy-origin-coords, and 4 xy-coords for the image rectangle.

    However, considering the first parameter line, this now reads as -

    "for any cavalryman image that is performing a standing_shoot action for camera-angle 1, use the

    mount image (in this example in the Lihorse BIF) as defined by the image-rectangle 195/1 138/29,

    then position the cavalryman relative to the point 14/54 in the mounts image-rectangle"

    Note that any shield or weapon should have already been positioned on the cavalrymans

    image-rectangle mount positioning takes place.

    So, the xy-origin's for figure definitions serve to position objects on a figure-image. The

    xy-origins for mount definitions serve to position a figure-image, together with his objects, on a

    mount-image.

    Note: the figure-image is ALWAYS rendered 2nd (ie: over the mount-image).


    Positioning a figure on a mount
    -------------------------------

    Now lets take a look at the actual positioning process for mount and cavalryman.

    If we rescale and reorient the values for the mounts image-rectangles in the example above we get

    -

    "standing_shoot
    14 54 0 0 30 58
    21 50 0 0 52 51
    19 44 0 0 45 52
    12 40 0 0 29 48"

    We now see the xy-origins lie (generally) within the figure and somewhere near the 'top middle'!

    They actually define a point just above the centre of the saddle on the mounts image-rectangle,

    which is covenient for the positioning of the cavalyman.


    Now let's take a look at a cavalryman (we'll use HorseArchers) that will use these 4

    action/camera-angle image-rectangles for this mount. The file

    'Textures\Men\ActionsPage\HorseArchers.txt' for the action standing_shoot contains -

    "standing_shoot
    16 62 210 1 170 30
    13 62 28 59 58 100
    7 62 254 1 212 24
    8 60 26 102 48 141"

    Rescale and reorient -

    "standing_shoot
    16 62 0 0 30 41
    13 62 0 0 31 42
    7 62 0 0 24 43
    8 60 0 0 23 40"

    Now look at the actual sizes of the image-rectangles (30/41, 31/42 etc) and consider the centre of

    these image-rectangles. In order to position a figure relative to a mount, the MTW engine aligns

    the centre of the image-rectangle for the cavalrymans figure-image over the xy-origin of the mount

    figure-image. Is it as simple as this ? NO! But this is enough info to serve our purposes.

    So, are ALL cavalryman generic-units and mount generic-units interchangeable ? Yes, it appears so

    (allthough I hav'nt checked every combination!). Therefore if you want to create a new specific

    unit by placing a Turkish Archer on a Knights horse - you can do so. Don't ask me what this new

    specific-unit would represent; it's only an example.


    'Hands on' example
    ------------------

    To illustrate the above (and because its also a bit of fun!) try the following simple examples -

    1) take a backup copy of the mount-definition file in 'Textures\Men\ActionsPage\Lihorse.txt'

    2) amend the xy-origins for the 4 camera-angles for the stand action from

    "stand
    14 54 195 1 138 29
    21 50 195 125 248 175
    19 44 165 124 121 177
    12 40 37 95 66 142"

    to

    "stand
    14 0 195 1 138 29
    21 0 195 125 248 175
    19 0 165 124 121 177
    12 0 37 95 66 142"

    then see what what happens on the battlefield for any Cavalry specific-unit using this mount (eg:

    Hobilars, HorseArchers, etc whilst they are standing.

    3) amend the xy-origin again to


    "stand
    14 100 195 1 138 29
    21 100 195 125 248 175
    19 100 165 124 121 177
    12 100 37 95 66 142"

    and check again.

    4) play around if you wish but don't forget to replace the backup copy after you've finshed.


    (TIP: we can 'play about' with positioning values whilst in the same battle. Start a battle,

    pause, Ctrl/Esc to desktop, change the values in whatever files your 'playing with', save them,

    select the MTW battle again from the taskbar - the changes will take effect immediately. A lot

    quicker than starting a new battle every time you change something!)


    Example summary
    ---------------

    There are two points to note from this example -

    1) it's now obvious that the mount is positioned in respect to the cavalryman figure-image.
    2) the algorithm used to position a mount image-rectangle relative to a cavalrymen image-rectangle

    is actually more complex than we have specified above (but I have'nt worked out the exact formula
    yet).

  22. #22
    Senior Member Senior Member Lord Krazy's Avatar
    Join Date
    Jul 2002
    Location
    Elephant Free State
    Posts
    1,638

    Default

    Just to clarify this point
    from Welly.
    _____________________________________________


    (TIP: we can 'play about' with positioning values whilst in the same battle. Start a battle,

    pause, Ctrl/Esc to desktop, change the values in whatever files your 'playing with', save them,

    select the MTW battle again from the taskbar - the changes will take effect immediately. A lot

    quicker than starting a new battle every time you change something!)
    _____________________________________________

    Do NOT copy a file from another directory
    as this will not take affect.Just edit
    fles in the directory they are in and do not
    move them.Moving files from directory to
    directory after you boot the game
    dose not work well.
    Just to make sure you don't misunderstand
    what the man said.

    great work welly

    LK

  23. #23
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    Thanks for the clarification LK.

    I also was'nt sure if you could do this if you have a super PC with loads of memory. Maybe, with enough spare memory, the MTW engine would have more images pre-loaded - so you may not see some changes?

    Hard to tell.

  24. #24
    Senior Member Senior Member Lord Krazy's Avatar
    Join Date
    Jul 2002
    Location
    Elephant Free State
    Posts
    1,638

    Default

    Quote Originally posted by Wellington:
    Thanks for the clarification LK.

    I also was'nt sure if you could do this if you have a super PC with loads of memory. Maybe, with enough spare memory, the MTW engine would have more images pre-loaded - so you may not see some changes?

    Hard to tell.
    [/QUOTE]

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

    This is also the case it seems.

    LK

  25. #25
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    Ok, to continue this thread I first have to post a correction to my previous (incorrect!) deliberations in PART 5.

    So please read the next post as an amendment that replaces PART 5.

  26. #26
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    PART 5: More on weapons and shields (AMENDMENT TO ORIGINAL TEXT)

    Weapons resizing
    ----------------

    Weapons.txt also contains 2 more numbers. These are used for the rescaling of weapons, relative to the figure-image, BEFORE a full image is rendered.


    For example, look at the weapons.txt in Peasant folder. A single image-rectangle (representing the spear) is defined twice -

    Line 6: 125,252,254,254,3,1
    Line 7: 125,252,254,254,5,1

    Line 6 defines a spear, line 7 a pike. The image is the same but the last 2 numbers serve to resize the length and breadth of the image in order to represent either a spear or a pike.

    These last two values in such lines represent -

    a) a length-multiplier for the weapon; prior to rendering
    b) a breadth-multiplier for the weapon; prior to rendering

    Therefore, 'Line 6' can be read as - "this weapon should be increased 3 fold in length before any rendering takes place, but retain the width (ie: 1 times the size modifier)".

    Similarly, 'Line 7' can be read as - "this weapon should be increased 5 fold in length before any rendering takes place, but retain the width"

    Hence these two weapons definitions serve to identify these 2 weapons to be in the ratio 3:5 lengthwise, whilst retaining the original width (as drawn on the BIFs).


    Likewise within the weapons.txt in MShelm folder we have -

    Line 3: 92,216,172,230,2,3
    Line 4: 92,216,218,230,1,3

    Both lines define the image-rectangle for a poleaxe weapon. Line 4 is used for Crossbows, line 3 for MilitiaSergeants. If we now read the last 2 figures as modifiers for both length and breadth we see that for MilitiaSergeants (line 3) this means the size of the poleaxe should be resized to be twice as long and three times as wide before rendering considerations for the figure-images. For Crossbows (line 4) this means the size of the poleaxe should be resized to be the same length but three times as wide before rendering considerations.

    The size of this 'poleaxe' image as rendered for the 2 units will now be in the ration 2:1, and for the Crossbows it now appears as a 'handaxe' as opposed to a 'poleaxe'.

    The following PARTS in this guide will serve to illustrate these parametres by examples.


    Note: whilst these 2 resizing parameters are VERY IMPORTANT in terms of determining weapon sizes in respect of each other, and in relation to the figure-image, they are ALWAYS SCALED A 2ND TIME on the battlefield, to ensure these resized images fit within the co-ordinates defined by the action-object-lines pertaining to the figure-image/camera-angle/frame.


    Therefore the last 2 numbers in a weapons.txt line serve 3 purposes -

    1) to resize a weapons length relative to a figure
    2) to resize a weapons breadth relative to a figure
    3) to portray a different type of weapon - by virtue of size (ie: the 2 constraints mentioned above).


  27. #27
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    This thread WILL CONTINUE!

    Next 3/4 parts will be posted this weekend.

  28. #28
    Senior Member Senior Member Lord Krazy's Avatar
    Join Date
    Jul 2002
    Location
    Elephant Free State
    Posts
    1,638

    Default

    It better or I'll come to you house and
    throw stones at your window
    I'd use a sling but I haven't
    got one

    LK

  29. #29
    Member Member Fearless's Avatar
    Join Date
    Oct 2002
    Location
    London, Great Britain
    Posts
    272

    Default

    Hey Wellington!...... I am sitting waiting for the continuation of your very interesting write up. Any news??

  30. #30
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    Coming tonight 3 more parts - I PROMISE!!!

    Got a bit tied up working with LK on the new units.

Page 1 of 4 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO