Stormworks: Build and Rescue

Stormworks: Build and Rescue

93 ratings
Advanced TWS Radar
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
969.782 KB
4 May, 2024 @ 7:40pm
1 Sep, 2024 @ 8:47pm
9 Change Notes ( view )

Subscribe to download
Advanced TWS Radar

Description
Please see V2 here (JPDAF tracker): https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3388742860


Nothing Comes Close, Undetected



Specifications
The VLS SAM launcher and missile are only intended as a showcase for the radar system.

Unlike most Track-While-Scan (TWS) radars in SW, this one works by building up a list of new detections before updating target tracks. It doesn't use a position threshold to update target tracks. Instead, tracks are updated by first building a matrix of the distances from detections to tracks. Then using the Hungarian algorithm (Kuhn-Munkres) to find which detection-track pair is closest ( https://en.wikipedia.org/wiki/Hungarian_algorithm ).

Also the system is completely modular and you're able to adjust the radar FOV, sweep limit, and sweep speed to your liking. However, for the same reason this radar keeps tracks so well, it can't handle large sweep limits. Since it has to wait for a complete scan of a sector to update tracks, it struggles with sweep limits greater than about 0.2. Keep in mind this is a WIP vehicle and there are methods to handle 360 degree scans, which I'll add later.

Normally, selected target coordinates are outputted on channels 1,2,3, where channel 1 is west/east, channel 2 is altitude, channel 3 is north/south). Channel 4 is the ID for which missile is assigned to the track.

NOW SUPPORTS ALL MONITOR SIZES. Just manually change the size of the monitor with the property slider in the MC.

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

Customisation
I've added a few different options to change radar parameters in the MC, it's not obvious what each of these do since I've had to keep the names short because of the character limit.

If you change the FOV or you change radar types, make sure to set the "Max Range (km)" parameter to the radar's new max range.

If you feel that target's are disappearing too fast/slow after losing lock you can change it with the "Timeout" parameter. Setting this to 8 will mean the target will be deleted if it hasn't been detected for the last 8 scans.

"X" and "Y" should be set to your monitor's size.

The "S" parameter is a bit difficult to explain. This TWS updates tracks by assigning the closest new radar contact. This can be a problem if you lose a lock on one target, but acquire a different target on the other side of the map. Normally, the algorithm doesn't care how far they are away, it'll update the old track with the new target. S will limit the TWS, by default it's limited to 900 metres, but you should increase this as you increase radar range. For a 40km radar I've found that 3000 metres works well.

The "M" parameter is pretty niche, makes it so that the radar only outputs the selected target instead of a list. To activate set the value to 1. Remember that it still outputs altitude over channel 2 though.

If you want details about the code, just DM me.

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.
87 Comments
SMITHY  [author] 12 Apr @ 8:28pm 
Yeah I’m named smithy3141, you can find it through the SW official discord
Cement and Rebar 12 Apr @ 4:22am 
is there any way we can talk on dicsord? i want to try and understand how your code works (since its currently obfuscated and minimised), so i can make a derivative of it with multiple radars
SMITHY  [author] 11 Apr @ 4:22pm 
None of my WS tws radars support multiple radars by default, but I know @shyzero is working on a heavily modified version of my “Advanced tws radar v2” which does pretty much everything you want (and more). I’m not sure when he’s going to release it though, just ask him on discord.
SMITHY  [author] 11 Apr @ 4:19pm 
If it were one radar spinning 360 degrees it’d have to update every 360 degrees
SMITHY  [author] 11 Apr @ 4:18pm 
If you want to add a rear facing radar and both spin for example 360 degrees clockwise you need to edit the script so it updates every 180 degrees
Cement and Rebar 11 Apr @ 11:21am 
Im trying to use multiple radars. Im combining all three to have correct outputs (for ex. adding 0.5 to the rear facing radar), with the physics output in the middle of both. Yet, there are two overlapping targets, and it refreshes every turn, instead of every time it detects a target. Do you have any clue how to modify the system to make it work better?
Sire, Johnny The Third 22 Mar @ 8:48am 
amazing
SMITHY  [author] 18 Mar @ 2:10pm 
set the mode to STT (so it only outputs gps for the most recently selected track), and then you'll probably have to swap channels 2 and 3 around. The tws outputs altitude over channel 2 and north/south coordinates over channel 3, but I think EHCS does it the other way around.
SMITHY  [author] 15 Nov, 2024 @ 12:33am 
for that vector I gave y or 2 is the altitude btw
SMITHY  [author] 15 Nov, 2024 @ 12:32am 
I just used the one from stormworks official discord. The message by Quale pinned in the Lua channel (m00,m01,m02, ...). So the following was my rotation matrix:
R = {
{m00,m01,m02},
{m10,m11,m12},
{m20,m21,m22}
}

The first column gives the right facing vector of the craft, the second gives an upwards pointing vector, third is a forwards vector.

So say I had a vector in local space:
V = {
{3},
{2},
{1}
}

Therefore the vectors position in global space is given by:
Vg = R * V

The first row would be calculated like so:
Vg[1] = {3*m00+2*m01+1*m02}

Second would be:
Vg[2] = {3*m10+2*m11+1*m12}