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

Adding offset to existing frequencies for random drone-signals #66

Open Crowdedlight opened 4 months ago

Crowdedlight commented 4 months ago

I think it would probably be a good way of handling it to force an offset between existing signals. Something like picking a random frequency within scope, checking distance to nearest, move in the opposite direction until offset away.

To help avoid spawning frequencies on top of each other when there is an otherwise clear frequency-spectrum. #56 describes why having signals on top of each other can lead to bad UX behaviour for user.

I had considered sorting all signals by frequency, and then going through them saving the "gaps" between them. Then taking the biggest gap, shorten it with a "minimum_seperation" in both ends and run a random function within it. Should give an almost ~O(n) performance, not counting the sorting. But unsure that becomes too much of a pattern as new signals would always appear in the biggest gap.