Page 2 of 2

Re: Automatic cohesion test before the impact

Posted: Sat May 09, 2020 7:36 pm
by Schweetness101
Athos1660 wrote: Sat May 09, 2020 7:16 pm
Schweetness101 wrote: Sat May 09, 2020 5:45 pm
Athos1660 wrote: Sat May 09, 2020 5:46 am

To make cohesion loss because of charge rarer, I added this bit of script in MoraleTools.bsf after line 508, ie after the Close combat test :

Code: Select all

	// Charge of Non-light cav test
	if ((IsMounted(me)) && (IsMounted(enemy)) && (IsLightTroops(me) == 0) && (isLightTroops(enemy) == 0) && (reason == 3 ))
		{
			modifiers += 1;
			PrintStringLiteralX(UIString, 0, "\n");
			PrintStringLiteralX(UIString, 0, "Charge of Non-light cav: +1");
			Log("Charge of Non-light cav", me);
		}
	//end

Is it correct ?

If so, my question is : has reason 3 already been used in the scripts for another situation in game, so that my code will unintentionally give this modifier to this situation, or is it written in a way that prevents it to happen (with : if ((IsMounted(me)) && (IsMounted(enemy)) && (IsLightTroops(me) == 0) && (isLightTroops(enemy) == 0)) ?
reason 3 is 'other reason', which includes another 0-9 'fullReasons', where 8 is charged while fragmented. I added a 10th reason that is cohesion check from non light cav vs non light cav

I added to the explanation comment like this:

// fullReason: 0 = Shooting, 1 = Impact Close Combat, 2 = Melee Close combat, 4 = Bolster/Rally, 5 = automatic morale drop, 6 = Seeing rout, 7 = Seeing general fall, 8 = Charged while Fragmented, 9 = Fall back
//10 = auto CT from non light cav charging non light cav

at the top of moraletools.bsf

if reason is 3 in MoraleUpdate(), then it calls CohesionTest() which has a bunch of checks for the full reasons at the bottom, where I added an extra one like

//added for cav mod
if (fullReason == 10)
{
PrintStringLiteralX(UIString, 0, " ");
PrintStringLiteralX(UIString, 0, "Non-Light Cavalry Charged Non-Light Cavalry, auto CT");
//I have no idea where the above actually prints out though
}
//added for cav mod

not sure if it is fully working but if it is you call it like this from Assault.bsf:

morale_state = MoraleUpdate(unit, me, 3, -1, 0, 0, GetCurrentSide(), 10);
morale_state = MoraleUpdate(me, unit, 3, -1, 0, 0, GetCurrentSide(), 10);

notice the bold 10, not 8, because that last parameter is for the fullReason

not sure if every other parameter is correct or if you want this cohesion check to happen on routing or pursuing units

it also seems like it might not be happening on units that are already in combat.
Sorry I was not clear.

If I added this...

Code: Select all

	// Charge of Non-light cav test
	if ((IsMounted(me)) && (IsMounted(enemy)) && (IsLightTroops(me) == 0) && (isLightTroops(enemy) == 0) && (reason == 3 ))
		{
			modifiers += 1;
			PrintStringLiteralX(UIString, 0, "\n");
			PrintStringLiteralX(UIString, 0, "Charge of Non-light cav: +1");
			Log("Charge of Non-light cav", me);
		}
	//end

... It was not meant to provide a title to the automatic charge cohesion tests before the impact. It was meant to add a modifier +1 to those very charge cohesion tests which it actually does :

Image

My question was actually :

If I write...

Code: Select all

	if ((IsMounted(me)) && (IsMounted(enemy)) && (IsLightTroops(me) == 0) && (isLightTroops(enemy) == 0) && (reason == 3 ))
... will this +1 modifier apply :
- when and only when a Non-Light Cavalry charges a Non-Light Cavalry ?
- or to any "other reason" including the 0-9 'fullReasons' (fall back, rally, charged when fragmented...) whenever 1 or 2 (?) non-light cav are involved ?

I fear the latter. If so, is there a way to solve the issue ?
the latter

without looking at it i can't be sure, but if I had to guess you could resolve it i think by changing reason == 3 to fullReason == 10

Re: Automatic cohesion test before the impact

Posted: Sat May 09, 2020 7:43 pm
by Schweetness101
two other alternatives to doing the automatic ct on cohesion to charging

1) massively increase casualties on the impact phase alone of non light cav vs non light cav. Because the absolute value of the casualty disparity determined if a CT is taken, this would almost guarantee a ct on each impact, although retaining a certain randomness
2) simply mandate that CT's always happen in the impact phase of non light cav vs non light cav

