Jump to content
Sign in to follow this  
Chill xl

Formation configuration

Recommended Posts

I'm trying to figure out how formations (collumn, wedge etc) for groups are configured / work, with the intent to modify them (if possible).

From the Armaholic site i've picked up a message that these were set in config file (for OA), i believe KJU pointed into that direction. However i cannot seem to find the right files / pbo's that hold this information.

  1. Could someone help me out where i can find the configs or scripts that describe how formations are formed?
  2. Is it (at all) possible to mod formations?

Thanks in advance :)

Share this post


Link to post
Share on other sites

\expansion\dta\bin.pbo > class cfgFormations.

Looks like you can even have different sides use different formations. I don't think I've ever seen any documentation on this, as it was introduced in AO.

class EchelonLeft
{
       class Fixed
       {
               FormationPositionInfo1[] = {-1, 0, 0, 0};
               FormationPositionInfo2[] = {0, -1, -1, "-0.78539816339744830961f"};
               FormationPositionInfo3[] = {1, -1, -1, "-0.78539816339744830961f"};
               FormationPositionInfo4[] = {2, -1, -1, "-1.57079632679489661923f"};
        };

        class Pattern
        {
               FormationPositionInfo1[] = {-1, -1, -1, 0};
               FormationPositionInfo2[] = {0, -1, -1, "-0.78539816339744830961f"};
               FormationPositionInfo3[] = {1, -1, -1, "-0.78539816339744830961f"};
               FormationPositionInfo4[] = {2, -1, -1, "-1.57079632679489661923f"};
        };
};

basically FormationPositionInfo entries define each position in the formation. My guess is that you could have as many entries as you like because some formations only use 2 and some use 4.

{0, -1, -1, "-0.78539816339744830961f"} seems to mean {x, y, z, angle}. The numbers are probably not a measurement but a multiple of the unit's formation size variable. The max angle value used is pi, not sure what angles have to do with it though.

No idea what the difference is between class Fixed and class Pattern, although the xyz coordinates differ between them, the angles are always the same

Unknown if you can add a new formation, but I don't see why you couldn't...

hmm it isn't {x,y,z,angle}, and there appears to be a fifth variable, it is always 0 when present. Boolean maybe?

{index number, X (side to side offset), Y (front to back offset), unknown, unknown}.

+X = to the right -X to the left

+Y = forward in the formation -Y = rearward in the formation.

It appears that FormationPositionInfo isn't an individual unit's offset but rather a subdivision of the units. For example, using 2 FormationPositionInfo entries divides the units into 2 groups and then defines their offset relative to the next unit in the "group". It is possible to make uneven formations.

Edited by Sakura_Chan

Share this post


Link to post
Share on other sites

Thanks alot, you got me right into modifying formations! (Not sure yet how to add new ones, but that for later)

Creating a formation is not that easy because it is highly relative and has no relation to roles only to unit number in the group. What i've dicsovered so far is that fhe formation formula describes where a unit goes in order of their number and relative to the previous unit position.

First it places the formation leader (-1). The formation leader is usually also the group leader but often when a vehicle is involved the vehicle becomes formation leader. Then the second unit is placed using a x/y or x/z offset (-1 means 10 meter to left of the previous). Each unit can also be placed with an angle, this angle is relative to the group-direction and becomes "active" when the group is holding or stopped.

FormationPositionInfo:

{index number, X (side to side offset), Y (front to back offset), angle, unknown}.

Negative X moves to unit to the left, negative Y moves the unit to the front. The last param is only used with delta or compact collumn, not sure what it does.

Anyway, in my first attempt i've managed to create a squad collumn (US Army) where the first 4 units (fireteam 1) are in a wedge in front of the Squad Leader and the last 4 units (fireteam 2) are behind the leader in a mirrored wedge. The result is great apart from the AR being on the wrong side (because by default the Grenadier is listed before the AR).

However when units are differently listed / ranked, the overall results are the same (unless a vehicle is involved which messes up alot) but the fireteams are scrambled all over the squad. This is apparent for example with the USMC squad which has a totally different group layout as opposed to the default US Army layout (OA). The Army (OA) layout which lists by FT respectively and the default USMC lists units by ranks (first the FTL's, then all the AR's etc). I think to get a more consistend formation result i should provide new group layouts that use the same placement order aswell.

Edited by Chill xl

Share this post


Link to post
Share on other sites

I found that if you use indexes below -1, you can have some very different behavior. You can place individual units that are 'independant' ei. they don't follow another unit but instead just try to move relative to the leader. Could be useful in some situations. I'm not sure what the cause was, but when messing around I made a few formations that would crash the game when non-player units were leaders (or because there were too few units)

Wouldn't just adding a new class of formation and using

(group player) setFormation "NEW FORMATION";

work?

Edited by Sakura_Chan

Share this post


Link to post
Share on other sites

i think that would work, i was able to get a new formation class in but because the command menu was not adapted i couldnt make easy use of it.

From my recent testing i believe the index numbers in the pattern section are relative to the current iteration. Each iteration of the pattern starts with a negative index nr that points to a previous (unit placement) and uses that as reference to place the new unit. So a negative index number, lets say -3 takes the third last unit placement as reference and positions the new unit with an offset to this one.

The fixed section always starts with -1 and i'm fairly sure that has to do with the (odd) behavior when for example a vehicle is attached to the group.

For some reason the vehicle is prioritised and based on the crew ranks either positioned in the group before or right after the group leader. Before would mean the vehicle has group number 1 and will take the -1 position of the formation and the leader moves into the 0 position of the formation. When the vehicle is right after the group leader in the group (number 2) it will take the 0 position of the formation where the group leader assumes the -1 position of the formation.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×