As I already told you in a private message what you see is the default behavior of FOG2 as formations have only been defined for 2, 4, 8, 12 and 16 figures per unit.
These are defined in FUNCTION FORMATION_CALLBACK in callbacks.bsf that is located in ...\Field of Glory II\Data\Battle\Scripts. With every update of FOG2 this file can be overwritten in that location.
I don't know if it can also be kept in a campaign folder in ..\Documents\My Games\FieldOfGlory2\CAMPAIGNS because then it would not be overwritten when a new version of FOG2 becomes available.
do you know if this is possible? Maytbe putting it in a folder Scripts in the campaign folder?
For now I have created a new version based on the latest version of callbacks.bsf, i.e the one from FOG2:Rise of Persia.
For each future version the below code needs to be inserted in FUNCTION FORMATION_CALLBACK of the latest version of callbacks.bsf, before the line stating
Code: Select all
if (manCount == 3)
{
if (IsLightTroops(me) == 0)
{
if (moraleState == 0)
{
SetFormationRowXYExtended(0, 0, -18);
SetFormationRowXYExtended(1, 0, 14);
SetFormationRowXYExtended(2, 0, -2);
}
if (moraleState == 1)
{
SetFormationRowXYExtended(0, -4, -18);
SetFormationRowXYExtended(1, 0, 14);
SetFormationRowXYExtended(2, 4, -4);
}
if (moraleState == 2)
{
SetFormationRowXYExtended(0, -4, -16);
SetFormationRowXYExtended(1, -8, 20);
SetFormationRowXYExtended(2, 0, -4);
}
if (moraleState > 2)
{
// Use default blob
}
}
else
{
if (moraleState == 0)
{
SetFormationRowXYExtended(0, 2, -18);
SetFormationRowXYExtended(1, -4, 14);
SetFormationRowXYExtended(2, 4, -2);
}
if (moraleState == 1)
{
SetFormationRowXYExtended(0, 6, -16);
SetFormationRowXYExtended(1, -2, -4);
SetFormationRowXYExtended(2, 0, 14);
}
if (moraleState == 2)
{
SetFormationRowXYExtended(0, 6, -16);
SetFormationRowXYExtended(1, -8, 12);
SetFormationRowXYExtended(2, 0, -4);
}
if (moraleState > 2)
{
// Use default blob
}
}
}
if (manCount == 5)
{
if (moraleState == 0)
{
SetFormationRowXYExtended(0, 8, -10);
SetFormationRowXYExtended(1, 8, 6);
SetFormationRowXYExtended(2, -8, -18);
SetFormationRowXYExtended(3, -8, 14);
SetFormationRowXYExtended(4, -8, -2);
}
if (moraleState == 1)
{
SetFormationRowXYExtended(0, 10, -24);
SetFormationRowXYExtended(1, 8, 10);
SetFormationRowXYExtended(2, -12, -24);
SetFormationRowXYExtended(3, -8, 4);
SetFormationRowXYExtended(4, -10, 14);
}
if (moraleState == 2)
{
SetFormationRowXYExtended(0, 8, -24);
SetFormationRowXYExtended(1, 12, 20);
SetFormationRowXYExtended(2, -8, 26);
SetFormationRowXYExtended(3, -12, -24);
SetFormationRowXYExtended(4, -16, 4);
}
if (moraleState > 2)
{
SetFormationRowXYExtended(0, 16, 20);
SetFormationRowXYExtended(1, 2, -8);
SetFormationRowXYExtended(2, -6, 4);
SetFormationRowXYExtended(3, -16, 22);
SetFormationRowXYExtended(4, -26, -14);
}
}
if (manCount == 7)
{
if (moraleState == 0)
{
SetFormationRowXYExtended(0, 8, -18);
SetFormationRowXYExtended(1, 8, 14);
SetFormationRowXYExtended(2, 8, -2);
SetFormationRowXYExtended(3, -8, 22);
SetFormationRowXYExtended(4, -8, -26);
SetFormationRowXYExtended(5, -8, 6);
SetFormationRowXYExtended(6, -8, -10);
}
if (moraleState == 1)
{
SetFormationRowXYExtended(0, 10, -20);
SetFormationRowXYExtended(1, 8, -6);
SetFormationRowXYExtended(2, 12, 14);
SetFormationRowXYExtended(3, -8, 26);
SetFormationRowXYExtended(4, -12, -24);
SetFormationRowXYExtended(5, -8, 4);
SetFormationRowXYExtended(6, -10, -8);
}
if (moraleState == 2)
{
SetFormationRowXYExtended(0, 10, -20);
SetFormationRowXYExtended(1, 12, 20);
SetFormationRowXYExtended(2, 8, -10);
SetFormationRowXYExtended(3, -8, 26);
SetFormationRowXYExtended(4, -12, -24);
SetFormationRowXYExtended(5, -8, 4);
SetFormationRowXYExtended(6, -16, -8);
}
if (moraleState > 2)
{
SetFormationRowXYExtended(0, 16, -20);
SetFormationRowXYExtended(1, 20, 14);
SetFormationRowXYExtended(2, 2, -8);
SetFormationRowXYExtended(3, -16, 22);
SetFormationRowXYExtended(4, -16, -14);
SetFormationRowXYExtended(5, -18, 4);
SetFormationRowXYExtended(6, -26, -8);
}
}
if (manCount == 14)
{
// Positions reorganised so that men can be removed in order
if (moraleState == 0)
{
SetFormationRowXYExtended(0, 18, -24);
SetFormationRowXYExtended(1, 18, 24);
SetFormationRowXYExtended(2, 18, -8);
SetFormationRowXYExtended(3, 18, 8);
SetFormationRowXYExtended(4, 6, 16);
SetFormationRowXYExtended(5, 6, -16);
SetFormationRowXYExtended(6, 6, 0);
SetFormationRowXYExtended(7, -6, 24);
SetFormationRowXYExtended(8, -6, -24);
SetFormationRowXYExtended(9, -6, 8);
SetFormationRowXYExtended(10, -6, -8);
SetFormationRowXYExtended(11, -18, 16);
SetFormationRowXYExtended(12, -18, -16);
SetFormationRowXYExtended(13, -18, 0);
}
if (moraleState == 1)
{
SetFormationRowXYExtended(0, 20, -24);
SetFormationRowXYExtended(1, 18, 24);
SetFormationRowXYExtended(2, 14, -8);
SetFormationRowXYExtended(3, 18, 8);
SetFormationRowXYExtended(4, 4, 16);
SetFormationRowXYExtended(5, 6, -16);
SetFormationRowXYExtended(6, 6, 0);
SetFormationRowXYExtended(7, -8, 24);
SetFormationRowXYExtended(8, -6, -24);
SetFormationRowXYExtended(9, -2, 8);
SetFormationRowXYExtended(10, -6, -8);
SetFormationRowXYExtended(11, -18, 16);
SetFormationRowXYExtended(12, -20, -16);
SetFormationRowXYExtended(13, -14, 0);
}
if (moraleState == 2)
{
SetFormationRowXYExtended(0, 20, -24);
SetFormationRowXYExtended(1, 18, 20);
SetFormationRowXYExtended(2, 14, -8);
SetFormationRowXYExtended(3, 18, 10);
SetFormationRowXYExtended(4, 4, 10);
SetFormationRowXYExtended(5, 6, -16);
SetFormationRowXYExtended(6, 10, 0);
SetFormationRowXYExtended(7, -8, 20);
SetFormationRowXYExtended(8, -6, -24);
SetFormationRowXYExtended(9, -2, 4);
SetFormationRowXYExtended(10, -6, -8);
SetFormationRowXYExtended(11, -18, -16);
SetFormationRowXYExtended(12, -20, 10);
SetFormationRowXYExtended(13, -18, -8);
}
if (moraleState > 2)
{
SetFormationRowXYExtended(0, 24, -20);
SetFormationRowXYExtended(1, 16, 16);
SetFormationRowXYExtended(2, 14, 0);
SetFormationRowXYExtended(3, 18, 10);
SetFormationRowXYExtended(4, -2, 4);
SetFormationRowXYExtended(5, 4, -6);
SetFormationRowXYExtended(6, -6, 0);
SetFormationRowXYExtended(7, -16, 22);
SetFormationRowXYExtended(8, -16, -14);
SetFormationRowXYExtended(9, -18, 4);
SetFormationRowXYExtended(10, -26, -8);
SetFormationRowXYExtended(11, -18, 16);
SetFormationRowXYExtended(12, -20, -12);
SetFormationRowXYExtended(13, -18, 2);
}
}
For each mancount there is a formation defined for several morale/disorder levels.
For moralestate = 0 the formations are usually very strict except when it is intended for units that should have loose formations.
The higher the moralestate the larger the departures from the strict formation.
Note there is no formation for mancount = 0 as this formation only has one figure displayed and that is placed in the middle of the square, similar to SetFormationRowXYExtended(0, 0, 0).
For SetFormationRowXYExtended(i,x,y), the number i is just an ID number for each figure in the formation (i = 0 for the first figure, i = 1 for the second figure etc.).
The number x defines the forward/backward departure from this middle of the formation. I believe negative numbers is more towards the front of the formation and positive numbers is more to the back.
The number y defines the sidewards departure from this middle of the formation. I believe negative numbers are more towards the left of the formation and positive numbers more to the right.
Although I may have swapped the effect of negative and positive numbers for both the second and third number.
So in a similar way one can define also formations for 6, 9, 10, 11, 13 and 15.