I like those better than adding an altogether new phase before impact that is always a CT, because it would a) fit better within existing game mechanics rather than adding a new phase and b) be less confusing to existing or new players coming over to use the new mod.

Higher chance of CT on impact or even guaranteed CT on impact is less confusing and changes less and gets a similar result to having an extra phase CT right before impact, and then maybe and impact ct, and then maybe an already fragmented ct, and then maybe a large casualties ct.

Re: Automatic cohesion test before the impact

Posted: Sat May 09, 2020 7:55 pm
by Athos1660
Schweetness101 wrote: Sat May 09, 2020 5:50 pm
Athos1660 wrote: Sat May 09, 2020 5:46 am
Schweetness101 wrote: Sat May 09, 2020 3:15 am We should debate which of the three things to keep and at what numbers exactly. Really what matters is the goal of getting cav vs cav fights over faster by some means to be more historical (i think...) and so they can get onto the flanking business
I think I have already expressed my opinions on this subject quite often.

I guess we both have different objectives :
- you : systematically shortening the times of cav fights
- me : give charges more weight while allowing some/most melees to last
yes, I like both ideas, and yours seems to make sense in that cavalry vs cavalry charges would be more likely to be decisive than infantry vs infantry charges.
There is no best idea (especially when modding). But there might be different objectives.
If you prefer as a competitive MP player faster cav fights because you think this kind of mod could make some MP tournaments funny/different, that's a nice objective among others.
Schweetness101 wrote: Sat May 09, 2020 5:50 pm But, assuming neither side does break, are cavalry vs cavalry melees still faster than infantry vs infantry melees? Just not by as much of a margin? I guess they would be but I am not an historian.
Hard question !
Neither am I historian and I don't have a clue, but I would tend to think otherwise :-)

On one hand, horses are additional targets, often vulnerable. Wound the horse and the horseman will fall off. And opponents might be more mixed in melee, maybe more vulnerable. On the other hand, as I see it, fighting melee on horseback (ie using one's weapons on a moving horse that might panic, etc.) might be harder and thus less effective in terms of number of casualties per minute than fighting on foot. And in my opinion, during melee, cavalrymen are mostly infantrymen on horseback.

So not knowing, I would make times (cav melee) more or less = times(infantry melee).

btw has anybody compared those times in the Vanilla game ? Are they really the same ?

Re: Automatic cohesion test before the impact

Posted: Sat May 09, 2020 8:20 pm
by Athos1660
Schweetness101 wrote: Sat May 09, 2020 7:36 pm without looking at it i can't be sure, but if I had to guess you could resolve it i think by changing reason == 3 to fullReason == 10
I will try it but, as I see it at first sight, FullReason is just informative.
Schweetness101 wrote: Sat May 09, 2020 7:43 pm two other alternatives to doing the automatic ct on cohesion to charging
1) massively increase casualties on the impact phase alone of non light cav vs non light cav. Because the absolute value of the casualty disparity determined if a CT is taken, this would almost guarantee a ct on each impact, although retaining a certain randomness
2) simply mandate that CT's always happen in the impact phase of non light cav vs non light cav
I know. I try them both and so many variants.
Number 2 is interesting.
I don't think that Number 1 coud be justified from an historical point of view. But it is very effective to shorten fighting times.

At the impact, I do prefer when a unit drops a cohesion level rather than when it suffers massive casualties.

btw, during my testing of a CT during charge (ie before impact), the following melees often seem to me shortened, even in case of no cohesion drop during the charge, but it might be a matter of dice...
Schweetness101 wrote: Sat May 09, 2020 7:43 pm I like those better than adding an altogether new phase before impact that is always a CT, because it would a) fit better within existing game mechanics rather than adding a new phase and b) be less confusing to existing or new players coming over to use the new mod.

Higher chance of CT on impact or even guaranteed CT on impact is less confusing and changes less and gets a similar result to having an extra phase CT right before impact, and then maybe and impact ct, and then maybe an already fragmented ct, and then maybe a large casualties ct.
I do respect your point of view :-) And quite agree.

But I really like the feeling of CT during the charge.
It is a matter of taste and vision to simulate a cav charge.
That way, cohesion of a charging cav unit during the charge/impact phase is not only a matter of what happens at the very moment of the impact or a matter of how many casualties there are because of it.

However, it might need some more tweaking to downgrade the effect of the charge. I don't know.

Re: Automatic cohesion test before the impact

