Board Thread:Lua Help/@comment-1466854-20140820125533/@comment-1466854-20140821030648

Realistically, a database would simplify it quite nicely, yes, but I'm aware that's not an option and I'm very aware of that.

So, let's get more specific. Apologies if this goes over anyone's head. What I'm doing isn't tracking anything variable in itself, rather filling in the data no one has managed to obtain directly. To give an example, the main spirits people care about are SR (super rare). These spirits cap out at level 65. We track the stats they have at levels 1, 25, 35, 45, 55, and 65. Usually the most important thing for most people is level 65, but the other levels can be important at varying times as well. Since there are hundreds of these spirits, filling in all three stats for all levels of every spirit can be... well, quite a lot of work. However, we realized quite a while back that if you have something with 200 str at level 25, 300 at level 35, and 400 at level 45, given another spirit that shares two of those values, the third will be shared as well. The growth patterns are shared between specific ones, but comparing those all by hand given huge gaps in the data is challenging at best. The only part of this that's proving infeasible is the initial part, specifically pulling the stats of ~600 spirits from an individual template page for each one, using a fancy lua function to sort through it and build a table of known growth rates, then most importantly, storing that for reference as needed so the rebuild wouldn't have to be done on every single page load.

In case anyone's wondering, we get a minimum of 20k pageviews per day on this wiki, which when you combine it with the potential of having 600 transclusions per view on over 50% of those... you can figure out where that would be a horrible mistake, and probably get me in trouble (for good reason). Even with perfectly formatted lua templates, that would be disgustingly weighty and would make me feel like I needed a shower just for writing it.

The fun part of all this is that if we had the full dataset already, this whole project would be pointless. Likewise, if anyone could figure out a reliable formula to derive the stats for these spirits, we could just calculate it out based on two data points. Unfortunately, neither is true, and the first part won't ever happen.

Currently, I'm still planning on going the javascript route. It seems like it'd be much less painful on all fronts, sadly enough. Nevertheless, I do find the suggestions you've all provided so far fascinating at a minimum, and some rather helpful even if not for this particular topic.