Overcoming Formation Stacking

Discussion in 'Modding' started by Ftoomsh, Nov 24, 2019.

  1. Ftoomsh

    Ftoomsh Well-Known Member

    My next target for OCMOD3 is formation stacking and attack compression of units. First we need definitions and explanations.

    1. Formation stacking - Occurs when the player moves two or more formations onto the one piece of terrain. The result is a very compressed line, column or square with more than one formation in it. In reality, formation stacking would be impossible. Formations in close order already place men as close to each other as they can be and still use their weapons effectively. That is they must have basic elbow room to use weapons and basic stride room to move without tripping up each other. Another close order formation cannot stack on or within an existing close order formation in the real world in the era in question. Apart from realism "requirements", formation stacking ruins the game anyway (IMHO). It prevents proper disposition of formations and use of tactics.

    2. Attack Compression - Occurs when the attack command is used on enemy units (except in State vs. Country where this fault is corrected). Also occurs in general attacks under certain conditions. The player might not give an explicit order that leads to compression but the game conditions and game engine "decisions" lead to it.

    We need to be able to define unit space ("elbow room") in such a way that these problems cannot occur. At the same time we do not want to cause movement problems or hangups on obstacles. Does anyone have any ideas at this stage? If only formation spacing stayed constant under movement and battle pressures. This would mean formations could deform (stream out for example) but never compress more than the standard "at ease" formation spacing. What sets this spacing? Why do movement and attack compress this spacing (to almost nothing sometimes)?

    First thoughts anyone?
    Loner likes this.
  2. Ftoomsh

    Ftoomsh Well-Known Member

    Okay, let me kick off this discussion. If I go to dmscript and increase the following parameters by 10 times as shown here;

    gc_collision_mass_default = 1; // Ftoomsh blindly multiplies each parameter 10 times to test this block
    gc_collision_mass_stand = 15;
    gc_collision_mass_attack = 30;
    gc_collision_radius_default = 1.6;
    gc_collision_radius_stand = 1;
    gc_collision_radius_attack = 1;

    What happens in the test? Units get elbow room about equal to or slightly large than their little display circle around their feet. If barracks are streamed to a point, the units push each other aside to stand at their little circle diameter spacing. The pushed units slide, they do not walk. Formations will not line up properly as the new "elbow room" is obviously larger than formation spacing. Where is this formation spacing defined? I admit I haven't found it yet. Units still compress in attack so the attack function over-rides the elbow-room function. Units will press in to pike range (in this case as I tested pikes) to hit enemy units.

    This indicates that to maintain spacing and avoid compression in battle, the modder would have to do most or all of the following using this approach;

    1. Raise radius parameters by about a factor of 10 as above;
    2. Maybe change mass parameters or maybe not;
    3. Redefine formation spacing, not in formations.cfg but in the routines that set the spacing of formations defined in formations.cfg
    4. Put limits in the attack routines to prevent them over-riding radius definitions in dmscript.global.
    5. Maybe increase pike ranges and sword ranges so cold steel units can still reach enemies under the parameters and conditions above.

    Again, any thoughts anyone? :)

    I have another wild theory to do with terrain tiles. As we can limit the number resource "attackers" (really resource gatherers) working on a given resource tile, could we limit all units to a tile occupancy limit? This would mean too many units could not press onto one tile of terrain with maybe different limits for infantry and cavalry. What if for example, no more than 16 infantry could stand on a tile? However, would this seriously mess with movement (pathing) and would we see diamond patterns (as tiles are like diamonds or lozenges in view) as formations "log-jammed" as they simply sought to pass through tiles?
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice