Author Topic: [Suggestion] Option to disable spotters spotting when hit  (Read 1158 times)

Offline Jaedar

  • Sergeant
  • **
  • Posts: 14
    • View Profile
[Suggestion] Option to disable spotters spotting when hit
« on: October 19, 2024, 10:44:28 am »
Currently when spotters are hit, they spot the unit that fired on them. This behavior is not fun to me and it also feels a bit like telepathy when something goes down from a single shot in the back of the head from a hidden unit on the other side of the map, and suddenly every enemy snipers knows exactly where the shot came from.

I would like an option somewhere to disable this part of spotter behavior, so that spotters would only spot units they actually see.

I'm not a c++ coder so I might be way off base, but it looks like it could be a fairly small change in the ProjectileFlyBState::projectileHitUnit method, plus whatever scaffolding is needed to add a new option.

Offline Tamren

  • Captain
  • ***
  • Posts: 63
    • View Profile
Re: [Suggestion] Option to disable spotters spotting when hit
« Reply #1 on: October 25, 2024, 05:46:24 pm »
Yeah that also bothered me due to how unrealistic it is. I think there could be multiple optional rules:

1. Spotters can only spot things they can see, so spotters are much more dangerous in daylight hours and can be countered by camo, smoke, indirect attacks and darkness.
2. Units with broken morale on the enemy turn or morale reduced to zero on the player's turn lose all of their spotting abilities (if they don't already).
3. Spotters that are killed or knocked unconscious by a single powerful hit cannot spot for allies regardless of any other factor.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: [Suggestion] Option to disable spotters spotting when hit
« Reply #2 on: October 25, 2024, 06:14:13 pm »
...when something goes down from a single shot in the back of the head from a hidden unit on the other side of the map, and suddenly every enemy snipers knows exactly where the shot came from.

3. Spotters that are killed or knocked unconscious by a single powerful hit cannot spot for allies regardless of any other factor.

This case I am willing to implement (as a mod option, not user option).

The rest not.

Offline psavola

  • Commander
  • *****
  • Posts: 836
    • View Profile
Re: [Suggestion] Option to disable spotters spotting when hit
« Reply #3 on: October 25, 2024, 07:35:10 pm »
For what it's worth, I kind of like the idea of dividing the spotter/sniper AI logic into three different categories of realism (instead of just two that Meridian was willing to consider):

1) the spotter has to be able to see the shooter in order to be able to spot it and direct snipers at the unit. Somewhat equivalent to yelling, "hey I was shot by that guy over that rock, direct your fire over there!".
2) the spotter cannot spot if it's instantly killed or knocked unconscious (the suggestion above). If you only score a non-fatal hit, somewhat equivalent to yelling "hey I was shot to my side from the direction of that big rock, direct your fire over there!"
3) the current spotter/sniper logic, which has no limitations whatsoever.

Of course, seeking equivalences and realism does not actually work if the mod uses "spotter" integer greater than 1, because in that case the hits will be remembered and the location is magically known a number of turns since the hit occurred (and the unit has likely already moved away). Also even with spotter=1 the unit might have moved (usually only a little bit) after shooting. So perhaps trying to achieve or improve realism might be a moot point.

Offline Jaedar

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: [Suggestion] Option to disable spotters spotting when hit
« Reply #4 on: October 25, 2024, 07:43:56 pm »
1) the spotter has to be able to see the shooter in order to be able to spot it and direct snipers at the unit. Somewhat equivalent to yelling, "hey I was shot by that guy over that rock, direct your fire over there!".
3) the current spotter/sniper logic, which has no limitations whatsoever.
Aren't these two the same, since spotters in current logic will spot anything they see, so also spotting something they see and got shot by adds nothing?

This case I am willing to implement (as a mod option, not user option).

The rest not.
I will accept what I can get with gratitude (I think I can customize mods once I've downloaded them), even if I would prefer the ability to disable "spot when shot" entirely and not just when instant-killed.  Thanks.

Offline psavola

  • Commander
  • *****
  • Posts: 836
    • View Profile
Re: [Suggestion] Option to disable spotters spotting when hit
« Reply #5 on: October 25, 2024, 08:48:01 pm »
Aren't these two the same, since spotters in current logic will spot anything they see, so also spotting something they see and got shot by adds nothing?

No, they are not the same. Currently the spotter does not need to see the shooter hitting it to flag the shooter for the snipers. That is, shooting out of the dark or from the cover of smoke or outside the vision range of the target unit also gets you spotted. With this kind of option (which Meridian seemed not willing to implement) the sniper/spotter logic would be closer to vanilla AI - but not quite, if the spotter has visibility.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: [Suggestion] Option to disable spotters spotting when hit
« Reply #6 on: October 26, 2024, 12:36:59 am »
EDIT: Several posts above and below were deleted.

You know what, I changed my mind.

I will not implement even the one-shot exception in standard AI unit spotting... unless I am asked by actual modders (https://openxcom.org/forum/index.php?topic=11631.0).

If you don't like how the OXCE sniping feature (as implemented by ohartenstein23) works, turn it off.
« Last Edit: November 03, 2024, 11:48:52 pm by Meridian »

Online CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: [Suggestion] Option to disable spotters spotting when hit
« Reply #7 on: October 26, 2024, 02:46:48 pm »
How about exposing getTurnsLeftSpottedForSnipers and setTurnsLeftSpottedForSnipers in Y-scripts the same way getTurnsSinceSpotted and setTurnsSinceSpotted are instead? I already have an idea of a sample script that could handle this "issue", but it's currently not possible without these operations.
« Last Edit: October 26, 2024, 02:48:36 pm by CrazedHarpooner »

Online Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Suggestion] Option to disable spotters spotting when hit
« Reply #8 on: October 26, 2024, 04:01:13 pm »
I will not implement even the one-shot exception in standard AI unit spotting... unless I am asked by actual modders (https://openxcom.org/forum/index.php?topic=11631.0).

I would like to provide my feedback, but frankly there are too many concepts here. I would appreciate a list of questions to address.
I understand this is shifting work from me to the OXCE dev team, but I can't think of a better solution, sorry.

Anyway, what I can tell right now is that I also dislike insta-killed spotters warning their comrades. I feel it goes against the narrative of this feature.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: [Suggestion] Option to disable spotters spotting when hit
« Reply #9 on: November 03, 2024, 11:38:53 pm »
I have deleted several posts above (including mine) explaining the vanilla spotting mechanics and the (lack of) differences compared to the sniper-spotting mechanics.
I am not going to change the vanilla spotting mechanics, not even when asked by modders.
Chapter closed.
(Let's not go offtopic again and focus on sniper-spotting only.)

That leaves us with only one option... make the sniper-spotting mechanics different from the vanilla spotting mechanics.
I didn't want to do that either, but with modding interest, I shall reconsider.
I'll talk to Solarius about the details via some instant messenger and summarize here afterwards.

How about exposing getTurnsLeftSpottedForSnipers and setTurnsLeftSpottedForSnipers in Y-scripts the same way getTurnsSinceSpotted and setTurnsSinceSpotted are instead? I already have an idea of a sample script that could handle this "issue", but it's currently not possible without these operations.

We can do that regardless of this discussion.
I'll extract this into a separate task later.