Can't turn to reduce flank threat

Field of Glory II: Medieval

Moderator: rbodleyscott

Post Reply
DanZanzibar
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 246
Joined: Thu Feb 20, 2020 6:29 am

Can't turn to reduce flank threat

Post by DanZanzibar »

You can see the scenario in the attached image. The selected unit is not allowed to turn to reduce flank threat and the only reason I can think of is that the threatening unit is currently ZoC'd by another unit of mine (although you can see how that will change). Is this the correct assessment and is this WAD? I would think that a situation like this should allow you to turn.
Attachments
Screen_00000000.jpg
Screen_00000000.jpg (982.67 KiB) Viewed 1621 times
w_michael
Lieutenant Colonel - Fw 190A
Lieutenant Colonel - Fw 190A
Posts: 1137
Joined: Sat Apr 25, 2015 1:04 pm
Location: Fort Erie, Canada

Re: Can't turn to reduce flank threat

Post by w_michael »

The Scots Offensive Spear unit (one tile to the west of the selected Papal unit) appears to be pinned (ZOC'd) by the Papal Defensive Spears (one tile to the south-west). The ZOC is broken though when the Papal Defensive Spear is charged by the Scots schiltron (two tiles west), and the selected Papal unit is flank charged. I think that the turn to face was prevented for the reason that the OP suggested. It would be asking too much for the game engine to anticipate future moves.
William Michael, Pike & Shot Campaigns and Field of Glory II series enthusiast
tyronec
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1962
Joined: Sat Dec 06, 2014 11:09 am

Re: Can't turn to reduce flank threat

Post by tyronec »

The unit to the front is facing directly and that is causing the pin.
The unit to the left is not facing directly and so is not considered a direct threat. If it were rotated so that it were facing directly then your unit in question would be able to turn to face both threats.
DanZanzibar
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 246
Joined: Thu Feb 20, 2020 6:29 am

Re: Can't turn to reduce flank threat

Post by DanZanzibar »

w_michael wrote: Sat Aug 28, 2021 4:01 am The Scots Offensive Spear unit (one tile to the west of the selected Papal unit) appears to be pinned (ZOC'd) by the Papal Defensive Spears (one tile to the south-west). The ZOC is broken though when the Papal Defensive Spear is charged by the Scots schiltron (two tiles west), and the selected Papal unit is flank charged. I think that the turn to face was prevented for the reason that the OP suggested. It would be asking too much for the game engine to anticipate future moves.
I don't think it would be hard on the implementation as you're only testing if there are adjacent enemy units of your flanks regardless of what ZoC's they may be in. I'd be surprised that it wasn't coded this way because of how simple that is... and maybe there's another explanation for what is going on, I don't know.
DanZanzibar
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 246
Joined: Thu Feb 20, 2020 6:29 am

Re: Can't turn to reduce flank threat

Post by DanZanzibar »

tyronec wrote: Sat Aug 28, 2021 5:17 am The unit to the front is facing directly and that is causing the pin.
The unit to the left is not facing directly and so is not considered a direct threat. If it were rotated so that it were facing directly then your unit in question would be able to turn to face both threats.
You don't need to be in the primary ZoC of the flank-threatening unit to be able to turn to reduce flank threat. I was about 95% sure but I still went and double checked this.
tyronec
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1962
Joined: Sat Dec 06, 2014 11:09 am

Re: Can't turn to reduce flank threat

Post by tyronec »

You don't need to be in the primary ZoC of the flank-threatening unit to be able to turn to reduce flank threat. I was about 95% sure but I still went and double checked this.
You are right, secondary ZOC counts. I have been playing with a misunderstanding of the rules !
w_michael
Lieutenant Colonel - Fw 190A
Lieutenant Colonel - Fw 190A
Posts: 1137
Joined: Sat Apr 25, 2015 1:04 pm
Location: Fort Erie, Canada

Re: Can't turn to reduce flank threat

Post by w_michael »

I think that the OP depicted the AI flank threat evaluation logic. Since it didn't see one, the highlighted unit couldn't turn away from a primary ZOC.
William Michael, Pike & Shot Campaigns and Field of Glory II series enthusiast
DanZanzibar
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 246
Joined: Thu Feb 20, 2020 6:29 am

Re: Can't turn to reduce flank threat

Post by DanZanzibar »

w_michael wrote: Mon Aug 30, 2021 1:38 am I think that the OP depicted the AI flank threat evaluation logic. Since it didn't see one, the highlighted unit couldn't turn away from a primary ZOC.
It certainly seems like the most likely explanation. There's one thing I very hazily remember reading though that gave me pause on this - when they changed the game rules to prevent light units from turning units and exposing them to being charged the next turn by non lights I vaguely recall seeing something in the forums about how the test that is done does NOT factor in if the potential flanking unit is ZoC'd by anyone... meaning they just had to be in a position to attack, not actually free to do so. From a game logic point of view, I do think this unit should be allowed to turn as they should still be feeling threatened on their flank, regardless of what another unit of mine is doing to threaten the enemy unit (i.e. ZoC'ing them) into not being able to charge.

I'm pretty sure I need an RBS answer on this one and am hoping he chimes in (best game developer ever for almost always helping out with these questions!).
w_michael
Lieutenant Colonel - Fw 190A
Lieutenant Colonel - Fw 190A
Posts: 1137
Joined: Sat Apr 25, 2015 1:04 pm
Location: Fort Erie, Canada

Re: Can't turn to reduce flank threat

Post by w_michael »

I agree that given this situation that the selected unit should logically be allowed to turn. The ZOC rules in all of the FOG2 and P&S game systems have always been contentious.
William Michael, Pike & Shot Campaigns and Field of Glory II series enthusiast
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28297
Joined: Sun Dec 04, 2005 6:25 pm

Re: Can't turn to reduce flank threat

Post by rbodleyscott »

DanZanzibar wrote: Mon Aug 30, 2021 2:50 am
w_michael wrote: Mon Aug 30, 2021 1:38 am I think that the OP depicted the AI flank threat evaluation logic. Since it didn't see one, the highlighted unit couldn't turn away from a primary ZOC.
I'm pretty sure I need an RBS answer on this one and am hoping he chimes in (best game developer ever for almost always helping out with these questions!).
The current code does exclude an enemy unit from counting as a flank threat (for the purpose of a unit being able to turn to reduce flank threat) if that enemy unit is unable to charge the unit because it is pinned by another unit's ZOC.

Whether it should or not is another question, of course.

In this case, it might seem that it shouldn't, but the same EstimateFlankThreat() function is used when deciding whether an AI unit should charge (or even advance), and in most cases, it would be better off ignoring the potential (but not currently actual) flank threat and charge rather than standing there doing nothing.

Here is my comment from the actual code:
// If testing for imminent flank threat, ignore risk if enemy unit in close combat or pinned.
// Ignoring units in combat has some risk, as they might win and pursue into our flank. However, the AI needs to take some risks to avoid getting stuck.
// Ignoring pinned enemy units could be more risky - the unit pinning them might subsquently move so that it isn't pinning them.
// Will need testing to see if the balance is favourable
Of course, the EstimateFlankThreat() function could be made to work differently in different circumstances.
Richard Bodley Scott

Image
DanZanzibar
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 246
Joined: Thu Feb 20, 2020 6:29 am

Re: Can't turn to reduce flank threat

Post by DanZanzibar »

Thanks for clarifying that. While I don't imagine it's the most critical change, I do think it would make sense to have a separate "check flank threat" function that governs when a unit can be turned. I really can't think of any odd situations where this would have an undesirable effect.
Post Reply

Return to “Field of Glory II: Medieval”