> > FUNCTION atlevel (lev as integer, a0 as integer, aMax as integer) as > > integer > > 'Stat at a given level, according to an arbitrary curve between two > > points. > > IF lev < 0 THEN RETURN 0 > > RETURN (.8 + lev / 50) * lev * ((aMax - a0) / 275.222) + a0 + .1 > > END FUNCTION > > It's the quadratic 1/275.222 * lev * (0.02*lev + 0.8) (which is 0 at > lev=0 and 1 at lev=99), scaled and shifted to hit a0 and aMax. Note
Okay, that sorta makes sense to me. I guess the scaling and shifting is mainly what has be confused. > that the vertex/turning point is at lev -20 (because the roots are at > 0 and -40, so the vertex is halfway between them). One way to make the > slope customisable would be to make the x (lev) position of the vertex > customisable, however this doesn't fully define the curve. A quadratic > is also defined by any 3 points on the plane (provided they all have > different x values). So my suggestion is to allow the user to specify > the midway point: the unscaled value halfway between levels 0 and > MaxLevel (level 49.5 by default). If they use 0.5 (50%), then they get > a straight line. 42.2% gives the current curve. Ooh! I like that very much! > Note that whether the curve is concave up or concave down depends both > on the formula used (parameters) and whether the stat is increasing or > decreasing. This may be undesirable (since 42.2% becomes effectively > 57.8%), so I could add an extra flag to specify the behaviour. > > Also, that extra 0.1 on the end is pretty odd. I don't know why it's > there -- its not needed for rounding, but I guess it'll have to stay. I have no memory of how this formula came into being, but my guess is that I flailed at it, randomly changing constants and operators until I got something that resembled a plausible curve. I also noticed (and fixed in r4618) that the formula used for the preview in custom was not the same as the one used in atlevel() My guess is that the formula that I removed in custom resembles my original flailing, and that atlevel() was a copy of it which was cleaned up and simplified, and then and some point one of the two copies had a + swapped for a * or vice-versa > I'll go ahead and implement this (since that's easier than explaining > exactly how it'll work here), tell me what you think. Yay! :) > For example, we > could instead allow a cubic (which are defined by 4 points, so you > could specify the percentage at MaxLevel / 3 and MaxLevel * 2/3, or > either a cubic or a quadratic... specifying the percentage at MaxLevel/3 and MaxLevel*2/3, seems like it would be pretty simple and easy to understand, as long as there was a preview curve graphed that the user can see when they enter those values --- James _______________________________________________ Ohrrpgce mailing list [email protected] http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
