Stormworks: Build and Rescue

Stormworks: Build and Rescue

25 ratings
Multi-turret aiming system
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
394.143 KB
20 Feb, 2023 @ 12:29pm
20 Feb, 2023 @ 1:15pm
2 Change Notes ( view )

Subscribe to download
Multi-turret aiming system

Description
Description


This is a system I built for my miniature soon-to-release battleship that is designed to mimic World of Warships controls. It's almost identical to the game with the exception that the camera doesn't track the target, and that the distance to target needs to be set manually. For those unfamiliar with WoW, read on for a description of what this thing does. It's best suited for warships, although can probably be used for other vehicles, too.

Note that this stand is only an example structure designed to show a functional setup. Also, make sure to watch the video I added if you intend to use this system.

Features


- Turrets follow the camera
The first challenge I ran into with my battleship is that when spawned, turrets point into different directions, but need to aim in one direction when firing. With this system, all you need to control is where the camera is looking, and the turrets will follow.

For the vertical axis rotation, this system relies entirely on velocity pivots, meaning it's not an issue if the camera rotates in one direction too much. You can also set manual limits so that the turret doesn't bump into decor/superstructure when turning.

- Adjustment for turret placement
Even when all the turrets point in one direction, there's another issue - relative distance between them. If it's not addressed, the shells will land as spread out as much distance there is between turrets. They need to not only point in one direction, but at a single point, and this system does it for you. Set all the necessary data in MCs settings, adjust the range after spawn, and the turret computer will compensate for its relative placement, ensuring best precision.

- Adjustment for camera placement and ballistics
The best spot to place a camera on a battleship is on top of its superstructure. But turrets tend to be a lot lower, and that can throw off accuracy. Similarly to horizontal distance from the camera to turrets, vertical distance is taken into account, too, as well as ballistics. If the distance to target is set correctly, regardless of how close or far away the target is, the shells will always land at the point in the middle of the screen that shows what your camera sees.

- Vertical stabilization
This is the first time I tried implementing vertical stabilization, so it's likely far from perfect, but it still provides some very decent assistance on waves. Certainly better than nothing... right?

- Loaded/aligned indicators
Turrets will not shoot if they're not aligned/cannot align with the camera, or if they're still reloading, where the reload time can be easily adjusted. Same goes for rotation speed, which can be easily adjusted, too. All to best mimic the real counterparts of your historical builds.

Credits


Shoutout to Subru701 who has motivated me to develop and continuously improve this system

Regarding credits: I won't bite if you don't credit me, albeit I'd appreciate it if you did. More than that, I'd love to see what cool builds you end up using this for!

Another note: I discovered that when I play in multiplayer, my ship's guns which use this system will align properly, but the actual MC will only detect that they've aligned with the camera and are ready to fire with as much as a 30 second delay, which doesn't happen in singleplayer. This feature is intended to prevent guns that are not aligned from firing somewhere else, potentially at a friendly. If you encounter this behavior as well, please let me know, I need more info to fix this.
14 Comments
OverSavior  [author] 15 Sep, 2024 @ 10:04am 
Sorry, I've been away from this game for so long now that I won't be able to help
!GoogleTime34! 15 Sep, 2024 @ 8:54am 
also is there a way to change the ballistic from LA to Artillery cannons
!GoogleTime34! 15 Sep, 2024 @ 8:36am 
hey me again ive figured out the turret distancing for a newer project. but is there a way to compensate for turrets who are on barrettes and are higher that the others? thanks
OverSavior  [author] 11 Aug, 2023 @ 3:06pm 
What do you mean by different placement specifically? Are the turrets offset from the middle? Or just that they are further away/closer to the camera? It should work properly if you set the right distance. You can message me on Discord if you like, I'll take a look (it's on my profile)
!GoogleTime34! 11 Aug, 2023 @ 11:37am 
ive been trying to use this but my ship has different turret placements so i change that distance and the turrets are why off
OverSavior  [author] 15 Jun, 2023 @ 9:37am 
Glad that you found it useful! It's been a while since I played the game and have mostly forgotten how it works lol. There's still an unresolved issue with this system that it has a crazy long delay in multiplayer, even though it's not supposed to (meaning it's most likely a game bug).

I have however used it to implement secondary guns on my miniature Kongo. The ship isn't finished, so I haven't published it yet, but you can look at how those side turrets are set up. Maybe that'll help: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2936250144
XSY炮灰羊 15 Jun, 2023 @ 7:20am 
Amazing!! Very useful, I finally have a good way to control multiple turrets. This problem has troubled me for two years, and I have studied it for dozens of hours, but I haven't come up with a useful method. Now that I finally have a solution to it, I am really happy and thank you very much.

But is there any way to provide angle restrictions for the turret placed in the middle of the hull? Similar to the torpedo launch tube of WWII destroyers or the third turret of Fletcher-class destroyer. They both have restricted areas in front and behind them, requiring two restricted areas. I have been thinking for an hour but have not come up with any good solutions yet.
Bro 15 Mar, 2023 @ 1:47am 
Brilliant. Thanks.

The way i've been aiming the turrets using a director was through a tedious check for the smallest angle of rotation, in a lua script.
Time to simply use a PID!!!
OverSavior  [author] 1 Mar, 2023 @ 6:29am 
Comodofan55, I think it should work with any kind of turret, although for an aircraft I imagine you'd have to ditch the part of it that adjusts for range to target, and just leave the part that orients guns in the same direction as the camera
OverSavior  [author] 1 Mar, 2023 @ 6:28am 
Ab gamer_33, I appreciate the invite, but I'll pass. Don't have a lot of time to play multiplayer nowadays