OpenXcom Forum
OpenXcom Forks => OpenXcom Extended (OXCE) => Topic started by: Ethereal on February 18, 2025, 07:32:51 pm
-
Thank you for the update.
I've been wanting to ask for a long time - what did you do with visibility through fire? And how can I restore the original visibility through fire?
-
I've been wanting to ask for a long time - what did you do with visibility through fire? And how can I restore the original visibility through fire?
I didn't do anything with visibility through fire.
Maybe Yankes did?
What is different than before?
-
I didn't do anything with visibility through fire.
Maybe Yankes did?
What is different than before?
Since version 7.5 (or slightly earlier), visibility through fire is the same as through smoke, but no parameters regulate the distance of visibility through fire.
-
Yes, there was change where NV work in "infrared" and if it work this way, it should be blinded by fire.
If current behavior is not preferred, its possible to make global script that will override default calculation.
Probably on forums should be somewhere example of this, if not I could prepare example script code that do this.
-
If burning tiles are between you and an enemy, then:
1. At day, it should not reduce visibility. That's logical.
2. At night, but enemy is standing on a daylight tile (because fire is light source), it should also not reduce visibility.
3. At night, but enemy is standing on a dark tile, it should reduce visibility. Because blinding light. But this case should be rare.
Is this the current behavior?
-
Extracted into a separate thread.
-
We have three parameters: DayVisibility, NightVisibility, and HeatVision.
Depending on the combination of these parameters you will get different effects.
Let's consider an alien that has the same vision range for day and night (i.e. DayVisibility = NightVisibility).
Then `100` of `heatVision` will effectively replace smoke with fire for the visibility calculations.
This means smoke will mean nothing to this alien, but fire will block their vision.
When DayVisibility and NightVisibility are different we can have an interesting case, where fire blocks and improves visibility at the same time.
If the target is close behind some fire, then the fire will reduce visibility like smoke, but it will switch to DayVisibility range, because the target is lit.
Targets far behind the fire will still use NightVisibility range and that will cause them to not be visible, because of the fire between.
Here is a script that recreates the current engine to 99% :
visibilityUnit:
- offset: 0.01
code: |
var int newVisibility;
var int heatVision;
observer_unit.getHeatVision heatVision;
limit heatVision 0 100;
set newVisibility distance_max; # max visibility distance based on current light level of target tile and camouflages
sub newVisibility distance; # distance to target
begin;
var int temp;
var int proportion 100;
sub proportion heatVision;
set temp smoke_density_near_observer; # special adjustment to reduce effect of smoke on close observer in dark places
div temp -2;
add temp smoke_density;
mul proportion distance_target_max; # adjustment to scale effectives bases to max possbile visiblity range
muldiv temp proportion 6000;
add newVisibility temp;
end;
begin;
var int temp;
var int proportion 0;
add proportion heatVision;
set temp fire_density_near_observer; # special adjustment to reduce effect of fire on close observer in dark places
div temp -2;
add temp fire_density;
mul proportion distance_target_max; # adjustment to scale effectives bases to max possbile visiblity range
muldiv temp proportion 6000;
add newVisibility temp;
end;
set current_visibility newVisibility;
return current_visibility visibility_mode;
if some part of this logic is not preferred you can comment it out.