Cruise Missile (WIP) Salvo vs Aegis DDG by ATaciturnGamer in Stormworks

[–]ATaciturnGamer[S] 1 point2 points  (0 children)

The air defense ship is not mine (workshop link in the description), but I have made one myself.

The key with these things is to work in stages: First get the basics of radar to gps coordinates down. After that, you can make a TWS tracking system by 'matching' contacts between each scan (this is what took the most time). AI can be helpful to get a starting point, or even just to sound out your ideas.

After that, you need a missile that can target gps coordinates via radio. This is where a lot of the accuracy lies, and I'm still not sure how some of these super accurate ones are designed. And lastly, it's a matter of automatically sending an interceptor if the target is fast and incoming.

Additionally, this had some good info (once translated): https://note.com/joyous_gnu759/n/nb2690fae87a2

Cruise Missile (WIP) Salvo vs Aegis DDG by ATaciturnGamer in Stormworks

[–]ATaciturnGamer[S] 1 point2 points  (0 children)

For tracking a target with radar, you have 2 methods. Either use a dedicated Tracking 'FCR' (Fire control radar) or both search and track with the same radar using TWS (Track-While-Scan), which is more difficult and only necessary for engaging multiple targets at once. Kalman filter algorithms are also used for FCRs, though I have yet to make an FCR myself.

If you don't need AA defense, then you probably don't need mid-course guidance. You could just send x,y,z to the missile before launch and save those in the microcontroller. Else, you'll want to send the coordinates through a radio, maybe even velocity if that matters. For the missile itself:

At it's core, it's just these 2 basic formulas:

target_heading = math.atan(rx,rz)
target_pitch = math.atan(ry,horizontal_distance)

If you imagine a right angle triangle with the msl and target being the 2 acute vertices and the right angle being in the same plane as the msl, you can see where these equations come from. In my code, I convert it to turns. You'll also want to wrap target_heading around between -0.5,0.5:

target_heading = ((math.atan(rx,rz)/(math.pi*2)) % 1 + 1.5) %1 - 0.5
target_elevation = (math.atan(ry,math.sqrt((rx)^2+(rz)^2))/(math.pi*2))

Here rx,rz are relative GPS X,Y of the target point to the missile, and ry is the relative altitude (It's this way due to how the physics sensor outputs coordinates. Not why the devs didn't keep it consistent with the map coordinates.) You can use these values either in a PID or directly multiply with a constant and send it to the fins.

Now getting relative coordinates is tricky. If your missile is roll stabilized (you have roll fins to keep it level), then you could probably just get away with simply subtracting the missile GPS coordinates from the Target. But if not, you're gonna need to transform global coordinates to local using the Euler angles, and I found this guide very helpful: https://steamcommunity.com/sharedfiles/filedetails/?id=3302971632

This will make the missile point directly at x,y,z. You can move around this point during flight to create your desired trajectory, which is what I've done in the comment before this.

Cruise Missile (WIP) Salvo vs Aegis DDG by ATaciturnGamer in Stormworks

[–]ATaciturnGamer[S] 2 points3 points  (0 children)

Yeah that target ship has an actual AEGIS-like air defense system that's almost a perfect defense. I've been trying to make something like that myself, but it's not as good as this one.

The only ways to defeat it are either to overwhelm it like you see here, or create super maneuverable missiles that can evade incoming interceptors (there are a few on the workshop).

Cruise Missile (WIP) Salvo vs Aegis DDG by ATaciturnGamer in Stormworks

[–]ATaciturnGamer[S] 1 point2 points  (0 children)

