Stormworks: Build and Rescue

Stormworks: Build and Rescue

Advanced TWS Radar
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}
ПСИХ 14 Nov, 2024 @ 4:03pm 
hi, what kind of rotation matrix did you use, I can’t make it so that the height Y is considered normal


function rotate(p)
local x,y,z=p[1],p[2],p[3]
local R={}
local c1,c2,c3=M.cos(dX),M.cos(dY),M.cos(dZ)
local s1,s2,s3=M.sin(dX),M.sin(dY),M.sin(dZ)
R[1]=c1*c2*x+(c1*s2*s3-s1*c3)*y+(c1*s2*c3+s1*s3)*z
R[2]=s1*c2*x+(s1*s2*s3+c1*c3)*y+(s1*s2*c3-c1*s3)*z
R[3]=-s2*x+c2*s3*y+c2*c3*z
return R
end

P[1]=M.sin(a)*M.cos(b)*tr[e]
P[2]=M.sin(b)*tr[e]
P[3]=M.cos(a)*M.cos(b)*tr[e]
P=rotate(P)

maybe this will help you understand me
SMITHY  [author] 8 Nov, 2024 @ 6:05pm 
through the microcontroller dropdown menu "X" and "Y", it won't update automatically sadly
Ragoon 8 Nov, 2024 @ 10:53am 
how to change the monitor size slider?
Herro 1357 6 Nov, 2024 @ 3:40am 
Huge Thank You, I've played arround a bit and the potential is huge, but the sheer amount of data is more than Stormworks can handel without some tricks. Thanks for the idea and startingpoint
SMITHY  [author] 12 Oct, 2024 @ 2:01am 
Here's the full code, I got confused and thought you knew some other guy asking a question: https://github.com/SMITHY3141/SW-Track-Assignment/blob/main/Advanced%20TWS%20Radar
SMITHY  [author] 11 Oct, 2024 @ 3:24pm 
If you'd like to know more I'd recommend reading into the track assignment problem and multiple target tracking ( mathworks.com/help/fusion/ug/introduction-to-assignment-methods-in-tracking-systems.html ). The method used in this algorithm is the Global Nearest Neighbour that's solved using the Hungarian Algorithm. For this method you have to wait for a full sweep, but I think other methods like JPDA can update tracks instantaneously ( www.cse.psu.edu/~rtc12/CSE598C/datassocPart2.pdf ). I don't know enough about JPDA to implement it atm though.
SMITHY  [author] 11 Oct, 2024 @ 3:23pm 
Q1: I'll send it to your friend on discord, it's in Lua with English comments

Q2: I've done it before with two radars in a hard-kill system, but keep in mind that the way the algorithm works is very restrictive. Tracks aren't updated instantaneously, the radar has to wait until it's completed a full sweep before it can update tracks. Also the algorithm assumes that for every existing track there's only one new detection. This is a problem when using multiple radars, because say there's a target that gets detected twice at different locations by two spinning radars. The algorithm's going to assume that this is two different targets, when in fact it's just one.
Herro 1357 11 Oct, 2024 @ 5:25am 
Got some questions since I'd like to try and adapt this to use data from several radars working together:

Q1: You mentioned earlier that you could share the code, so is it written in another language? and in that case what language would that be?

Q2: Do you think the code could support several inputs? assuming they all convert to the same coordinate system before your code.

Thanks in advance :)
SMITHY  [author] 2 Oct, 2024 @ 2:33pm 
Not by default, but you can pretty easily change it so that one or both of the variables accept a input.getBool() IB() instead. I've posted the full code here, you'll have to minify it once you're done though https://github.com/SMITHY3141/SW-Track-Assignment/blob/main/Advanced-Sonar-Tracker
Secret176 2 Oct, 2024 @ 9:21am 
Also about the tws sonar is there a way for me to increase map size while increasing sonar range
Secret176 2 Oct, 2024 @ 9:05am 
Actually all screens turned yellow i think cuz of the lua bug with this one cuz i reopened the game and it's all back to normal
SMITHY  [author] 2 Oct, 2024 @ 1:14am 
Out of my expertise sorry. If it’s happening with other microcontrollers it definitely sounds like a graphics issue
Secret176 1 Oct, 2024 @ 8:55am 
like all monitors
Secret176 1 Oct, 2024 @ 8:55am 
uhh idk if it's amd issues but now everything is yellow and bugged for me
SMITHY  [author] 30 Sep, 2024 @ 4:06pm 
weird it turns yellow too, I only draw yellow once in the UI Lua script and it's just to draw one line showing the sweep angle.
SMITHY  [author] 30 Sep, 2024 @ 3:59pm 
huh can't seem to reproduce. Like just slewing the map upwards with the arrow keys?
Secret176 30 Sep, 2024 @ 8:20am 
At a high range like 44km when i try to move the map up the screen turns yellow
Nick Name 25 Sep, 2024 @ 7:15pm 
Oh, it also picks up fishes ?? thats new to me
SMITHY  [author] 25 Sep, 2024 @ 6:07pm 
That was way easier than I thought it was going to be. I still need to add some more things though. There's an absolutely insane amount of fish that it picks up, so I might try and see if I can combine the fish detector to filter them out. Also need to change the UI a little bit.
SMITHY  [author] 25 Sep, 2024 @ 1:42pm 
I’ve never used the sonar tbh. It sounds interesting, I might look into it.

