r/factorio•
Add32

color of lamps

Suggestion / Idea

Currently the lamp colors apear to be in a hard coded order

1 blue and 100k yellow -> blue lamp

It would be great if we could color lamps based on signal strength or a combination of red green and blue signals.

1 blue and 100k yellow -> yellow lamp

or

255 blue 255 green -> yellow lamp (255,255,0)


ive been working on a screen/gpu in factorio and would love to be able to more precisely determine the color through the circuit network.

Posted Oct 5, 2017, 7:56 AM UTC

1913
teagoniawhats fast or express?•

Me too, currently it displays the color which signal is furthest left in the gui. So if you have any color and red then red will be displayed

7
SoundsOfTheWild•

Couldn't you use a combinator (or a few, depends on how many signals you're looking to combine) to do it?

2
TheSkiGeek•

Yes, although it would make the overall number of combinators needed much higher.

4
SoundsOfTheWild•

If you knew in advance which resources the lamp was monitoring though you could set it up fairly simply. I think it's a reasonable solution

1
Add32OP•

I was building a screen and gpu, right now I can use ~6 gates for 18 lamps (one column on the screen) which is pretty good for a solution with a double buffer.

For simple resource monitoring the current lamps are fine, I just wanted a bit more rgb in my gpu/screen

1
TheSkiGeek•

The problem is having to compute things like "if red and green are present, output yellow" for all six color combinations.

It feels like it wouldn't be too hard for them to have a mode for lamps where you input values from 0-255 on the red/green/blue signals and it glows that color... they must already be doing some logic to look at which color signals are present, that mode could be branchless logic in code.

1
Add32OP•

Using the max value to determine color is slightly harder than what appears to be a simple case statement.

With rgb instead of using all color signals just use red green and blue, and forward the clamped values to the gpu. As someone who's done opengl code and used allegro (windowing/event/sound system factorio uses) this might almost be simpler than the case system.

Example

If(redSignal>0){lamp.displayColor(255,0,0)}
else if(blueSignal>0){lamp.displayColor(0,0,255)}
 Ect...

Vs

lamp.displayColor(redSignal,greenSignal, blueSignal)
1
Ozyton•

It'd be great if we could just color lamps like we can color train stations and trains etc.

2
Add32OP•

Hopefully via circut conditions, thats what makes lamps special

1
fishling•

Please note that the color signal value is not currently relevant to any color decision, so this would be a breaking change. If you send a red signal of 1 and a blue signal of 100, the lamp color will still be red. This is actually useful as it means that lamp colors can be used independently of conditions; there is no need to convert all signals to colors first. I could see it being useful if the magnitude of the signal was used to determine the color, but I do not think I'd want the input signal to be interpreted as RGB values...or at least not ONLY as RGB values.

2
lemtrees•

Lamps could have a GUI setting where you could set the default color similar to trains/stations, or click one of the default colors that already exist. They could/should also have a setting for connecting to the circuit network such that you can choose between the displayed color being the aggregate sum of the RGB of the existing circuit's color signals, or the strongest, or the weakest (non-zero) color signal.

1
bripi•

Or, use Darkstar. That tech is fkn awesome!!

1