Posted: Sat May 09, 2020 9:22 pm
by Schweetness101
Athos1660 wrote: Sat May 09, 2020 8:20 pm
Schweetness101 wrote: Sat May 09, 2020 7:36 pm without looking at it i can't be sure, but if I had to guess you could resolve it i think by changing reason == 3 to fullReason == 10
I will try it but, as I see it at first sight, FullReason is just informative.
in MoraleUpdate() if reason is not 0,1,2 or 5, and test == 1, then it calls CohesionTest()
In CohesionTest() around line 254 you will see a long list of conditions for full reasons 6 - 10

I added 10 and that's what prints the different string, if that's what you mean by informative.

So, if you use if(fullReason == 10) that will only be used inside of CohesionTest() by the calls I added to MoraleUpdate() in Assault:

morale_state = MoraleUpdate(unit, me, 3, -1, 0, 0, GetCurrentSide(), 10);
morale_state = MoraleUpdate(me, unit, 3, -1, 0, 0, GetCurrentSide(), 10);

that is the only place MoraleUpdate() is called with a fullreason of 10, and it already is only called after this filter:

if ((IsMounted(me)) && (IsMounted(unit)) && (IsLightTroops(me) == 0) && (isLightTroops(me) == 0) && (isLightTroops(unit) == 0) && (route != 1) && (pursuit == 0))

So inside of MoraleTools() if you want to add an extra +1 modifier to that auto cav vs cav impact test just do

if(fullReason == 10)
{
modifiers += 1;
PrintStringLiteralX(UIString, 0, "\n");
PrintStringLiteralX(UIString, 0, "Charge of Non-light cav: +1");
Log("Charge of Non-light cav", me);
}

Re: Automatic cohesion test before the impact

Posted: Sat May 09, 2020 9:52 pm
by Athos1660
@Schweetness101 : ^ Thank you for the above.

btw :
Schweetness101 wrote: Sat May 09, 2020 5:45 pm //added for cav mod
if (fullReason == 10)
{
PrintStringLiteralX(UIString, 0, " ");
PrintStringLiteralX(UIString, 0, "Non-Light Cavalry Charged Non-Light Cavalry, auto CT");
//I have no idea where the above actually prints out though
}
//added for cav mod

not sure if it is fully working but if it is you call it like this from Assault.bsf:
Image

MISSING = no big deal :-)

btw I noticed the charged cav seems to sometimes spin 360°. First time I see that but it might be because I did a lot of cav testing lately.

Re: Automatic cohesion test before the impact

Posted: Sat May 09, 2020 10:09 pm
by Schweetness101
Athos1660 wrote: Sat May 09, 2020 9:52 pm @Schweetness101 : ^ Thank you for the above.

btw :
Schweetness101 wrote: Sat May 09, 2020 5:45 pm //added for cav mod
if (fullReason == 10)
{
PrintStringLiteralX(UIString, 0, " ");
PrintStringLiteralX(UIString, 0, "Non-Light Cavalry Charged Non-Light Cavalry, auto CT");
//I have no idea where the above actually prints out though
}
//added for cav mod

not sure if it is fully working but if it is you call it like this from Assault.bsf:
Image

MISSING = no big deal :-)

btw I noticed the charged cav seems to sometimes spin 360°. First time I see that but it might be because I did a lot of cav testing lately.
interesting, the full string I put in there is "Non-Light Cavalry Charged Non-Light Cavalry, auto CT", but maybe it wants to draw from the string files like PrintStringX(UIString, 0, "IDS_CT_FALLBACK"); and you shouldn't use a string literal there

What do you mean spin 360? do you have like a picture maybe?

Re: Automatic cohesion test before the impact

Posted: Sat May 09, 2020 10:17 pm
by Athos1660
Schweetness101 wrote: Sat May 09, 2020 10:09 pm What do you mean spin 360? do you have like a picture maybe?
To rotate 360°, pivot on itself
It faces its enemy, the enemy charges, it rotate 360° till it faces its enemy again and then it is the impact. Happened 2-3 times out of many in a scenario I played a lot. Maybe I had a hallucination :-)

Re: Automatic cohesion test before the impact

Posted: Sat May 09, 2020 10:34 pm
by Schweetness101
Athos1660 wrote: Sat May 09, 2020 10:17 pm
Schweetness101 wrote: Sat May 09, 2020 10:09 pm What do you mean spin 360? do you have like a picture maybe?
To rotate 360°, pivot on itself
It faces its enemy, the enemy charges, it rotate 360° till it faces its enemy again and then it is the impact. Happened 2-3 times out of many in a scenario I played a lot. Maybe I had a hallucination :-)
haha weird I'll see if I can get that to trigger

Re: Automatic cohesion test before the impact

