Originally Posted by Whitetooth
|
Posted my results without detailing how(I'm Taiwanese so I'm not that good at making long english posts), but looking at some of the replys I guess some of you are interested in how, so here's how(its not much different than deriving the rating formula for RatingBuster, which was a bit harder than this).
1. After seeing the change in the patch notes, I knew I had to get the formula for RatingBuster to work in 2.4, so I downloaded/installed the test patch. Used WinMPQ to peek inside and see if I can find anything useful.
2. And there I found that the mana regen file that used to contain the coefficients of the spirit regen formula for different classes, was changed so that its now the same for all classes. But something else has changed too, the coefficients used to be the same for all levels, it is now different for each level. (for this step I used a program coded by myself for parsing)
3. No where in the files could I find anything about INT, that means there's work to be done on the test server. I logged on test server(sadly my copies are still pending...), made a couple dozen level 1s of different class race combinations. For each I recorded: INT, SPI, GetUnitManaRegenRateFromSpirit("player")
4. Raw data from the test server:
INT SPI REGEN_PER_SEC
21 22 3.526054932
19 20 3.049178196
23 24 4.025470329
20 21 3.28473313
22 23 3.773009134
22 22 3.609008623
27 22 3.998036219
19 25 3.811222864
19 20 3.049178196
26 22 3.923318935
24 20 3.42685659
18 25 3.709598137
5. Observe the data. I see from data with the same INT, that REGEN_PER_SEC is linear with SPI.
6. The first thing you do after you see that some thing is linear is to figure out if there are any constants. By using those with the same INT but with different SPI, for example:
19 25 3.811222864
19 20 3.049178196
Calculate the constant = 3.811222864 - (3.811222864 - 3.049178196) / 5 * 25 = 0.001
7. Pre-process the data to remove SPI and the constant from the function for curve fitting.
(1) X = REGEN_PER_SEC - 0.004
(2) regen/spi = X/SPI
INT regen/spi
18 0.148343925
19 0.152408934
20 0.156368244
21 0.16022977
22 0.164000397
23 0.167686264
24 0.17129283
26 0.178287224
27 0.181683464
8. Curve fitting, know what your looking for helps. According to past experience, blizzard formulas are relatively simple, the result should not be too complecated, it should be "smooth" in curve fitting terms.
My curve fitting routine tries to fit the data with some 10,000+ functions, and browsing through the results I see something really familiar.
I saw a function a*x^0.5 with coefficient of a=0.0349649899816082
The coefficients for level 1 mana regen just happens to be 0.0349650010466576
So this is it.
9. The result: ManaRegen(SPI, INT, LEVEL) = (0.001+SPI*BASE_REGEN[LEVEL]*(INT^0.5))*5
10. Checking the formula with my data and it fits perfectly, 100% accurate.
11. Posts my results here
