Author Topic: [Answered] unit visibility stacking dark&smoke since 7.9.17 -> too potent  (Read 1858 times)

Offline psavola

  • Commander
  • *****
  • Posts: 827
    • View Profile
There have been recent changes to how smoke might or might not stack with other visibility modifiers, see e.g. Yankes earlier fix with camo: https://github.com/MeridianOXC/OpenXcom/commit/e1f5d582df1ae071d4a441e62c92076c49643e38

This still seems to cause major issues. I just noticed with XCF that in 7.9.20 if you use smoke in darkness, you need to be in an adjacent square to see the enemy unit (without any camo) - one square off and there is no sight anymore. I reproduced this in 'New battle'. See the screenshot (when two agents don't see the enemies).

FWIW, the normal night visibility in suits in XCF is 9 squares, personal light 5 squares.

When I added a flare and so eliminated the impact of darkness, the agent could see the enemy from 4 squares off, from 5 squares no visibility. This seems normal.

I also tested several versions of 7.9.19 and 7.9.18 and all were bugged. When I rolled back to a version of 7.9.16, the visibility in dark & smoke was again the same as in light & smoke.

So I think the unit visibility change refactoring introduced for 7.9.17 in https://github.com/MeridianOXC/OpenXcom/commit/e35c669db14f170adc5b37e609861fb923574b19 is still buggy in this respect.

I don't think a game-changing feature of dark and smoke stacking at all, let alone in this manner, has or at least should have been intentional. This would be a major change from OXC and OG behaviour.
« Last Edit: December 06, 2023, 07:58:05 pm by psavola »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3346
    • View Profile
Re: Bug: unit visibility stacking dark&smoke since 7.9.17 -> too potent
« Reply #1 on: December 06, 2023, 10:04:40 pm »
Yes, intention was that smoke and darkness stack with each other as previously they had no impact on each other.
Of corse I could make it too potent, I will check it if difference is reasonable.

If change stay as is, there is possibility of restoring old behavior using visibility scripts as they have all needed data now to alter
visibility in any way modder prefer.

Offline psavola

  • Commander
  • *****
  • Posts: 827
    • View Profile
Re: Bug: unit visibility stacking dark&smoke since 7.9.17 -> too potent
« Reply #2 on: December 06, 2023, 10:12:50 pm »
Yes, intention was that smoke and darkness stack with each other as previously they had no impact on each other.
Of corse I could make it too potent, I will check it if difference is reasonable.

If change stay as is, there is possibility of restoring old behavior using visibility scripts as they have all needed data now to alter
visibility in any way modder prefer.

This breaking change seems to be way outside the scope of basic OXCE goals striving to keep game mechanisms similar to OXC as described in https://openxcom.org/forum/index.php/topic,6459.msg100419.html#msg100419 (including "OXCE has an ambition to stay true to the vanilla experience!") at least as far as it affects non-modded games and also playing vanilla game.

At the very least this should be an option that can be turned on and off.

I wonder if I missed any discussion about this. I doubt anyone would feel that such a significant change - unless explicitly enabled by a modder - would be desirable.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3346
    • View Profile
Re: Bug: unit visibility stacking dark&smoke since 7.9.17 -> too potent
« Reply #3 on: December 06, 2023, 10:30:28 pm »
Vanilla have by default light around every player unit that reduce effect of this change

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3346
    • View Profile
Re: Bug: unit visibility stacking dark&smoke since 7.9.17 -> too potent
« Reply #4 on: December 06, 2023, 11:18:11 pm »
After checking code and looking on low light situation, I decide to nerf bit smoke that is close to unit, instead of 100% power, for two tiles next to unit it have only 50% power. This allow to see two tiles ahead in dark smoke if unit is inside smoke, but if you look from far away it will max any unit there.

Offline psavola

  • Commander
  • *****
  • Posts: 827
    • View Profile
Re: Bug: unit visibility stacking dark&smoke since 7.9.17 -> too potent
« Reply #5 on: December 07, 2023, 08:33:28 am »
I tested this with vanilla XCOM1. In 7.9.16, visibility in dark and smoke was 5 regardless of whether you toggled personal light with 'L'. In 7.9.21, the visibility was now the same 5 tiles if you kept personal light enabled, but if you disabled it, you couldn't see past 2 tiles.

For what it's worth, I tested the same thing with an OXC version from 2021. There the visibility in dark and smoke was 5 tiles regardless of whether you disabled personal light or not.

On personal light:

I'm not sure how personal light actually affects the visibility of enemy units seeing you in the dark, or should it. https://www.ufopaedia.org/index.php/Controls_(OpenXcom) describes this as 'L – Toggle Personal Lighting (light up the space around your soldiers to see them in dark terrain easier).' OXC lacked 'night vision mode' and ALT-press to help with this that OXCE has. So it appears that personal light in OXC was just an UI feature for playing experience, not something that would affect game mechanics in any manner. But at least now it does in OXCE. And that would require major documentation.

The default personal light in OXCE is 15. In my experience, XCF armors with personal light value '5' don't stand out in the dark and allow enemies to snipe at you. But if you take, for example, a tank which has the default personal light of 15, the enemies seem to start shooting at it even if they otherwise could not (and you can approach them more stealthily by disabling personal light).

If in OXCE 'personal light', even with its default settings of 15, is intended to affect game mechanics, in contrast to being an UI feature in OXC, it should be documented in cat-sized letters. And I doubt why repurposing OXC personal light UI feature to affect game mechanics would be a good idea.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3346
    • View Profile
Re: Bug: unit visibility stacking dark&smoke since 7.9.17 -> too potent
« Reply #6 on: December 07, 2023, 11:41:23 am »
I tested this with vanilla XCOM1. In 7.9.16, visibility in dark and smoke was 5 regardless of whether you toggled personal light with 'L'. In 7.9.21, the visibility was now the same 5 tiles if you kept personal light enabled, but if you disabled it, you couldn't see past 2 tiles.

For what it's worth, I tested the same thing with an OXC version from 2021. There the visibility in dark and smoke was 5 tiles regardless of whether you disabled personal light or not.
If you want you can restore this behavior by using scripts as one goals of this change was give greater freedom to mods.

On personal light:

I'm not sure how personal light actually affects the visibility of enemy units seeing you in the dark, or should it. https://www.ufopaedia.org/index.php/Controls_(OpenXcom) describes this as 'L – Toggle Personal Lighting (light up the space around your soldiers to see them in dark terrain easier).' OXC lacked 'night vision mode' and ALT-press to help with this that OXCE has. So it appears that personal light in OXC was just an UI feature for playing experience, not something that would affect game mechanics in any manner. But at least now it does in OXCE. And that would require major documentation.

The default personal light in OXCE is 15. In my experience, XCF armors with personal light value '5' don't stand out in the dark and allow enemies to snipe at you. But if you take, for example, a tank which has the default personal light of 15, the enemies seem to start shooting at it even if they otherwise could not (and you can approach them more stealthily by disabling personal light).

If in OXCE 'personal light', even with its default settings of 15, is intended to affect game mechanics, in contrast to being an UI feature in OXC, it should be documented in cat-sized letters. And I doubt why repurposing OXC personal light UI feature to affect game mechanics would be a good idea.
Light in original game do not matter, aliens have NV. For OXC, it always affect you and enemy, OXCE do not change any thing there.