Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
Number Averager and Gauge Damper
   
Award
Favorite
Favorited
Unfavorite
Vehicles: Mechanical
Tags: v0.10.24
File Size
Posted
Updated
20.921 KB
18 Jun, 2019 @ 10:24am
18 Jun, 2020 @ 10:11pm
3 Change Notes ( view )

Subscribe to download
Number Averager and Gauge Damper

Description
Now updated to use LUA

Damps out jittery dial readings and averages out fuel tank slosh so you can can get accurate readings even in heavy seas. Ideal for range and fuel consumption calculations where a stable and accurate fuel reading is essential.

Simply place the block, connect a number input, number output, and select the time you want to average over with the property slider.

1 second will often be enough to damp out a jittery, unreadable dial. 60 seconds is enough to compensate for the fuel tank slosh as your boat rolls in the waves.

(Technical)

This controller outputs the running mean average of the input over a given number of seconds.
It uses a lua table to do this, and records every single value over that time frame, so there is no sampling error.
It follows the game's convention of one second being equal to 60 logic ticks. Depending on how your game is running, this may or may not correspond to realtime seconds.
If you replace the property slider with any other number source, it will still work, however very large numbers could eventually slow the game down.

2 Comments
NosamCrunch 31 Oct, 2021 @ 9:19am 
I tested it, sadly it does not. It just changes the interval that the surfaces shake at.
NosamCrunch 31 Oct, 2021 @ 8:47am 
would this work for preventing a gyro from shaking the control surfaces?