Colored gauge with small combinator footprint

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Tertius
Filter Inserter
Filter Inserter
Posts: 991
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Colored gauge with small combinator footprint

Post by Tertius »

Here is my version of a red/yellow/green colored gauge to visualize something like steam level or accumulator charge.

I only found gauges with huge amounts of combinators, so I tried to make one with less. Part of the logic works by exploiting the hardcoded Factorio color priority.

In the arithmetic combinator, set the input signal. For the picture below, that would be A for accumulator charge. In the blueprint it is steam Image.
And in the constant combinator set the scale with signal S. Set it to the maximum expected value divided by 10, that would be 100/10 = 10 for accumulator charge or 25000/10 = 2500 for a steam storage tank.

An additional feature is the overflow color: If the maximum amount is exceeded, the color of the whole gauge changes to the overflow color defined in the constant combinator. In the blueprint, it is cyan. If you don't define any, the gauge becomes white, and another interesting overflow color is magenta. You cannot use blue, because this will overwrite the yellow part.
2022-09-12 18-36-01 start=1 length=37 fps=15.gif
2022-09-12 18-36-01 start=1 length=37 fps=15.gif (2.34 MiB) Viewed 2177 times
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Colored gauge with small combinator footprint

Post by FuryoftheStars »

Hey, thanks for sharing this! I've attempted something like this a couple of times and then just gave up, so this will be helpful. :)
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Amarula
Filter Inserter
Filter Inserter
Posts: 552
Joined: Fri Apr 27, 2018 1:29 pm
Contact:

Re: Colored gauge with small combinator footprint

Post by Amarula »

Nice!
My own personal Factorio super-power - running out of power.
Tertius
Filter Inserter
Filter Inserter
Posts: 991
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Colored gauge with small combinator footprint

Post by Tertius »

Sorry to bother you, but i managed to shave off one more combinator from the setup:

2022-09-13 15-50-14 start=1 length=38 fps=15.gif
2022-09-13 15-50-14 start=1 length=38 fps=15.gif (2.18 MiB) Viewed 2126 times


You set the input signal in the bottom combinator and the scale in the constant combinator.
The overflow color needs value 12+ in the constant combinator, otherwise overflow is white.

It's a different approach. First, it scales to 0..10 as before, and the lamps are each enabled on 0..10 as before.

Now, the 3 colors (red, yellow, green) get values from the constant combinator. Each get their max value + 1. The top combinator subtracts the scaled value from these, so we get 0 or negative value for each color that should not be active. Negative values are ignored by the lamp color logic, so it is as if they have no signal.

The green color gets special treatment: since it has hardcoded priority over yellow, its value must be filtered as long as there is yellow to display. This is done by the middle combinator. Green is always >= 6 as long as yellow should be displayed, so < 6 is our filter criteria. This way green is subtracted along with the others and reach 0 if the gauge overflows, so the overflow color is the only color left if set to 12+. If it overflows by more than 10%, you need to set a higher number than 12, otherwise the gauge gets white, which is the ultimate and final overflow color.
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Colored gauge with small combinator footprint

Post by FuryoftheStars »

One thing that's always bothered me a little about gauges is that as the level runs down, especially once it turns red and is only a light or two left, it's harder to see. I know attaching a siren could help, but what would it take to:
  1. Make it so when the lamps turn red they also start flashing, and/or
  2. Instead of having all the lamps go dark when the level is low enough, have them all light red, and potentially flash?
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
aka13
Filter Inserter
Filter Inserter
Posts: 821
Joined: Sun Sep 29, 2013 1:18 pm
Contact:

Re: Colored gauge with small combinator footprint

Post by aka13 »

FuryoftheStars wrote: Tue Sep 13, 2022 3:59 pm One thing that's always bothered me a little about gauges is that as the level runs down, especially once it turns red and is only a light or two left, it's harder to see. I know attaching a siren could help, but what would it take to:
  1. Make it so when the lamps turn red they also start flashing, and/or
  2. Instead of having all the lamps go dark when the level is low enough, have them all light red, and potentially flash?
I used flashing red, works good.
Pony/Furfag avatar? Opinion discarded.
Post Reply

Return to “Combinator Creations”