Page 1 of 1

Plot of stored resources over time using lamps

Posted: Tue Oct 06, 2015 10:06 am
by British_Petroleum
Factorio Signal Graph.jpg
Factorio Signal Graph.jpg (253.47 KiB) Viewed 10978 times
This design uses a clever combination of lamps, combinators, smart inserters and smart chests to plot a signal over time on a screen using lamps as pixels.

In the image, the input signal is the amount of iron ore in a chest being filled up by a mining drill. As you can see it is going up over time, until it suddenly drops, which is when i took some iron ore out of the chest, then it continues to go up. The far most right column of pixels shows the amount of iron ore in the chest at the present time.

This design would be really nice to have in a real game. For example, you could have it display your iron in storage, so you could see how your stored iron has changed over time.

You can adjust the scale of both the vertical axis and the time axis! using 2 constant combinators. In the photo, the plot is using a linear scale, but you could use a logarithmic scale instead by changing the multiplication constants in the right most column of arithmetic combinators.

The way it works is by having a corresponding smart chest for each pixel. If there is a piece of concrete in the chest then the corresponding pixel lights up. On each clock cycle, the smart inserters move any concrete in the chests one chest to the left. Hence, slowing down the clock cycle increases the scale of the time axis. Logistic bots collect the concrete once it reaches the end and deliver it to the start of the chain, however you could use belts instead.

Limitations
I couldn't get any more than 14 pixels in the Y-direction (vertical) because the red/green wires wouldn't stretch far enough. However, there is no limit to the number of pixels in the X-direction. The refresh time can't be too quick or the green inserters cant keep up, however longer refresh times are more practical because you can see what the signal has been doing over a longer time frame. It is also difficult to power all the lamps because there is no room for power poles. I had to use bob's mk4 substations. Probably the biggest limitation is that it doesn't work properly if you have any inserter stack size bonuses, although there may be ways around this.

Re: Plot of stored resources over time using lamps

Posted: Tue Oct 06, 2015 2:32 pm
by darksparks
amazing! very well done!

Re: Plot of stored resources over time using lamps

Posted: Tue Oct 06, 2015 3:43 pm
by Gus_Smedstad
That's interesting stuff. I should point out that you should be able to replace the smart chests and inserters with combinator setups. That's why you see discussion of combinator-based memory cells, they're the basic building blocks for more interesting projects like this. You only need one memory cell per column, since the memory cell stores the value rather than 0 or 1, and you compare the value at the lamp to decide if it's on or off. This avoids issues with inserter stack size bonuses.

Re: Plot of stored resources over time using lamps

Posted: Wed Oct 07, 2015 12:40 pm
by ssilk
I would really LOVE to have something like this not only as lamps on ground, but also as
- A real "screen" on ground.
- a new kind of GUI-element in the game.

What's needed is "just" a new type of combinator ("screen-combinator"?), that can receive some inputs, displays that on a - hm - 10 x 5 tiles display on ground and/or opens a new tab in a GUI (like the electrical info, or production info).

Re: Plot of stored resources over time using lamps

Posted: Tue Oct 20, 2015 2:26 pm
by wad67
Having screens you can place would be more than beneficial, from what I gather the sheer number of combinators required to address a screen made out of lamps is ridiculous and tedious to develop.
Simple, scale-able screens have my vote :D

I can envision a control room of sorts, using a system very similar to the OP's to keep track of various base resources and display them in a centralized area.
Outputting to the actual player gui seems a bit corn, but it could be quite useful if you could also use it as an IO, with buttons that trigger events in a combinator system.
Perhaps some kind of personal computer item that does the aforementioned.