Open LevFendi opened 3 months ago
I can help with math for shapes.
Also found out that there is a pollution tab? That one might be important but maybe falls under something else.
I will elaborate on vanilla features: So there are highly interactive vanilla GUIs in the same layout for production, electricity, pollution, and kills. The numbers are all graphed in real time and you are able to select one of 7 or so plotting intervals ranging between 5 seconds and 1000 hours. Items are listed below the graph in a scrolled list, with the highest average values on top. You are able to view the graph for each item separately or plot multiple items on the same axes.
For the modding API, this type of data is readily available using the class LuaFlowStatistics. It took some experimentation but I figured out how to get the correct data out of it for basic electric and production statistics. @ahicks92 You are more than welcome to implement the framework for converting these discrete data sequences into audio graphs. I have no experience with this but I am curious about it. Same for issue #137, if you like.
Audio graphs are tricky because we don't have enough in game to do that I think, and would have to first add stuff to the launcher. I linked this on Discord at one point if you want to play with plugging in random equations to see what they're like (only works in Chrome but I believe is accessible to the sighted given that they're a company selling such things): https://www.desmos.com/calculator/nchqcdi2ds
It's not hard to do way better than that thing in terms of not being annoying and headache-inducing but for some reason none of the graphing calculators for the blind bother to be nice to listen to...sigh.
Basically we need pitch (which could be emulated at the cost of increasing mod size by a lot) and pan (maybe?? Got some ideas, but what they have isn't good enough). How to do the UX for this regardless of Factorio is well-understood by basically every blind coder, but in this specific context complex bridging is probably required.
Taking the average direction of the derivative over some time period would tell one if the graph is generally going up or down, but also accounting for detecting "weird". Taking the average of the sign of the derivative would give some idea how much it's "wobbling", since that's close to zero if it's going up and down frequently, since 1 and -1 cancel out (specifically that comes back as a float in the range -1 to 1). Getting some idea of "crazy shapes" should just be standard derivative. The tricky part is figuring out what the constants in all of this should be because they'd vary by an order of magnitude.
I do really want it if nothing else for learning purposes. However it's a lot of work and I don't intend to do it now because there are much higher impact things.