Author Topic: visibility algorithm  (Read 743 times)

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
visibility algorithm
« on: December 15, 2023, 01:59:26 am »
Pardon the question that was probably asked many times but I didn't find an answer here.
How visibility is computed all variables accounted for: race, light, smoke, fire? Any comprehensive article or explanation? Thank you.

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: visibility algorithm
« Reply #1 on: December 15, 2023, 02:05:30 am »
Found my answer about smoke here.
https://www.ufopaedia.org/index.php/Smoke_Grenade#Visual_range

Apparently, its thickness degrades with time and it is not possible to tell how thick it is just by looking at it. Ugh.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3349
    • View Profile
Re: visibility algorithm
« Reply #2 on: December 15, 2023, 11:03:43 pm »
In recent version OXCE change how viability work, as previously some things do not stack with each other.
Now most things stack (camouflage, smoke, light).

Beside, you have full access to code you can see what happens there:
https://github.com/MeridianOXC/OpenXcom/blob/oxce-plus/src/Battlescape/TileEngine.cpp#L1843

Even more if you do not like current version you can mod it using y-scripts.