Stormworks: Build and Rescue

Stormworks: Build and Rescue

Striker Mar 16, 2020 @ 7:58pm
How in the world do you control RPS in a predictable manner?
I have been searching for days now still can't figure this out. As soon as I throttle up the engine up to a certain amount engine just runs off to max RPS. Yes I get that, no resistance and engine will spins to max part, that is fine... I know why it happens.

Question is how do I control this so when my throttle lever is at .5, I get 50% of the max rpm etc...

I tried using a clutch, clutch and gears, aircraft props, screw (boat) nothing seem to put the right amount of load/resistance in the engine.

I have been trying to make an airplane and I am finding only way to get predictable thrust is to control the prop pitch, well I want a fixed pitch propeller plane (not a variable, constant speed prop) and want to control fuel +air to get the rpm (just like in a real plane or a sim).

Is this even possible to do? Any help would be appreciated. Thanks! I am losing my mind over this :sadelf:
Originally posted by Goobs:
LUA is always an option, or you can just be a lazy goof.

Obviously, I take the lazy goof route.

https://steamcommunity.com/sharedfiles/filedetails/?id=2025822007

You can solve this issue with PID's, and if that bothers you there are ways you can hide it, or you can better observe what the PID is trying to do, so you can replicate it otherwise. This little thing will show you how to do all those things.
< >
Showing 1-15 of 15 comments
Nhalok Mar 16, 2020 @ 8:38pm 
You could do this with a PID controller. If you have your throttle control go to an appropriate multiplier and then to the setpoint of the PID you can have the engine vary the throttle to maintain your desired rps.

As an example; if your desired max engine rps was 20, the "appropriate multiplier" would be 20. Selecting 0.5 on your throttle control would go through this multiplier (an f(x) block set to x*20) and yield a 10. The PID would then have its output wired to the throttle and will vary it to maintain its setpoint of 10.

So, to recap. Setpoint should be wired up as described above, output goes to engine throttle, process variable comes from engine rps and you can wire the on/off to either a constant on, a button or even your seats occupied node so it turns on when you get in. Settings I would recommend to begin with would be P 0.1, I 0 and D 0.1.

If everything I have said may as well have been in Greek, post a link to your creation and I will wire it up for you. I hope this helps!
Last edited by Nhalok; Mar 16, 2020 @ 8:40pm
Ra-Ra-Rasputin Mar 17, 2020 @ 2:30am 
A PID controller is often the solution here, but there are also microcontroller solutions that you could use to have much more customizable control than a PID.

The downside of PID is that it struggles for instance remotely controlling a throttle lever if you want a genuine physical representation of the throttle that you can override by hand. You could still use a PID by simply making the throttle lever match the PIDs throttle number of course, but it's quite an amusing coding challenge to actually make it use a throttle lever.

The other downside of PID is that it's hard to comprehend. Often fine tuning a PID is trial and error with what seems like magic numbers. Even if you understand exactly how it works, it's nearly impossible to calculate a solution that would work in most cases.

Otherwise, however, its effectiveness can't really be argued against.
Striker Mar 17, 2020 @ 8:28am 
Thanks guys. This engine running away sounded fun at first but quickly became a chore especially when I got into more advance (not the advance mode) /complicated creations. It's almost like engine has no forces acting on it, as if it is in space withe parts having zero resistance.

I wonder what the thinking behind this was from the developers point of view. Maybe they went for realism but then again, real engines have, friction from oil, metal components, air etc... on top of that there are governors to help with this. (this is me ranting)

Anyways, I will try to figure this PID thing out, it sounds complicated. Thanks again.
Last edited by Striker; Mar 17, 2020 @ 8:29am
Unit 744 Mar 17, 2020 @ 9:33am 
Whenever I have an issue like this, I always make my own micro controller (utilizing LUA if the computations are sufficiently complex). Sure, it takes longer to get a good result than just using someone else's micro controller. The upsides, though, are,

1, you have infinite customization to get the exact behavior you want,
2, the customization is often more intuitive than the PID 'blackbox of magic' or properties boxes of a micro controller you do not understand,
and 3, the behavior is (or can be made to be) more reliable.

An additional upside, if you are a nerd, is that it is a great programming exercise to keep you fresh and on your toes!
Woodspeople Mar 17, 2020 @ 9:43am 
It is also worth adding that the function x/((y*z)+1) works fairly well
(where x = throttle (0-1), y = rps, and z = small multiplier ~0.05)

you can reduce Z to increase rps, or increase it to reduce rps.
Last edited by Woodspeople; Mar 17, 2020 @ 9:44am
Striker Mar 17, 2020 @ 11:10am 
Originally posted by Unit 744:
Whenever I have an issue like this, I always make my own micro controller (utilizing LUA if the computations are sufficiently complex). Sure, it takes longer to get a good result than just using someone else's micro controller. The upsides, though, are,

1, you have infinite customization to get the exact behavior you want,
2, the customization is often more intuitive than the PID 'blackbox of magic' or properties boxes of a micro controller you do not understand,
and 3, the behavior is (or can be made to be) more reliable.

An additional upside, if you are a nerd, is that it is a great programming exercise to keep you fresh and on your toes!


Good to know! Didn't know you can use LUA. Yep I am a nerd I guess, I sit in C# all day :), well guess I can add "LUA" to my resume too :)

Thanks!
Last edited by Striker; Mar 17, 2020 @ 11:10am
The author of this thread has indicated that this post answers the original topic.
Goobs Mar 17, 2020 @ 4:54pm 
LUA is always an option, or you can just be a lazy goof.

