Stormworks: Build and Rescue

Stormworks: Build and Rescue

Rhodusite Apr 9, 2020 @ 10:43pm
How to calculate fuel consumption
It's super easy! For everyone who does't know. You take the delta of your fuel consumption, and divide it by your RPS, the smaller your final number, the better! if you want an example of this in game let me know.
< >
Showing 1-15 of 18 comments
Ra-Ra-Rasputin Apr 10, 2020 @ 1:09am 
...but your fuel consumption is already the delta of your fuel tank. Dividing it by RPS only gives you a division of your fuel consumption based on the RPS of the engine.

If you want relatively accurate data on fuel consumption, you multiply the delta by 60 to get a consumption rate by second, or 360 to get it by the minute.

If you want actually accurate and readable figures with high response rate and no excessive feathering, you average the delta of your fuel tank across 10 ticks and multiply that by 6 for 1s rate.

If you want fuel consumption based on distance travelled, you need to look at your m/s figure and time. You can look at the consumption rate during 100m of travel and extrapolate your range from there.

If you want the most accurate figures, you take the value of the fuel tank into memory, and compare that value to the fuel tank 1 minute later. It's not responsive, but it's easy and accurate.
Jorg Hammond Apr 10, 2020 @ 4:59am 
That's convenient, I was recently wondering how one would go about this.

Averaging a value over time (not only fuel delta but also speed) would imply some logic shenanigans with memory and timer modules I assume ? I've toyed around this a bit before collapsing out of confusion.

I had a main 60s timer to start and stop the whole process, was reading the amount of fuel at start and finish, and was trying to average speed at regular intervals with a sub clock triggering each x ticks to try a get a reasonably accurate figure for the final calculations, but totally failed at that last part.

I guess I could figure it out of my own if I spent enough time on it, but I could certainly use some pointers on how to implement the thing.
Last edited by Jorg Hammond; Apr 10, 2020 @ 5:02am
Ra-Ra-Rasputin Apr 10, 2020 @ 6:21am 
Yes, to average a value, simply do a looping add on a memory, then divide that memory on the amount of ticks that have passed.
You can also do this math by seconds, but it's significantly slower as a result. The lowest clocktime is 0.1/s while ticks are 1/60s.
Last edited by Ra-Ra-Rasputin; Apr 10, 2020 @ 6:21am
Rhodusite Apr 14, 2020 @ 7:53pm 
Dividing the delta of your fuel consumption by your RPS negates the increase in consuption by increase in explosions per second, leaving ONLY the efficiency of the engine at any given RPS. I will show example in next post.
Ra-Ra-Rasputin Apr 15, 2020 @ 2:07am 
Yeah, that's what we call a magic number. It means it's just whipped together to get a desired value or function out. The actual fuel consumption is just the delta value.
DoNotPanic Apr 15, 2020 @ 2:24am 
it's wrong to use RPS because you also should take into account throttle (how much fuel burns each cycle).
I used calculated from fuel deltas after each own tick (10 seconds)
https://steamcommunity.com/sharedfiles/filedetails/?id=2042470052
agrimes Apr 15, 2020 @ 7:00am 
Here's my implementation, I just add the deltas into a memory register and then dekay it at 1/60th of a second... It would be interesting to check this method against your methods...

https://steamcommunity.com/sharedfiles/filedetails/?id=2042688612
Rhodusite Apr 15, 2020 @ 2:25pm 
I never though about that, taking into account the throttle, cause it's not just more RPS, its also more fuel being injected into each cylinder!
Rhodusite Apr 15, 2020 @ 2:27pm 
I'm trying to figure out the most efficient RPS for each engine, the general rule of thumb ive found is that they all seam to be most efficient at 7.25 RPS
Ra-Ra-Rasputin Apr 15, 2020 @ 2:29pm 
Not for their power or torque output. According to the graph i currently have, 8.32 RPS seems to be a relatively exact sweet spot for the small diesel, but it is absolutely different for medium, which i have not completely mapped out yet.

If i go by lerping the values, it should be around 10.2
Last edited by Ra-Ra-Rasputin; Apr 15, 2020 @ 2:30pm
Rhodusite Apr 15, 2020 @ 2:31pm 
I mapped it for the large, i think i'm remembering incorrectly and it is actually 8.25 that the sweetspot is at.
agrimes Apr 15, 2020 @ 5:11pm 
I'd been using 7.5 rps based on generator tests. It could be different for direct drive applications, if so this could be a very interesting insight!
Johannes Apr 16, 2020 @ 3:25am 
If I'm not completely wrong, you only meed to connect the fluid value to a PID, with P=0,I=0,D=1 to get the flow. This is due the derivative value of the tank gives the speed (fuelflow) . Another PID with same setting will give acceleration og fuelflow.
Rhodusite Apr 18, 2020 @ 12:40pm 
:O huh?
< >
Showing 1-15 of 18 comments
Per page: 1530 50

Date Posted: Apr 9, 2020 @ 10:43pm
Posts: 18