Skip to content

Pick THREAT call format from on-frequency receivers#656

Merged
dharmab merged 2 commits into
mainfrom
threat-call-receiver-format
May 4, 2026
Merged

Pick THREAT call format from on-frequency receivers#656
dharmab merged 2 commits into
mainfrom
threat-call-receiver-format

Conversation

@dharmab
Copy link
Copy Markdown
Owner

@dharmab dharmab commented Apr 18, 2026

Closes #654.

Summary

  • radar.Threats now filters the receiver set to friendlies on the controller's SRS frequency before deciding the call format, so AI wingmen and off-frequency friendlies no longer inflate the count.
  • BRAA or bulleye is used based on the receivers: 1 receiver → BRAA from that receiver; 2+ receivers within ≤5° bearing spread and ≤1 nm range spread of each other's BRAAs → BRAA from the geographic midpoint; otherwise bullseye.
  • radar.New takes a *simpleradio.Client for checking who's on frequency.
  • broadcastThreat trusts the filtered map and no longer checks frequency.
  • New helper bearings.AngularDistance for wrap-around-safe bearing differences.

@dharmab dharmab force-pushed the threat-call-receiver-format branch 2 times, most recently from 8b5756b to 1fb963c Compare April 21, 2026 05:10
Closes #654.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dharmab dharmab force-pushed the threat-call-receiver-format branch from 1fb963c to 304952e Compare April 21, 2026 05:11
Comment thread pkg/radar/threat.go Outdated
// receivers' BRAAs to a hostile. If the spread is within this threshold,
// the individual BRAA calls can be merged into a single call using the
// receivers' geographic midpoint.
const maxSharedBRAABearingSpread = 5 * unit.Degree
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider allowing the end user to set this value, allows for better customisation and theatre fit.

Comment thread pkg/radar/threat.go Outdated
// receivers' BRAAs to a hostile. If the spread is within this threshold,
// the individual BRAA calls can be merged into a single call using the
// receivers' geographic midpoint.
const maxSharedBRAARangeSpread = 1 * unit.NauticalMile
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider allowing the end user to set this value, allows for better customisation and theatre fit.

Copy link
Copy Markdown

@WigglySuperNoodle WigglySuperNoodle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic changes look to be solid.

If possible, it would be good for the end user (server admin) to be able to specify the constants as per my comments on threat.go lines 20 and 26.

Add --threat-braa-bearing-spread and --threat-braa-range-spread flags
so server admins can tune when threat calls use BRAA vs bullseye format
based on their theatre and player density.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dharmab dharmab enabled auto-merge (squash) May 4, 2026 04:18
@dharmab dharmab merged commit 0937053 into main May 4, 2026
11 checks passed
@dharmab dharmab deleted the threat-call-receiver-format branch May 4, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

THREAT calls use bullseye format when BRAA would be appropriate for the actual receivers

2 participants