Author Topic: [Solved] Mutual Surprise Rule - Sidestepping  (Read 457 times)

Offline Buscher

  • Colonel
  • ****
  • Posts: 182
    • View Profile
[Solved] Mutual Surprise Rule - Sidestepping
« on: January 01, 2025, 11:30:50 pm »
Since Alternative Movement methods is part of the OXC tab, I think this belongs here.

Does sidestepping work with the Mutual Surprise Rule? I got the situation in screenshot 1 (after CTRL+D)

When I move the unit directly forward (TU cost 8, red arrow), the soldier has a higher reaction score and no shots are fired. When I move the yellow arrow, I always get the mutual surprise rule (TU don't matter). But if I take one step along the red arrow (4 TUs), turn towards the alien (2 TUs) and then sidestep with CTRL+click (5 TUs, or 11 TUs in total), I get fired at due to a lower reaction score.

Is side stepping supposed to trigger the mutual surprise rule?

Mod is Multimod running with OXCE 8.0. You can also have a look at the attached video.


---

Edit: Sidestepping works as expected when using the latest stable (Extended-7.15.0-0f8616d83-2024-11-01-bionic-x86_64.7z)

Added a vanilla savegame (mutual surprise vanilla.sav). How to test: Waste some TUs. Step forward two tiles. Next time do that with sidestepping.
« Last Edit: January 02, 2025, 01:54:57 am by Buscher »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9257
    • View Profile
Re: Mutual Surprise Rule - Sidestepping (OXCE 8.0 Regression Defect?)
« Reply #1 on: January 02, 2025, 10:32:31 am »
Too many screenshots, videos, mods, saves and reproduction instructions.
I need one clear example.

Anyway, I took vanilla + your attached save, and tried both normal walking and sidestepping on OXCE 8.0, OXCE 7.15 and OXC nightly.
All 3 same result.
What is the regression exactly?

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 143
    • View Profile
Re: Mutual Surprise Rule - Sidestepping (OXCE 8.0 Regression Defect?)
« Reply #2 on: January 02, 2025, 02:28:07 pm »
I tried to reproduce, but behaviour appears to be functional. In the save I provide, if either Lucas or Ren move north without facing into the barn they'll get shot at as they have practically no TUs left and the sectoid inside has full TUs. However, if Lucas sidesteps to the entrance of the barn they won't get shot at even tho their reaction score should be almost non-existant, same for Ren if they move diagonally towards the same entrance.
The 3rd unit, Hanne, is at full TUs, if they move south not looking into the barn they'll get a reaction shot, if they move diagonally towards the entrance they'll spot the sectoid and not get shot at. At this point if Hanne moves to hide behind the barn wall next to them, turn to prepare for a side-step and move out doing so, they'll get reaction fire because their mutual surprise has already been triggered from the previous spot.

All of the actions detailed were carried out both on OXCE 7.15 and 8.0, behaviour is the same on both.

Also tried loading the vanilla save provided, but results are exactly the same, side stepping at the barn entrance after wasting TUs (2 auto fires into cabbages) prevent reacction fire, walking without side-stepping will draw fire.

Offline Buscher

  • Colonel
  • ****
  • Posts: 182
    • View Profile
Re: Mutual Surprise Rule - Sidestepping (OXCE 8.0 Regression Defect?)
« Reply #3 on: January 02, 2025, 03:11:30 pm »
Previous Answer; nevermind that.
Spoiler:
However, if Lucas sidesteps to the entrance of the barn they won't get shot at even tho their reaction score should be almost non-existant

I get reaction shots here. No idea why I get different behaviour. I tested with fresh installs (extract OXC/OXCE, put in UFO+TFTD, enable Alternative Movement Method, enable debug in options.cfg), tried with and without debug used.

I ran multiple versions now and that's my truth table for sidestepping drawing reaction fire with Lucas in the above mentioned savegame.
Code: [Select]
OXC 1.0.587102a15-dirty (Linux)                       - no reaction
OXCE 8.0.0 (v2024-12-27) (Linux)                      - reaction
OXCE 8.0.0 (v2024-12-30) (Windows 7)                  - reaction
OXCE 7.15.0 (v2024-11-01) (Linux)                     - reaction
OXCE 7.13 (v2024-07-26) (Linux)                       - reaction

What I found interesting is that I get a different sequence of animations in OXC (torso stays towards west/the enemy while walking) compared to OXCE (turn north/towards walking direction, walk, turn west/towards enemy)

@CrazedHarpooner, what is your sequences of walking/turning animations?

Any ideas what I could try?

Conclusion:
I am pressing CTRL+SHIFT+Left click and that breaks the mutual surprise rule. If I only press CTRL+Left click it works  :-[
OXC doesn't care about the SHIFT button and it works either way.

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 143
    • View Profile
Re: Mutual Surprise Rule - Sidestepping (OXCE 8.0 Regression Defect?)
« Reply #4 on: January 02, 2025, 03:33:32 pm »
I see, tried it while also holding the shift key down and yeah, doing so causes a bypass of the mutual surprise rule.

Edit: and yes, the animation is different from OXC while side-stepping, OXC keeps the facing and plays the walking animation but moves it side-ways. OXCE on the other hand plays the animation in the direction they're moving in and then turns. However I believe this is merely visual as the facing is not actually changed.
« Last Edit: January 02, 2025, 03:37:22 pm by CrazedHarpooner »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9257
    • View Profile
Re: Mutual Surprise Rule - Sidestepping (OXCE 8.0 Regression Defect?)
« Reply #5 on: January 02, 2025, 03:42:42 pm »
SHIFT literally means "ignore mutual surprise/newly spotted enemies" in OXCE: https://github.com/MeridianOXC/OpenXcom/blob/oxce-plus/src/Battlescape/BattlescapeGame.cpp#L1983

Original commit from 2016: https://github.com/MeridianOXC/OpenXcom/commit/5a1f4dbee8e3fc01276325ccb2ae10949fbb3cd6

PS: combination of both Ctrl+Shift was never tested and is undefined behavior.

PS2: yes, the animation is different in OXCE... for reasons... technical reasons... it has no impact on functionality