Crowdedlight / Crows-Electronic-Warfare

Arma 3 Mod that enables electronic warfare features such as Radio/Drone jamming and spectrum signal tracking
https://crowdedlight.github.io/Crows-Electronic-Warfare/
Other
17 stars 6 forks source link

Spectrum signals can be seen outside their set range #92

Open Crowdedlight opened 1 month ago

Crowdedlight commented 1 month ago

Due to how we calculate signal strength, and not checking if outside max range of the signal-source, then we always get some base strength even when outside the range, due to the high weight we give direction versus range.

signal source 5km away, with signal set to 3km range. billede

But can still be picked up by player 5km away. 20240524235701_1

This could also be part of why we found it hard to figure out how far away enemies were in the last event @b-mayr-1984 It would have been rather unreliable in judging distance, but good at judging direction.

I believe a fix would be to not show any signals that is outside the signal range, just skip those. But might also want to slightly adjust the function to lower the weight slightly for direction, so its easier to judge range?

b-mayr-1984 commented 1 month ago

@Crowdedlight so far I wasn't exactly sure what your intended behavior is.

If it was up to me I would probably treat both direction and distance as 2 parameters that each scale the displayed level between 0% and 100%.

Meaning the range of the signal determines the falloff via distance. At 0m distance you get 100% as contributing factor. At distance==range you get 0%.

Same contribution behavior then for direction. The vector difference is always between 0 and 2. https://github.com/Crowdedlight/Crows-Electronic-Warfare/blob/main/addons/spectrum/functions/fnc_calcSignalStrength.sqf#L21

One can just map these to 100% and 0% contributing factor.

That would make for consistent behavior IMHO.

Crowdedlight commented 1 month ago

Yeah, was thinking towards the same lines. Originally I had higher weight on direction to ensure you could still direction find, even if you were 5m away from it. But the way I originally made it is a bit of a round-about calculation.

Will probably test out having range and direction contribute as you describe. might have to make it be 50% each, so being right next to it still allows to direction-find, with combined being max of 100%.

b-mayr-1984 commented 1 month ago

might have to make it be 50% each, so being right next to it still allows to direction-find, with combined being max of 100%.

Sounds to me you are thinking of 2x contributing values that you then add up.

I had 2x factors in mind (that are between 0 and 1) which are simply multiplied together (then still between 0 and 1). This does also allow for DFing at all times (but also homing in at all constellations). The resulting factor is finally multiplied with the transmitters maximum possible signal level.