Posted: Sun May 10, 2020 9:21 am
by Athos1660
Schweetness101 wrote: Sat May 09, 2020 10:34 pm I'll see if I can get that to trigger
Nice.
Schweetness101 wrote: Sat May 09, 2020 7:43 pm two other alternatives to doing the automatic ct on cohesion to charging

1) massively increase casualties on the impact phase alone of non light cav vs non light cav. Because the absolute value of the casualty disparity determined if a CT is taken, this would almost guarantee a ct on each impact, although retaining a certain randomness
2) simply mandate that CT's always happen in the impact phase of non light cav vs non light cav

I like those better than adding an altogether new phase before impact that is always a CT, because it would (...) be less confusing to existing or new players coming over to use the new mod.
I take this issue of confusion seriously.

So I’ve just tested the automatic CT at the impact for both units, once again (the option #2 in your post above, with the script in OP) :
- In case of indecisive result at the impact, both units take a CT.
- In case of winning the impact, the winning unit takes a CT.

I think both cases would confuse the player. Phrased that way : ‘I win and I drop a cohesion level ?!’, this is unfair, isn't it ?
That’s why I did not like this solution. If you win the impact, you win the impact.
That’s why I thought of adding a extra phase (the charge before the impact) that can lead in my opinion to a CT for both units at that very moment.

So maybe the less confusing solution is your #1 (« massively increase casualties on the impact phase »). But I for one don’t like it, that the impact becomes a nuclear explosion. :-)

I tested a modifier -1 at the impact only, no additional casualty. That's another solution.

___________

btw I might have to expand my charge mod to cavalry charging infantry :
- when friendly cav charge enemy infantry
- when enemy cav charge friendly infantry
- when enemy infantry charge friendly cav
- when friendly infantry charge enemy cav

A matter of logic.

That’ll create a kind of imbalance (compared to the Vanilla game) to the cav’s disadvantage :
- infantry won’t suffer a CT at the charge
- cavalry will suffer a CT at the charge
I am not against this idea. But that is the exact opposite effect to what you are after, doesn’t it ?

But you might adapt it this way : during infantry vs cav charge, and only in this case, infantry also takes a CT.
Might achieve what you're after. I don't know.

Re: Automatic cohesion test before the impact

Posted: Mon May 11, 2020 6:24 pm
by Athos1660
Here is an update of my second Cav Charge Mod, v. 2.1 :

http://www.mediafire.com/file/wdamax540 ... 1.rar/file

The cohesion drop during the charge (before the impact) is made rarer than in the v.2.0, with a total modifiers = +2, instead of +1.
Athos1660 wrote: Mon May 11, 2020 7:04 am
(...)

2) Cav Charge Mod v.2 :
The cavalry fight as a 3-stage process : charge, impact and melee; the three steps being perilous can lead to a cohesion test. Several unpredictable factors can make a charge less effective leading, in turn, to a less effective impact. Both cohesion tests during Charge and Impact get a +1 modifier to reduce the occurrence of cohesion drop. The melee unfolds as in the Vanilla game. The number of casualties during the Impact and the melee are the same as in the Vanilla game.

http://www.mediafire.com/file/7fl9apd0g ... 2.rar/file

To use them in Custom battles, extract them to C:\Users\YourName\Documents\My Games\FieldOfGlory2\CAMPAIGNS

To use them in multiplayer games, extract them to C:\Users\Name\Documents\My Games\FieldOfGlory2\MULTIPLAYER

There is also a "Scenario" for quick testing of cav vs cav fights.

Of course you can look at the Combat log to see how both charges unfold.

Re: Automatic cohesion test before the impact

Posted: Tue May 12, 2020 8:37 am
by Athos1660
I tried to apply my cavalry mod v.2 (CT before the impact for both units) to any impact, whatever the units are (infantry...).

So I made two modifications :
1) The modifiers for the charge and the impact (in MoraleTools.bsf) are now :

Code: Select all

	// My Total Charge mod
	// To smooth the effects of both CT during the charge (fullReason 10) and the impact (reason 1)
	if (fullReason == 10)
		{
			modifiers += 2;
			PrintStringLiteralX(UIString, 0, "\n");
			PrintStringLiteralX(UIString, 0, "Charge modifier: +2");
			Log("Charge", me);
		}
	
	if (reason == 1)
		{
			modifiers += 1;
			PrintStringLiteralX(UIString, 0, "\n");
			PrintStringLiteralX(UIString, 0, "Charge bonus for impact: +1");
			Log("Charge bonus at the impact: +1", me);
		}
	//end of my mod
2) The CT before the impact for any units (in Assault.bsf) :

