Priority Charge Target
Moderators: rbodleyscott, Slitherine Core, Gothic Labs
Priority Charge Target
As I made the mistake with my Horse today, I just wanted to share the rule :
(I should have known it...)
Kuirassiers A can charge the Horse. Kuirassiers B can't.
The horses can charge A and B or go past them.
(I should have known it...)
Kuirassiers A can charge the Horse. Kuirassiers B can't.
The horses can charge A and B or go past them.
-
- Major-General - Jagdtiger
- Posts: 2789
- Joined: Tue Apr 07, 2015 2:09 am
Re: Priority Charge Target
Wouldn't Horse A be ZoC locked by being one tile and facing within 45 degrees of an enemy?
SnuggleBunny's Field of Glory II / Medieval / Pike and Shot / Sengoku Jidai MP Channel:
https://www.youtube.com/channel/UCjUQy6dEqR53NwoGgjxixLg
https://www.youtube.com/channel/UCjUQy6dEqR53NwoGgjxixLg
Re: Priority Charge Target
I guess only infantry would. I'll carry out tests in the Editor when I have some time.
-
- Major-General - Jagdtiger
- Posts: 2789
- Joined: Tue Apr 07, 2015 2:09 am
Re: Priority Charge Target
Ah, so it's a priority charge, but you can still move away. Got it.
SnuggleBunny's Field of Glory II / Medieval / Pike and Shot / Sengoku Jidai MP Channel:
https://www.youtube.com/channel/UCjUQy6dEqR53NwoGgjxixLg
https://www.youtube.com/channel/UCjUQy6dEqR53NwoGgjxixLg
Re: Priority Charge Target
In the original picture A is ZOCed by both units so it can charge either. B is only ZOCed by the foot so can't charge the cavalry
Re: Priority Charge Target
This is indeed the definition of a priority charge target. According to the manual, it is either an :
- (a) enemy within two map squares directly to their front (one square if the chargers are facing diagonally) and facing within 45 degrees of directly towards them,
- or (b) enemy ZOCing them.
Re: Priority Charge Target
Here is an application of the rules of Priority Charge Target. My Keil can't charge the rear of the enemy Keil :
... because of the enemy Massed Arquebusiers that are within two map squares directly to its front and are an easy prey for Keil :
... because of the enemy Massed Arquebusiers that are within two map squares directly to its front and are an easy prey for Keil :
-
- Major-General - Jagdtiger
- Posts: 2789
- Joined: Tue Apr 07, 2015 2:09 am
Re: Priority Charge Target
Of course if you moved the light arquebusiers into that intervening tile then you're freed up for the rear charge.
SnuggleBunny's Field of Glory II / Medieval / Pike and Shot / Sengoku Jidai MP Channel:
https://www.youtube.com/channel/UCjUQy6dEqR53NwoGgjxixLg
https://www.youtube.com/channel/UCjUQy6dEqR53NwoGgjxixLg
Re: Priority Charge Target
The unit I guess you're referring to (at the bottom left of the screen) is Massed crossbowmen with AP=10 only, not LF with 12 AP.
-
- Major-General - Jagdtiger
- Posts: 2789
- Joined: Tue Apr 07, 2015 2:09 am
Re: Priority Charge Target
Ah, right. Still those sorts of tricks to break the charge locks are useful to keep in mind
SnuggleBunny's Field of Glory II / Medieval / Pike and Shot / Sengoku Jidai MP Channel:
https://www.youtube.com/channel/UCjUQy6dEqR53NwoGgjxixLg
https://www.youtube.com/channel/UCjUQy6dEqR53NwoGgjxixLg
Re: Priority Charge Target
When (a cruel) happiness is within reach, but...
A can't charge B (unlike in FoGII) as C is a priority charge target.
A can't charge B (unlike in FoGII) as C is a priority charge target.
Re: Priority Charge Target
Most likely a small change in the FUNCTION CanZOC(unit, me, ignore_routers) (Tools.BSF at ...\Pike & Shot Campaigns\Data\scripts\) gives a possibility of charging in FoG2 in this case: adding the script string
Code: Select all
if (IsInCloseCombat(unit) == 0) // Can't ZOC when in close combat
{
}
Re: Priority Charge Target
Interesting. But it seems it does not work either because I did something wrong or it is the first rule about priority charge targets that applies here ('an enemy within two map squares directly to their front (one square if the chargers are facing diagonally) and facing within 45 degrees of directly towards them'), not the second one ('an enemy ZOCing them').
btw I guess it would also be FUNCTION CanZOC that could be modded to tweak the above situation about keils, if it had to. I don't know what the others think of it.
Also note, still about FUNCTION CanZOC, that the latest patch 1.5.33 of FoG: Ancients beta fixes a bug (certainly rarely observed in games) that allowed Light Artillery to exert ZoC, a bug present in P&S.
btw I guess it would also be FUNCTION CanZOC that could be modded to tweak the above situation about keils, if it had to. I don't know what the others think of it.
Also note, still about FUNCTION CanZOC, that the latest patch 1.5.33 of FoG: Ancients beta fixes a bug (certainly rarely observed in games) that allowed Light Artillery to exert ZoC, a bug present in P&S.
Re: Priority Charge Target
Athos1660, you are right. My guess was wrong. We need to compare FUNCTION PriorityChargeTargetAtTile(x, y, facing, me, current_target) in CombatTools.BSF at ...\Pike & Shot Campaigns (Field of Glory II)\Data\scripts\... The difference in the scripts is great.
I removed ZoС from Light Artillery in my TYW with generals module - see my post of 06.01.2020 https://www.slitherine.com/forum/viewto ... 3&start=40. To do this, replace (IsUnitSquadType(unit, "Artillery") == 0) in FUNCTION CanZOC(unit, me, ignore_routers) with (IsArtillery(unit) == 0).
I removed ZoС from Light Artillery in my TYW with generals module - see my post of 06.01.2020 https://www.slitherine.com/forum/viewto ... 3&start=40. To do this, replace (IsUnitSquadType(unit, "Artillery") == 0) in FUNCTION CanZOC(unit, me, ignore_routers) with (IsArtillery(unit) == 0).
Re: Priority Charge Target
knowing that there is secondary ZoC in FoG2...The difference in the scripts is great.
Re: Priority Charge Target
I would say so: knowing that there is secondary ZoC in FoG2 I am surprised that the P&S script is much more than FoG2 one.
Let's compare P&S
Code: Select all
FUNCTION PriorityChargeTargetAtTile(x, y, facing, me, current_target)
{
int potential_target;
int frontalX;
int frontalY;
int current_target_qualifies;
int priorityTarget1;
int priorityTarget2;
int j;
int k;
int ret;
ret = -1;
priorityTarget1 = -1;
priorityTarget2 = -1;
current_target_qualifies = 0;
frontalX = AdjacentX(x, facing);
frontalY = AdjacentY(y, facing);
potential_target = GetUnitOnTile(frontalX, frontalY);
// If no unit there, look in the next tile forward (orthogonal directions only). (So that units in chequerboard formation can protect each other from being ganged up on)
// I am not entirely sure about reducing the distance to 1 square in diagonal directions.
// However, making it 2 squares diagonally looks odd on the map, it just looks too far away to be the priority target.
// It might also cause issues with the method (see below) of checking for the diagonal move being blocked by an existing combat if "me" is not already in the adjacent square.
// On the other hand , making it 1 square diagonally means that the effects of a chequerboard are lost in diagonal directions.
// However, as the battle lines are normally drawn up orthogonally, I think that probably doesn't matter as much as getting it to look right.
// Of course, I can easily change it back if it causes problems.
if (potential_target == -1)
{
if ((facing == 0) || (facing == 90) || (facing == 180) || (facing == 270)) // Orthogonal directions
{
potential_target = GetUnitOnTile(AdjacentX(frontalX, facing), AdjacentY(frontalY, facing));
}
}
// Log("Facing before turn, unit in that direction", facing, potential_target);
if (potential_target > -1)
{
if ((GetUnitSide(potential_target) != GetUnitSide(me)) && (GetAttrib(potential_target, "MoraleState") < 3))
{
// If potential target facing within 45 degrees of directly towards us
if (GetAngleFromTile(x, y, potential_target) < 50)
{
// If potential target is in close combat then it isn't a priority target if it isn't a permitted charge target.
if ((IsInCloseCombat(potential_target) == 1) && (ChargePermitted(me, potential_target) == 0))
{
potential_target = -1;
}
// If potential target is blocked off from the testing unit by a diagonal close combat, then it isn't a priority target.
// Cannot use if (CallUnitFunctionDirect(me, "CHECK_UNIT_ASSAULT", me, potential_target) < 0) as test because it causes a crash bug - presumably due to recursive function calls
// The test below may not work perfectly for units that have to move to get to the adjacent position - if the program finds a different route, which is unlikely.
// Attempting to shift the unit before testing will cause bugs owing to this function being called from Check_Unit_Assault().
GetRouteCost(me, GetUnitX(potential_target), GetUnitY(potential_target), 0, 1);
if (CheckRouteDiagonalStepNotBlocked(me, 4) == -2)
{
potential_target = -1;
}
if ((IsArtillery(potential_target) == 1) && (IsProtectedArtillery(potential_target) == 1))
{
potential_target = -1;
}
if (potential_target != -1)
{
// Non light troops ignore light troops except commanded shot protected by mounted
if ((IsLightTroops(potential_target) == 0) || (IsProtectedCommShot(potential_target, 0) == 1) || (IsLightTroops(me) == 1))
{
if ((current_target == -1) || (potential_target == current_target))
{
ret = potential_target;
}
else
{
priorityTarget1 = potential_target;
}
}
}
}
}
}
if (ret == -1)
{
// If current_target has not yet qualified as a priority target, check for ZOCers
for (j = x-1; j <= x+1; j++)
{
for (k = y-1; k <= y+1; k++)
{
potential_target = IsTileZOCing(me, x, y, j, k, 1);
if (potential_target >= 0)
{
if ((current_target == -1) || (potential_target == current_target))
{
ret = potential_target;
}
else
{
if (priorityTarget2 == -1)
{
priorityTarget2 = potential_target;
}
}
}
}
}
}
if (ret == -1)
{
if (priorityTarget2 >= 0)
{
ret = priorityTarget2;
}
else
{
if (priorityTarget1 >= 0)
{
ret = priorityTarget1;
}
else
{
ret = current_target;
}
}
}
// Log("Unit, Priority Target", me, ret);
return ret;
}
Code: Select all
FUNCTION PriorityChargeTargetAtTile(x, y, facing, me, current_target)
{
int priority_target;
int j;
int k;
int ret;
ret = -1;
if (ret == -1)
{
// Check for ZOCers
for (j = x-1; j <= x+1; j++)
{
for (k = y-1; k <= y+1; k++)
{
priority_target = IsTileZOCing(me, x, y, j, k, 1, 0);
if (priority_target >= 0)
{
ret = priority_target;
if (ret == current_target)
{
// Jump out of loops
j = x + 2;
k = y + 2;
}
}
}
}
}
if (ret == -1)
{
ret = current_target;
}
// Log("Unit, Priority Target", me, ret);
return ret;
}
find the condition if ((IsInCloseCombat(potential_target) == 1) && (ChargePermitted(me, potential_target) == 0)) and replace it with if (IsInCloseCombat(potential_target) == 1) //&& (ChargePermitted(me, potential_target) == 0)). That is to remove the second part of this condition.
Re: Priority Charge Target
Indeed, now my A can charge B. Well done, Cronos.
But I can't figure out all the implications of such a change right now
But I can't figure out all the implications of such a change right now
Re: Priority Charge Target
In fact, both cases I came across in game and posted in this thread...
...are about (logically ?) preferring rear/flank charging a nearby target than sticking to the priority charge target(s) as defined by the two rules of the priority charge :
Thus, instead of changing the condition...
It is impossible in Vanilla P&S. A and B can currently be charged only if facing our unit :
Would it be possible to mod it ? Would it be a good thing ?
(edit)
But then the question on the above picture is : should our unit be allowed to charge B as A would be able to flank charge it in the next turn ? No ? Yes, at your own risk ?
(edit 2)
With the current rules, you can actually charge B at the risk of being flank charged by A during the next turn :
So yes ?
...are about (logically ?) preferring rear/flank charging a nearby target than sticking to the priority charge target(s) as defined by the two rules of the priority charge :
... or, at least, about having this opportunity to rear/flank charge.a) an enemy within two map squares directly to their front (one square if the chargers are facing diagonally) and facing within 45 degrees of directly towards them,
(b) enemy ZOCing them.
Thus, instead of changing the condition...
... as cleverly suggested by Cronos above, how about adding a third rule to the priority charge rules :if ((IsInCloseCombat(potential_target) == 1) && (ChargePermitted(me, potential_target) == 0)) and replace it with if (IsInCloseCombat(potential_target) == 1) //&& (ChargePermitted(me, potential_target) == 0)). That is to remove the second part of this condition.
(c) enemy can be rear/flank charged when in one of the 3 squares in front of them (from A to B) :
It is impossible in Vanilla P&S. A and B can currently be charged only if facing our unit :
Would it be possible to mod it ? Would it be a good thing ?
(edit)
But then the question on the above picture is : should our unit be allowed to charge B as A would be able to flank charge it in the next turn ? No ? Yes, at your own risk ?
(edit 2)
With the current rules, you can actually charge B at the risk of being flank charged by A during the next turn :
So yes ?
Last edited by Athos1660 on Wed Dec 16, 2020 3:01 pm, edited 2 times in total.
Re: Priority Charge Target
The rules of priority charge target would become :
Any thoughts ?
(edit, edit...)
(a) an enemy on the next nearest map square directly to their front and facing towards them,
(b) an enemy ZoCing them,
(c) an enemy in the 3 tiles to their “front” and in a position of being rear/flank charged.
Any thoughts ?
(edit, edit...)