This controller only works when all the radar data is processed at the same time though. That’s why tracks are updated whenever the radar finishes one full sweep. So I’d need to figure out a way to do that with the sonar.
Nick Name 25 Sep, 2024 @ 12:23pm 
Question, would it be possible to make a sonar version of this, since they both output nearly identical data, tho the sonar can't sweep and have limited fov, so it'd be fixed
max70751 3 Sep, 2024 @ 7:45pm 
yup that fixed it, I changed the numbers on the wrong mc. Thanks for the help.
SMITHY  [author] 3 Sep, 2024 @ 7:37pm 
If you add more missiles make sure to change the missile ID in the Missile MC
max70751 3 Sep, 2024 @ 7:25pm 
are there any provisions that i'm missing to fire more than 4 missiles? After firing 4 missiles, the 5th and 6th both go towards the target that the previous 4 missiles attacked, regardless of where i send the 5th and 6th.
SMITHY  [author] 1 Sep, 2024 @ 8:48pm 
Just fixed it, also fixed another issue where the TWS wouldn't work if it was spinning. Should be much better on jets now, you don't have to be still anymore.
SMITHY  [author] 1 Sep, 2024 @ 8:20pm 
I'll try patch it now
max70751 1 Sep, 2024 @ 8:06pm 
Running into an error, "Tick_Failure, 3: attempt to index a nil value (global 'ad'). This seems to happen after i shoot a 2 missiles at a high altitude target, any ideas or is it operator error?
SMITHY  [author] 1 Sep, 2024 @ 5:56pm 
Got carried away and changed a bunch of things, added a single target track toggle option too.
Nick Name 1 Sep, 2024 @ 4:02pm 
Thanks ! Discord is Ceter on the official
SMITHY  [author] 1 Sep, 2024 @ 4:00pm 
You can probably get that working by deleting a few parts of the minified code. I'll send you a message on discord in a few minutes explaining.
Nick Name 1 Sep, 2024 @ 12:16pm 
Ok nvm, lemme rephrase this, each time i press on a target, i want it to constantly output that target's xyz (no need for trigger, and no id system, just a normal tracking radar for firing)
Nick Name 1 Sep, 2024 @ 12:02pm 
Also, if possible, a way to change the scale with an external button
Nick Name 1 Sep, 2024 @ 11:56am 
I love it, however would it be possible to have one that locks an enemy constantly and send the xyz, without the id system, thinking bout making it work with ehcs, the issue is, the more i press space to fire, the more 'id' it makes
VulkanMandenFraSkive 22 Aug, 2024 @ 8:53am 
nice
SMITHY  [author] 20 Aug, 2024 @ 3:03am 
There's a lot of things that need to be redone for this radar system, but I don't really have the motivation to keep working on it though. I'm hoping someone else will come along and completely blow this out of the water tbh.

If you wanted, I could release sections of my code for you or anyone else to improve upon. Just contact me on discord @smithy3141.
zero 19 Aug, 2024 @ 12:59pm 
or to an antenna with the same frequency that the fox1/3 is receiving on
zero 19 Aug, 2024 @ 12:58pm 
just hook the xyz into the hardpoint passthrough
CaneSugar 19 Aug, 2024 @ 10:17am 
have you thought about making a version thats ehcs compatible? so you can load any missle to be fired?
zero 29 Jul, 2024 @ 11:50pm 
depending on the aerial platform i doubt this would be the best system for that, unless its a full size awacs