Page 1 of 1

Circuit Recorder (or graph window API)

Posted: Sat Nov 24, 2018 12:44 am
by AntiBlueQuirk
Two words: Circuit Graphs

I'd really like to see a Recorder Box that can be hooked up to the circuit network. This would just be a little combinator style box that hooks up to the circuit network, and would record all of the signals it receives. Clicking on it would reveal a Production Graph style window, except instead of production statistics, the recorded signals would be shown.

Because you control what signals get fed in, it can be used for basically anything: monitoring buffer fullness, monitoring belt throughput, recording train arrivals, etc.

Alternatively, an API could be added for drawing graph windows. This would be more generic, but would be harder to optimize, especially if it was used for creating the Signal Recorder.

Re: Circuit Recorder (or graph window API)

Posted: Sat Nov 24, 2018 1:58 am
by Tekky
My suggestion of a global circuit network also allows you to monitor what is going on in your base by monitoring certain circuit activity that is transmitted by a wireless signal transmitter. In that respect, my suggestion for a wireless transmitter is similar to your suggestion of a "Recorder Box".

However, my suggestion goes further than your suggestion in that it also allows you to control circuit signals, not just monitor them. In other words, my suggestion is also about changing signals, not just reading them.

In my suggestion, I do not discuss how the signals of the (global) circuit network are displayed to the player, though.

Re: Circuit Recorder (or graph window API)

Posted: Sat Nov 24, 2018 2:58 am
by AntiBlueQuirk
While I like the idea of global/wireless circuit networks, I don't think it's really necessary for this idea. I don't want to change the mechanics of the circuit networks at all, I just want the player to be able to say, "I'd like a graph of this circuit output", and then just connect a box. I feel like this would be simple, intuitive, and immersive. Much like you can click on a power pole to see the power history, you can click on a Recorder box to see the signal history it's connected to.

Like speakers and lamps, players could use it for the obvious stuff: How much iron was in this chest an hour ago? How much copper moved over this belt in the last 10 minutes? Players could also use it for more abstract stuff, like tracking train arrival times, or drawing silly pictures in the graphs.

It also greatly supplements the capability of the production graph. The production graph can only show you one thing: How much you produced and consumed globally. A recorder box can track storage levels. It can track production on a single part of the factory. (How much iron is going into my circuit factory?) It can track literally anything you can turn into a signal.

It would also interface with mods well. Any mod that transmits or receives signals can enable the player to make graphs.

Re: Circuit Recorder (or graph window API)

Posted: Sat Nov 24, 2018 3:34 am
by Tekky
Ah, I see now that your suggestion is not so much about monitoring the current signal levels, but rather storing the entire signal history. In that respect, our suggestions are quite different.

It would be interesting to know how your suggestion would impact performance and savegame size. I guess that it would not be a problem to place a few recorders in different parts of the factory. However, if someone has the idea of placing such a recorder next to every assembler in his blueprints, then I'm afraid that it would severely impact performance and savegame size (due to all the history information). But I assume most people won't want to do that.

Re: Circuit Recorder (or graph window API)

Posted: Sun Nov 25, 2018 12:37 am
by AntiBlueQuirk
I guess I could see it being an issue if players placed hundreds of them, but I don't think most players would do that. I also don't think recording signal data requires that much performance. The game doesn't seem to have any trouble storing production data, and that has be tracked across the entire factory, with *any* assembler, mine, or furnace able to affect that data. Recording the signal state only has to copy the already calculated values for that network. I could see it taking a lot of memory, but at least for saving, even production data looks pretty easy to compress. Most recorder boxes would only be tracking a few signals at most.

I could see the case for limiting the amount of data that can be stored, like say, limiting the total time of history that can be stored, or reducing the sampling rate. Then again, if a multiplayer host is worried, it wouldn't be hard to deactivate building them, or even limit the number that can exist.

Re: Circuit Recorder (or graph window API)

Posted: Sat Mar 16, 2019 11:37 am
by BlueTemplar

Re: Circuit Recorder (or graph window API)

Posted: Sat Mar 16, 2019 1:18 pm
by AntiBlueQuirk
That's pretty cool. I haven't loaded it up, but it looks like exactly what I want.

Out of curiosity, I went to find out when the graph window APIs had been added without me noticing. They haven't. The mod creates a hidden surface in the world, and draws the graphs in the world using the new drawing APIs. The graph windows are just cameras to this hidden world. As incredibly clever as this is, I do have some reservations about the performance limitations. Not only with drawing possibly very complicated graphs in Lua, but also with storing all the circuit data history in Lua tables.

But that looks awesome. I'll have to give it a try!