Closed b-mayr-1984 closed 3 months ago
I started to have a look at this.
Now I realize that the suggested redesign with being able to deal with multiple signals at once (e.g. jamming all of those) is not as easy as it sounds.
If the beacons
in range are of different type
then it gets really messy. Could be a wild mix of jamming, listening in TFAR comms and just radio chatter. I can't even tell what I want the defined behaviour to be then with the spawned function that heavily relys on _timeActive
.
I don't recommend to enable effect on multiple signals simultaneously because it would require
a) a decision on what shall happen then
b) a considerable re-write of fnc_spectrumDeviceMouseDown.sqf
Search for the strongest signal in _frequencies
and act on this strongest signal only.
(as opposed to the current logic where the first match in the list wins)
This approach is considerably easier and leads to consistent behaviour for the players. If multiple signals overlap in frequency the players can select between those then by simply orienting the antenna to the different signals.
Still this approach falls short when one object is e.g. both a drone
and a chatter
object and if those beacons
use the same frequency. Then the players would not be able to select by means of antenna orientation. (but that's quite an edge-case)
Still this approach falls short when one object is e.g. both a drone and a chatter object and if those beacons use the same frequency. Then the players would not be able to select by means of antenna orientation. (but that's quite an edge-case)
hmm. A possible way to deal with affecting multiple drones if signal is high enough, is to check if the jammer antenna is used, as then TFAR traffic wouldn't work etc. But that then limits us severely if/when new functionality is wanted for different types.
From a gameplay perspective, I think your suggestion of taking the strongest signal, instead of the first is the best one. Gives more consistent behaviour and it is easier for a player to expect the strongest signal to be active selection. Ideally the "zoom" function should help select frequency, but I do know that if they are right on top of each other, there is zoom issues.
Fixed in 1696854fbc7c2a593eddbf900848aac0f08da996.
forEach
loop with scopeName "loopFreq"
has been removed.BIS_fnc_sortBy
and FUNC(calcSignalStrength)
). _frequenciesSorted
only.Tested with both chatter
and drone
types of signals.
The current implementation of the
loopFreq
forEach-loop infnc_spectrumDeviceMouseDown.sqf
can't currently handle multipledrone
type signals (and probably neither other types) in the same selected frequency range simultaneously. (see https://github.com/Crowdedlight/Crows-Electronic-Warfare/blob/main/addons/spectrum/functions/fnc_spectrumDeviceMouseDown.sqf#L48-L129)The reason is, that
breakOut "loopFreq";
is called when the first beacon in the selected range is found. But the first beacon might not be the signal we see in the Spectrum Device.This leads to frequent
ERROR: Too weak Signal
messages at the player side, that probably don't make sense to them. In the example below a drone that one directly stands in front of can't be jammed.When digging into the problem I found that
loopFreq
is probably exited because it found a drone that is >10km away and is thus a) not visible in the spectrum and b) below the threshold of -40 dBm for a signal that can be jammed (this leads to theERROR: Too weak Signal
messages).Here is the output from
{ diag_log str _x } forEach crowsew_spectrum_beacons;
at the time when I took the screenshot. It shows the likely problem.Suggested redesign:
breakOut "loopFreq";
withcontinue