Obviously, I take the lazy goof route.

https://steamcommunity.com/sharedfiles/filedetails/?id=2025822007

You can solve this issue with PID's, and if that bothers you there are ways you can hide it, or you can better observe what the PID is trying to do, so you can replicate it otherwise. This little thing will show you how to do all those things.
Striker Mar 17, 2020 @ 4:59pm 
Originally posted by Goober Noopydoops:
LUA is always an option, or you can just be a lazy goof.

Obviously, I take the lazy goof route.

https://steamcommunity.com/sharedfiles/filedetails/?id=2025822007

You can solve this issue with PID's, and if that bothers you there are ways you can hide it, or you can better observe what the PID is trying to do, so you can replicate it otherwise. This little thing will show you how to do all those things.

That is very generous of you, thank you, I will try that out now.
Striker Mar 17, 2020 @ 5:24pm 
[quote=Goober Noopydoops;1870622978438430504
Obviously, I take the lazy goof route.
[/quote]


Works like a dream, you sorted out my problem. I have been playing with the PID but couldn't get it to work, your creation helped me realized it actually needs to be powered on with a switch :steamfacepalm:

I guess I am a lazy goof before a nerd... Really all I wanted to do was just control the throttle, this should carry me though the next few ours.

Now I have to figure out why my float plane doesn't come off the water, seems too much drag... but... thats a discussion for another thread!

Thanks again!
Last edited by Striker; Mar 17, 2020 @ 5:27pm
Ra-Ra-Rasputin Mar 17, 2020 @ 5:51pm 
It's a question of drag, lift and direction of thrust!
In Stormworks' Bullet, like in just about every other physics engine, water is jello gunk when it comes to drag. A bullet-shape pontoon has a lot of drag, when you can get away with a wide ski instead.
Striker Mar 17, 2020 @ 7:40pm 
Originally posted by Ra-Ra-Rasputin:
It's a question of drag, lift and direction of thrust!
In Stormworks' Bullet, like in just about every other physics engine, water is jello gunk when it comes to drag. A bullet-shape pontoon has a lot of drag, when you can get away with a wide ski instead.

Well this is what I have: https://steamcommunity.com/sharedfiles/filedetails/?id=2025922711
flies nicely off of a runaway but, a brick in water.
Ra-Ra-Rasputin Mar 18, 2020 @ 4:14am 
Here you go

https://steamcommunity.com/sharedfiles/filedetails/?id=2026179080

There's a button inside there that enables the assist flaps for taking off, and landing in water. When taking off water do not enable the flaps for the plane. Simply glide along the surface and pick up speed until you can pull up. It should do so naturally once you reach high enough speed.

I also tuned your engines to provide more power for no extra fuel cost. You probably have to adjust the sensitivity of the controls and the trim quite a bit. I made some tweaks to make testing much quicker like hardwired the throttle to 1.

I sealed your cabin with doors and a hatch on top. The hatch is more for emergency use than entry, but it's useful if you land in water so you don't flood the cabin.
Last edited by Ra-Ra-Rasputin; Mar 18, 2020 @ 4:15am
Striker Mar 18, 2020 @ 7:14am 
Originally posted by Ra-Ra-Rasputin:
Here you go

https://steamcommunity.com/sharedfiles/filedetails/?id=2026179080

There's a button inside there that enables the assist flaps for taking off, and landing in water. When taking off water do not enable the flaps for the plane. Simply glide along the surface and pick up speed until you can pull up. It should do so naturally once you reach high enough speed.

I also tuned your engines to provide more power for no extra fuel cost. You probably have to adjust the sensitivity of the controls and the trim quite a bit. I made some tweaks to make testing much quicker like hardwired the throttle to 1.

It swims and flys now! I tried those fins too but I placed them downwards and then set the constant value to make them angle.. I guess I had to place the towards the direction of travel.

I sealed your cabin with doors and a hatch on top. The hatch is more for emergency use than entry, but it's useful if you land in water so you don't flood the cabin.


Yeah, when I built this my tech level didn't have those doors.

Thanks for your help! I have yet to understand physics in this game, it seems this game has very minimal/simple aerodynamics. I am used to playing Kerbal Space program with mods which give pretty decent physics.
Ra-Ra-Rasputin Mar 18, 2020 @ 7:34am 
The physics is actually more complex here, it's just that its interpretation of air is significantly more thick, which means physics behave differently.

In Kerbal, even with FAR, you won't have body lift, you have to have specific lifting surfaces. In Stormworks you can make a plane without wings just fine, so long you have some way of controlling it to keep it in balance.
Last edited by Ra-Ra-Rasputin; Mar 18, 2020 @ 7:37am
Originally posted by Woodspeople:
It is also worth adding that the function x/((y*z)+1) works fairly well
(where x = throttle (0-1), y = rps, and z = small multiplier ~0.05)

you can reduce Z to increase rps, or increase it to reduce rps.



Late to the party, but yeah...

This is a good fuction, but i found it to limit the overall power too much, or too less depending on the multiplier.
If you combine this with a conditional, it kinda works, though.

What I did:
Created an input signal for the clutch, because I was using two separate microcontrollers for engine and throttle (optional).

If RPS is GREATER than (my case: 15) AND if Clutch signal is LESSER than (my case: 0.1), a numerical switchbox can signal the function above to kick in with a multiplier even greater (my case: 1.5).

It's not smooth, but it is a way to turn on an idle mode without the need of a direct player action.
< >
Showing 1-15 of 15 comments
Per page: 1530 50