Stormworks: Build and Rescue

Stormworks: Build and Rescue

34 ratings
V2 Enhanced TWS Radar
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
586.264 KB
21 Dec, 2024 @ 9:20am
18 Jan @ 9:46pm
14 Change Notes ( view )

Subscribe to download
V2 Enhanced TWS Radar

Description
Enhanced Mult-Target Tracking



Specifications
Scanning at a full 360-degrees with a default of 7km range, this TWS radar is a massive improvement over my last both technically and practically. It's also computationally expensive, but it's early days though so there's a lot of improvements to be made.

Wherein my V1 TWS radar used the Hungarian algorithm, this implementation uses the Joint Probabilistic Data Association Filter (JPDAF) for multi-target tracking instead. To understand the JPDAF, it's probably easiest to explain the single-target-tracking probabilistic data association filter (PDAF) first. Most conventional trackers work by updating the track using the radar return nearest to the anticipated position. This approach works well in simple scenarios but struggles when measurements are ambiguous due to noise or clutter.

Instead of making a hard one-to-one assignment, the PDAF calculates a weighted average of all plausible measurement associations based on their probability of association. At it's core, it's essentially just a modified Kalman filter, it's able to keep track of the variance of the estimate and use this in determining if a radar return is likely to have originated from the track. A radar return that is 7 standard deviations away is given more importance than a return that is 14. The standard deviation distance is then used to find the normalized likelihood of association between each return and that track.

Extending this concept to multiple targets, the JPDAF differs from the PDAF only in how the probability of association is calculated. Instead of using the likelihood of association between a specific track and measurement in the weighted average, the JPDAF considers the possibility of a combination as a whole. Imagine you have 2 tracks and 2 measurements, if you were to assign each track to either a measurement or clutter (where only one track can be associated to one measurement at a time) there is a total of 7 different feasible combinations:

T1, T2
0, 0 --both assigned to clutter
0, 1 --track 2 assigned to return 1
0, 2
1, 0
1, 2
2, 0
2, 1

The probability of event (1, 2) can be calculated similarly to PDAF using the likelihood of association between a specific track and measurement. In this event it'd be calculated like so, (likelihood between track 1 and return 1) multiplied by (likelihood between track 2 and return 2). Now from the event probabilities, the probability of association between a track and a measurement can be calculated. If you wanted to find the probability that track 1 is assigned to measurement 2 then you'd add all events containing this combination (i.e. P(2, 0) + P(2, 1)). The search for all possible combinations can be exponential though, so it's very possible that it'll go over runtime for complex situations. I have tried to optimise this using validation gates which will limit which returns a track can be associated with.

To Do
This is still a massively WIP creation, here's a current list of what needs adding:
--Optimisation:
--clustering optimisation, might be able to do separate searches for clusters of tracks distant from each other

--Revise track initiation and deletion:
--handle cases where tracks coalesce

--Time-since-detection filter

--UI
--Selected Target Info

Operation
To launch on a specific target, focus on the track through the monitor and then press the space-bar to launch a missile.

Customisation
Please do not use the select tool on the radar
I've added a few different options to change radar parameters in the MC, it's not obvious what each of these do so I'll explain them here.

If you want to change monitor sizes you'll have to do that manually by adjusting the "X" and "Y" property sliders to match the width and height of your monitor. For small monitors, you mat also want to consider offsetting the map forwards.

Please don't change the radar unless you know how to xml edit it's speed, but if you do, change the radar settings there's a few things that need to be adjusted in the properties. "Max Range" is obvious, but "Sweep Period (Ticks)" should be set to the time it takes for your radar to complete a full sweep (you can find this value by hovering over the MC while it's spawned).

"Initial Variance", "Process Noise", and "Gate Size" are all sort of related. If you turn on the "Draw Gates" property it's easy to get a good idea what each of these do (anything outside these gates are rejected by the track).

A high Initial variance will spawn the track in with a much larger validation gate, it'll also be more sensitive for the first few sweeps before settling. Changing this to a higher value can be useful for tracking fast moving targets, but it'll also make it take longer before other independent returns adjacent to the track to have a track initiated on them.

A high process noise will permanently raise the size of the validation gate, compared to something with a low process noise. It'll also make the estimates more sensitive to changes.

Gate size is measured in standard deviations, setting the gate to 40 will reject any targets more than 40 standard deviations away from the prediction.




Permissions
Feel free to re-upload this missile and radar system on your own vehicles, so long as you provide the link to this WS page. Do not, however, re-upload the truck.
82 Comments
SMITHY  [author] 17 Oct @ 8:55pm 
probably, the missiles are kinda dodgy though.
Aryan MrBeast 17 Oct @ 1:12pm 
hypothetically speaking would the VLS included work if launched sideways while wired to this radar?
SMITHY  [author] 1 Oct @ 10:11am 
@Ragoon it outputs x,y,z and ID for every target sequentially. Where y is up, ID is unique to the target and counts up from 1. Target will be assigned an ID when launch on, only selected tracks are outputted.
SMITHY  [author] 1 Oct @ 10:09am 
@twzb, you probs don't need to anymore with the gimbal update
Ragoon 29 Sep @ 7:13am 
tried to make my own missile 1x2 in width, also used the mc from sam launcher but replaced old radar with a single small radar.

The missile goes somewhat in the target direction but just spins wildly.
how does the system output the gps and elevation of the target via composite?

i use output XYZ and not STT
twzb.ttv 26 Sep @ 3:34pm 
how do i make my own radar rotate this quick in XML like what is the code you changed
SMITHY  [author] 20 Sep @ 1:15am 
Yeah, but you’d have to modify the code to output that. Right now it just outputs selected tracks.

To be honest you might be better off waiting for some of the other creators to release their own tws systems. My one was made pre-gimbal update so it won’t perform as well as some of the newer ones I’ve seen. I don’t think any of those are on the WS yet, but you could ask shyzero (his steam is in the comments here) if he’ll release his.
Mr. Simtimus 19 Sep @ 10:50pm 
I like the precision it gives. Is it possible to add an output for detected targets. It would be useful for feeding my RWR with found targets, and also I'm planning on making a MiG-29 detailed HUD, and space is the key there. Thank you for reading.
SMITHY  [author] 7 Sep @ 5:37pm 
Yeah all good, you could even upload if you wanted
SMITHY  [author] 20 Jun @ 3:54pm 
yeah, that should be very possible. Sadly I probably won't be able to add it atm. The code is online if you wanted to change it to everything, but keep in mind the code is extremely messy