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.