Code: Select all

	//if non light cav vs non light cav on impact then take a cohesion test:
	if ((IsMounted(me)) && (IsMounted(unit)) && (IsLightTroops(me) == 0) && (isLightTroops(me) == 0) && (isLightTroops(unit) == 0) && (route != 1) && (pursuit == 0))
		{
			morale_state = MoraleUpdate(unit, me, 3, -1, 0, 0, GetCurrentSide(), 10);
			morale_state = MoraleUpdate(me, unit, 3, -1, 0, 0, GetCurrentSide(), 10);
			//test to see if it does it, then add a new full reason, keeping 3 as reason, for non light cav charging non light cav
		}
became :

Code: Select all

	//if charge then take a cohesion test:
	if ((route != 1) && (pursuit == 0))
		{
			morale_state = MoraleUpdate(unit, me, 3, -1, 0, 0, GetCurrentSide(), 10);
			morale_state = MoraleUpdate(me, unit, 3, -1, 0, 0, GetCurrentSide(), 10);
		}
While the modifier for reason 1 seems to work, the mutual CT before the impact still applies to cav only !
What's my mistake ?

MoraleTools.bsf : http://www.mediafire.com/file/4fp7jrocc ... s.BSF/file
Assault.bsf : http://www.mediafire.com/file/ffjny3bxl ... t.BSF/file

Re: Automatic cohesion test before the impact

Posted: Thu May 14, 2020 9:35 am
by Athos1660
Athos1660 wrote: Tue May 12, 2020 8:37 am I tried to apply my cavalry mod v.2 (CT before the impact for both units) to any impact, whatever the units are (infantry...).

So I made two modifications :
(...)
2) The CT before the impact for any units (in Assault.bsf) :

Code: Select all

    //if non light cav vs non light cav on impact then take a cohesion test:
    if ((IsMounted(me)) && (IsMounted(unit)) && (IsLightTroops(me) == 0) && (isLightTroops(me) == 0) && (isLightTroops(unit) == 0) && (route != 1) && (pursuit == 0))
        {
            morale_state = MoraleUpdate(unit, me, 3, -1, 0, 0, GetCurrentSide(), 10);
            morale_state = MoraleUpdate(me, unit, 3, -1, 0, 0, GetCurrentSide(), 10);
            //test to see if it does it, then add a new full reason, keeping 3 as reason, for non light cav charging non light cav
        }
became :

Code: Select all

    //if charge then take a cohesion test:
    if ((route != 1) && (pursuit == 0))
        {
            morale_state = MoraleUpdate(unit, me, 3, -1, 0, 0, GetCurrentSide(), 10);
            morale_state = MoraleUpdate(me, unit, 3, -1, 0, 0, GetCurrentSide(), 10);
        }
While the modifier for reason 1 seems to work, the mutual CT before the impact still applies to cav only !
What's my mistake ?
In fact, there is no mistake in this bits of script above (except the useless repetition of IsLightTroops(me)).
The mistake comes from my misunderstanding of what (route != 1) && (pursuit == 0) would do.

I wanted that the cohesion test applies to both cases of charge, A and B, while it actually did only to A :

Image

Since, I've also added a new constraint to the 'charge CT' : it only applies to non-light infantry and cavalry, not light troops.

So my new bits of script is now :

Code: Select all

    //if charge then take a cohesion test:
    if ((IsLightTroops(me) == 0) && (isLightTroops(unit) == 0) && (pursuit == 0))
        {
            morale_state = MoraleUpdate(unit, me, 3, -1, 0, 0, GetCurrentSide(), 10);
            morale_state = MoraleUpdate(me, unit, 3, -1, 0, 0, GetCurrentSide(), 10);
        }
And it seems to work. I must test it though.

Re: Automatic cohesion test before the impact

Posted: Thu May 14, 2020 12:44 pm
by Athos1660
Total Charge Mod v.1.1 :
Charging non-light infantry and cavalry trigger an additional CT during the charge (ie before the impact) for both units (the charging one and the charged one).

Cohesion drops during the charge are meant to be (very) rare : CT modifier +1.

Cohesion drops at the impact are rarer than in the Vanilla game, to smooth the cumulative effects of the charge and the impact : CT modifier +1.

Light troops behave as in the Vanilla game.

Melees unfold as in the Vanilla game.

Link : http://www.mediafire.com/file/5jfmi9h5t ... 1.rar/file

PS : I guess the ideal modifier for the additional CT during the charge is somewhere between +1 (cohesion loss happens too often) and +2 (it happens too rarely), nearer to +1 than to +2. In this version, I set it at +1. More danger, more fun.

PS 2 : translation in English and in French.

(edit 1)
underlined

(edit 2)
Fights involving Light troops follow the Vanilla rules (LFvsLF, LFvsHF, etc.).