Page 1 of 1

Tendency display

Posted: Tue Feb 10, 2026 12:28 pm
by Deggial_68
I got bored watching the contents of the tanks to evaluate their trends.
Does it fill up? Does it drain?
So I decided to over-engineer it and create a game logic capable of doing so for me.

I am mostly inexperienced with logic networks and struggled quite a bit with the task, but I finally came up with this solution:



Please tell me what you think about it!
Can it be optimised?

Has it been done already?
I'm sure it has.
But I couldn't find it online.
Besides, where's the fun in that anyway? ;)

(Usage: Connect the module under the power pole to whatever you want to track. The logic is parametrised, so you can choose whatever you want to track. Is there a way to solve this without parametrization?)

Re: Tendency display

Posted: Tue Feb 10, 2026 2:05 pm
by Tertius
You did a direct and simple approach, however you need a large amount of combinators.

If you calculate the raising and falling level every tick, you don't need any memory cell, but you get much noise. So you need some kind of moving average to smooth out noise.

You can use a Kalman filter (linear quadratic estimation) for estimating the raising and falling level within some time interval.
I gave it an interval of 60 ticks (1 second).

The left 2 combinators are calculating the fluid level difference from tick to tick, so we get a positive (raising level) or negative (falling level) number every tick.
The right 3 combinators are the Kalman filter, also known as an improved version of a moving average filter that smooths noise. It averages the differences over time.
02-10-2026, 14-54-45.png
02-10-2026, 14-54-45.png (155.64 KiB) Viewed 229 times

Re: Tendency display

Posted: Tue Feb 10, 2026 3:53 pm
by Deggial_68
Thank you, Tertius, for your reply!

Oh well, I knew there must have been a better approach!
"Direct and simple" you write.
Well, it didn't feel like that to me! :lol:

But as I have solved the problem myself now (at least in principle and I am proud about it), I am glad to use your way better solution with a "Kalman filter" ... whatever this is. ;)
So thank you for sharing!