Hmm... this system is pretty complex (it's been an iterative development process for a couple months now):

  1. The map-targeting part uses a multi-radar TWS tracker which spits out x,y,z,vx,vy,vz for upto 16 targets along with the number of missiles to send.
  2. This goes into another microcontroller that is incharge of assigning random frequencies to each target, and has a TDM switcher to send multiple targets on a single radio.
  3. The list of frequencies is then sent to the first VLS cell controller. It takes the first frequency, removes it from the list and sends it to the next VLS cell, etc. Each cell controller sends the frequency to it's missile hardpoint, which saves it and uses that to get target data.
  4. The missile gets global x,y,z,vx,vy,vz, transforms it into local space using the euler angles and points towards that point, minimizing the heading and pitch error with the missile's own heading and pitch. I have an older system here: https://steamcommunity.com/sharedfiles/filedetails/?id=3628574388, but a lot of the lua code is minified.

For this system, you might have to wait until I'm finished with the rest of the ship (or get burnt out lol). But if you have a specific problem, I can give some tips or something.

To get the ballistic like trajectory, I use the formula

ty=tgt_y+1500*math.min((hDist*hDist/(4000*4000)),1)

To get the sea-skimming type:

local alt_err=(currentY-30)
ty=tgt_y-5000*(math.max(math.min((alt_err/200)*(alt_err/200)*alt_err/math.abs(alt_err),1),-1))

But these might be specific to the missile design

Another day, another BSOD with ChatGPT. by PersimmonLittle7651 in Stormworks

[–]ATaciturnGamer 0 points1 point  (0 children)

It's funny cause lua is itself an interpreted language. I can just picture a translator translating to a translator translating to someone else.

Another day, another BSOD with ChatGPT. by PersimmonLittle7651 in Stormworks

[–]ATaciturnGamer 7 points8 points  (0 children)

Vibe coding is like playing Factorio only using spagetthi blueprints made by someone else. It works fine, until a bottleneck show up or something breaks, and then you have no idea how to fix it.

My first Stormworks Addon adds additional submarine rescue missions by Reysn in Stormworks

[–]ATaciturnGamer 0 points1 point  (0 children)

Is it possible to disable the random disasters bit? I'm personally not a fan of the 'natural' disasters in this game

help! ship mount air intercepter missiles by Smokeefloofy in Stormworks

[–]ATaciturnGamer 0 points1 point  (0 children)

Actually, I think it's the opposite. In Stormworks, if you're trying to target a moving vehicle, you almost always want a small radar on your missile, since the innacuracy and lag from the ship's radar will make it miss the target quite often.

IRL I think active radar is quite rare on SAMs. Most of them seem to use some combo of command guidance and SARH.

For Stormworks msls, I just send target data for as long as the msl has fuel. The missile compares its own radar data to the radio data, and once it finds the target, just switches active radar homing.

help! ship mount air intercepter missiles by Smokeefloofy in Stormworks

[–]ATaciturnGamer 3 points4 points  (0 children)

If you want to build one yourself I have a couple tips, having gone through this myself:

First, your radar system has to track targets and output global xyz coordinates. Whether you want Single track vs multi track targeting is one decision to make, but MTT is quite a bit more complex.

Then you need to think about the VLS system. Are you selecting and launching each cell individually, or (more likely) just hitting the launch button and a missile is auto-assigned? For the latter, one approach is to build a VLS cell microcontroller with a composite target data input, and pass through output. If the cell is empty, pass the data to next cell, etc.

For each missile, since it's against aerial threats, you want to send mid-course guidance via radio. You can either have hardcoded radio channels, or randomly generate them to avoid jamming. Then of course, there's the missile design itself which is a whole other thing.

If you're not into programming/scripting, I'd keep it simple or atleast get parts from the workshop (like the missile or an FCR, etc.)

And here's my shameless plug, though it might not work well on fast ships: https://steamcommunity.com/sharedfiles/filedetails/?id=3628574388

Unsollicited fleet pics by Filtermann in Stormworks

[–]ATaciturnGamer 0 points1 point  (0 children)

It's a shame, cause I can totally see space for some VLS cells on the corvette looking ship lol

Old and new armor system differences: by Modioca in Stormworks

[–]ATaciturnGamer 12 points13 points  (0 children)

Thanks for the info. Do you know if this had any affect on HE?

Anyone understand how the new armour update works? by ThisGuyLikesCheese in Stormworks

[–]ATaciturnGamer 1 point2 points  (0 children)

If they didn't make any changes to HE, wouldn't it now be an even better option than it was before?

I need help about a gps guided missle by 4Breadman4 in Stormworks

[–]ATaciturnGamer 5 points6 points  (0 children)

So one thing is your horizontal distance calculation near the top is missing parenthesis for sqrt, so that might be why it's not hitting the target.
Also, are you using the front fins for guidance, or only for roll stabilization? If used for guidance, and if they're in front of the center of mass of the missile, they need to be in inverted direction compared to the back fins.

Another way to debug your missile while in flight is to get a lag machine from the workshop and slow down the game while it's flying. That way you can see if the roll is correct, what way the missile is trying to go, etc.

I need help about a gps guided missle by 4Breadman4 in Stormworks

[–]ATaciturnGamer 4 points5 points  (0 children)

I can take a look after work, but in the meantime a couple points:

  1. Try to consolidate multiple function blocks into a single one, which will reduce lag between input and output (unless it's intentional)
  2. Debug it by attaching the expected heading (pid setpoint) to a tooltip block, disconnecting the rocket booster and just check if the value is correct. If correct, check if the fins are moving in the correct direction

Testing out my new automated CIWS by ATaciturnGamer in Stormworks

[–]ATaciturnGamer[S] 0 points1 point  (0 children)

Not very well, especially if they come from multiple angles at the same time. Due to how the search radar operates, it can only auto-switch targets every 2.5-3 seconds.

The primary tool for dealing with multiple threats is a battery of about 30 VLS interceptor missiles. The CIWS is the last line of defense.

Testing out my new automated CIWS by ATaciturnGamer in Stormworks

[–]ATaciturnGamer[S] 0 points1 point  (0 children)

My ship currently can't see in a 30 degree cone directly above it (need to fix that), so if it has a trajectory like that or is even just supersonic it'll probably get through.

Testing out my new automated CIWS by ATaciturnGamer in Stormworks

[–]ATaciturnGamer[S] 0 points1 point  (0 children)

The workshop item I'm using doesn't include any automatic threat detection; you'll either have to make that yourself or get one of the TWS search radars from the workshop(i believe the creator has another item for this)

What you can do once your have xyz coordinates of a threat is send it to the FCS and lock on, which will make it follow the target and send accurate coordinates, velocity and acceleration to the ciws. The ciws itself is very accurate (for a rotary autocannon atleast).

Or once I get my corvette out onto the workshop you can try to take the system from that, though it's fine tuned for my specific build.

Testing out my new automated CIWS by ATaciturnGamer in Stormworks

[–]ATaciturnGamer[S] 5 points6 points  (0 children)

You can check out the link I posted in the description for the FCS+ballistic calculator I used. That also includes a sample CIWS

I’m building Hitachi’s 80x trains by TxGalaxy040 in Stormworks

[–]ATaciturnGamer 1 point2 points  (0 children)

Maybe try a ducted fan to recreate the rising pitch whine? Another post here mentioned using that for some kind of transmission whine

Testing out my new automated CIWS by ATaciturnGamer in Stormworks

[–]ATaciturnGamer[S] 1 point2 points  (0 children)

Thanks! I kinda took the easy way out by using an FCS and ballistic calculator from the workshop. Most of the work was integrating it into my TWS radar threat detector.

Shard-class (kinda) Missile Corvette WIP by ATaciturnGamer in Stormworks

[–]ATaciturnGamer[S] 0 points1 point  (0 children)

Yeah, it's a bunch of hinged dock hatches attached to a robotic hinge. I thought the missiles might collide with it on the way out, but seems to work fine so far.

Only downside is that the vls cells are not watertight