Changes between Version 2 and Version 3 of Formations


Ignore:
Timestamp:
Jan 7, 2014, 10:57:19 PM (10 years ago)
Author:
leper
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Formations

    v2 v3  
    11== Adding a formation ==
    2 
    32Adding a formation has become more simple. The only thing you need to do is making a formation template (like any entity template), preferably in the ''formations'' subdirectory. See one of the [http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/templates/formations existing templates]. You also need to make a unit, and make it available under the same name in the [http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/art/textures/ui/session/icons/formations formation icons].
    43
     
    109
    1110== Formation parameters ==
    12 
    1311The formation parameters change the look and working of formations.
    1412
    1513=== !FormationName ===
    16 
    1714This name will be used in the GUI tooltip
    1815
    1916=== !SpeedMultiplier ===
    20 
    21 The default speed of a formation is the minimum speed of all members. But a formation can have a SpeedMultiplier to modify that default speed. E.g. a SpeedMultiplier of 0.5 will make the formation half as fast.
     17The default speed of a formation is the minimum speed of all members. But a formation can have a !SpeedMultiplier to modify that default speed. E.g. a !SpeedMultiplier of 0.5 will make the formation half as fast.
    2218
    2319=== !FormationShape ===
    24 
    2520The formation shape is a general description of the shape. Currently, "square" and "triangle" are supported. "special" is also used, but for those formations, the code to calculate the positions has to be specified in JS.
    2621
    2722=== !ShiftRows ===
    28 
    2923If this tag is set to "true", subsequent rows will be shifted.
    3024
    3125=== !SortingClasses and !SortingOrder ===
    32 
    33 The formation positions are created in a certain order. By default, the first position is the center of the first row, then filling the row outwards, and starting again in the center of the next row. The positions are then filled in the order defined by the SortingClasses. F.e. if "Melee" is your first sorting class, then it will try to fill the first row with melee units, if there are still melee units left, it will fill the second row, ... The SortingOrder tag can be used to change the order in which the positions are filled. Currently there are two supported orders: "fillFromTheSides" and "fillToTheCenter". FillFromTheSides will start filling from the sides instead of the front of your formation. This can be handy to get the cavalry on the sides. The fillToTheCenter will start with filling all borders of the formation (thus the front and last row, and the side columns). This is handy to protect vulerable units in the middle of the formation if you expect attacks from all sides.
     26The formation positions are created in a certain order. By default, the first position is the center of the first row, then filling the row outwards, and starting again in the center of the next row. The positions are then filled in the order defined by the !SortingClasses. F.e. if "Melee" is your first sorting class, then it will try to fill the first row with melee units, if there are still melee units left, it will fill the second row, ... The !SortingOrder tag can be used to change the order in which the positions are filled. Currently there are two supported orders: "fillFromTheSides" and "fillToTheCenter". !fillFromTheSides will start filling from the sides instead of the front of your formation. This can be handy to get the cavalry on the sides. The fillToTheCenter will start with filling all borders of the formation (thus the front and last row, and the side columns). This is handy to protect vulerable units in the middle of the formation if you expect attacks from all sides.
    3427
    3528=== !WidthDepthRatio ===
    36 
    37 The WidthDepthRatio will define the general shape of the formation. A WidthDepthRatio will try to create a perfect square (expressed in number of units, not in meters). A WidthDepthRatio of 2 will try to create a formation that's twice as wide as it's deep. And a WidthDepthRatio of 0.5 will try to create a formations that's twice as deep as it's wide.
     29The !WidthDepthRatio will define the general shape of the formation. A !WidthDepthRatio will try to create a perfect square (expressed in number of units, not in meters). A !WidthDepthRatio of 2 will try to create a formation that's twice as wide as it's deep. And a !WidthDepthRatio of 0.5 will try to create a formations that's twice as deep as it's wide.
    3830
    3931=== !MinColumns, !MaxColumns and !MaxRows ===
    40 
    41 These tags should be pretty clear, but they can collide a bit. When the MinColumns is defined, it will start with filling that number of columns before starting a new row. When MaxColumns and MaxRows are defined, and the number of entities is too big to fit in those constraints, it will keep the MaxRows as wanted, but will go over the MaxColumns. When there are no problems with constraints, it will fall back to using the WidthDepthRatio.
     32These tags should be pretty clear, but they can collide a bit. When the !MinColumns is defined, it will start with filling that number of columns before starting a new row. When !MaxColumns and !MaxRows are defined, and the number of entities is too big to fit in those constraints, it will keep the !MaxRows as wanted, but will go over the !MaxColumns. When there are no problems with constraints, it will fall back to using the !WidthDepthRatio.
    4233
    4334=== !CenterGap ===
    44 
    4535The size of the central gap in the formation (for a flank formation). The gap is expressed in number of units (so will be wider when your formation contains bit units).
    4636
    4737=== !UnitSeparationWidthMultiplier and !UnitSeparationDepthMultiplier ===
    48 
    4938Normally, the units are placed on a distance in the formation based on their footprint size. By using these variables, you can place them closer together, or further apart.
    5039
    5140=== Animations ===
    52 
    5341The formation component can also replace animations (currently movement animations, but later also attack and idle animations). This is an example of animation-replacement code. This is an example:
    5442
     
    6553</Animations>
    6654}}}
    67 
    6855The above example schema replaces the walk and run animations for row1 and 2. The indices you see denote a rectangle with the following parameters: ''rowStart..rowEnd,columnStart..columnEnd''. You can use negative indices to denote the last row/column, second to last, etc. Then after the ":", the name of the replacement animation is given. That name needs to be present in the actor file. Else the animation will fall back to "idle", as for all missing animations. The different rectangle definitions need to be separated by a ";" character. Indices that fall out of all rectangle definitions will keep using the default animation (in this case, the "walk" and "run" animation).