Author Topic: [Feedback] Help a noob understand vision, fog of war & spotting enemies  (Read 3442 times)

Offline HaplessRookie

  • Squaddie
  • *
  • Posts: 4
    • View Profile
I am enjoying my first playthrough of X-Com, and the OXCE mod is just dandy.  That being said, the vision/LOS system often has me puzzled.  The Ufopedia entry for "Sweeping the Battlescape" states this:

Quote
At the start of the battle, one of your advantages is that the black "fog of war" accurately marks everywhere you haven't checked for alien presence. Don't lose that advantage. If you sweep and clear the battlefield properly, every square that becomes and stays lit will be a square you don't have to check for aliens again. If you have holes in your sweep or perimeter, it's much more of a nightmare to catch that last alien -- not only do you have to check the black areas but also areas you've checked before.

My understanding is that once a square is revealed and is shown to be empty, that I can rest assured that there is no alien currently occupying that tile during this turn.  However, sometimes I will find aliens after moving closer to a revealed tile on that same turn!  Observe in this ~30 sec clip I recorded (which hopefully works properly):


Backup streamable: https://streamable.com/oql364

The square between the tree and fence was clearly revealed by my tank as it was coming down the Skyranger's ramp.  I assumed it was therefore devoid of any Heavy Plasma-toting Sectoid.  However, as I scouted further, lo and behold, a Sectoid appears seemingly out of thin air on that supposedly empty tile!  Sneaky little bastard!

So, what am I not getting here?  Can aliens be hidden on tiles that are currently in LOS?  Why wasn't that Sectoid spotted the moment my tank revealed the tile he was standing on?

Appreciate any input, thanks.
« Last Edit: February 12, 2023, 12:28:42 pm by Meridian »

Offline kevL

  • Colonel
  • ****
  • Posts: 471
  • pitchforks and torches
    • View Profile
Re: [OXCE] Help a noob understand vision, fog of war & spotting enemies
« Reply #1 on: October 19, 2021, 06:32:08 am »
the truth is, that quote isn't exactly accurate ...

the smoke is hiding the alien until you got closer, but smoke doesn't prevent the Fog of War from lifting at max distance ...

(there could also be other, more subtle things at play, since the 2 algorithms are, more or less, distinct in the hardcode)

Offline HaplessRookie

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: [OXCE] Help a noob understand vision, fog of war & spotting enemies
« Reply #2 on: October 19, 2021, 06:46:23 am »
the truth is, that quote isn't exactly accurate ...

the smoke is hiding the alien until you got closer, but smoke doesn't prevent the Fog of War from lifting at max distance ...

(there could also be other, more subtle things at play, since the 2 algorithms are, more or less, distinct in the hardcode)

Ahhh, I had not considered the effect of the smoke.  I didn't realize it would affect your ability to spot aliens even on tiles you reveal.  I thought it only made enemies harder to spot when they were actually standing inside a cloud of smoke.  I mean, it makes sense, logically your vision is going to be affected if you're standing in a cloud of smoke, but it's not exactly communicated clearly in the game  :o

I may have to rethink my "always smoke the bottom of the ramp" tactic.  Thanks for the info!
« Last Edit: October 19, 2021, 06:52:21 am by HaplessRookie »

Offline kevL

  • Colonel
  • ****
  • Posts: 471
  • pitchforks and torches
    • View Profile
Re: [OXCE] Help a noob understand vision, fog of war & spotting enemies
« Reply #3 on: October 19, 2021, 06:56:30 am »
I may have to rethink my "always smoke the bottom of the ramp" tactic.  Thanks for the info!

smoking the ramp is always a good idea ... unless your soldiers have a deathwish ;)

eg. smoke ramp, don't move end turn; lets the aliens expend their TU ... proceed w/ caution on T2

ps. smoke acts as a 'distance multiplier' for LoS (depends on the density of the smoke, how many turns it's been out and dispersed)
« Last Edit: October 19, 2021, 07:11:22 am by kevL »

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [OXCE] Help a noob understand vision, fog of war & spotting enemies
« Reply #4 on: October 19, 2021, 10:34:20 pm »
The way smoke vision is calculated is this:
Each tile of smoke has a thickness value. The sight line from your unit to the enemy unit is checked, and all smoke tiles along that path are added up. It determines if the smoke is or is not thick enough to obscure the vision.
Smoke created by explosives is much thinner than smoke creates by smoke blasts. Smoke spreads and thins out over time.

It is not uncommon for the game to get a different result on whether or not unit A can see unit B vs. whether or not unit B can see unit A. That means sometimes the alien will spot you first, sometimes you will spot them first, but usually you will both spot each other at the same time.

In openXcom Extended (OXCE), there is an attribute called heatVision which reduces the effective amount of smoke as far as that unit's vision is concerned, and another called psiVision which entirely ignores line of sight concerns for spotting units. The vanilla game does not use these attributes (so all aliens have the same capacity to see through smoke as player soldiers do), but mods may take advantage of these either for player units or for aliens.

Night vision also works unintuitively. Depending on the light level of the battlescape, it is determined to either be "day" or "night. On some tilesets it can look as dark as night yet still count as "day" in which units can always see out to their maximum vision range (default: 20 tiles). But if it is "night", then things work differently:
 - In the original game, the player and AI units all had exactly the same vision. However since player units emitted light and aliens did not, it meant that the aliens could see player units as though it were day.
 - OpenXcom preserves this alien night vision in the vanilla game, to the extent that even if you turn your soldiers' lights off, the aliens can still see you just fine.
 - OXCE provides lots of options for mods to tweak exactly how unit vision behaves in the day or night. Some units may even have camouflage which makes it harder for other units to spot them in the day, night, or both.

Offline Skybuck

  • Colonel
  • ****
  • Posts: 223
    • View Profile
Re: [OXCE] Help a noob understand vision, fog of war & spotting enemies
« Reply #5 on: April 17, 2022, 11:49:02 am »
I think this should be fixed in code, where the vision algorithm is either changed to only reveal tiles which are visible through the smoke, or even voxels which are visible through the smoke, the latter is still experimental idea, but the first is interesting... it may change the game a little bit versus original, but this is the interesting part... this will also hamper the smoke tactic from seeing rest of map which I find kind of funny... then again it does not make much sense anyway... cause when the skyranger landed it must have seen some parts of the map, well at least the block that the skyranger is in is fully revealed... maybe a bit more around the skyranger should be fully revealed, like a circle or so... or perhaps in front of the skyranger.. or perhaps even an approach path of the skyranger that be cool.

So landing/skid marks of where the skyranger landed would also be cool by the way.

(This idea to change visibility algorithm could at least be implemented as an option so people can experiment/play with it to see if they like it ! ;))

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [OXCE] Help a noob understand vision, fog of war & spotting enemies
« Reply #6 on: April 21, 2022, 08:41:56 am »
I think this should be fixed in code, where the vision algorithm is either changed to only reveal tiles which are visible through the smoke, or even voxels which are visible through the smoke,
I suspect that would greatly increase lag, or cause a lag spike every time a unit took a step. Vision is done separately for tiles versus units. Vision of units is probably a lot more robust, counting complex variables which are most likely ignored for tile vision.

There's probably a way to do it without making it laggy, but you'd have to understand how all of the vision calculations are made, and I don't.