Pet attack formula... mostly solved

Brael - Dreamweaver
Brael - Dreamweaver Posts: 1,430 Arc User
edited December 2009 in Venomancer
Ok, I don't have much time to work on this the next week or so, but I think I'm making some real progress on the formula. Maybe someone else can figure it out from here. I think the only things I'm off on still, is my gain per level is slightly too low and some rounding vs truncating errors.

Using these dividers on attack:
1 1.00
2 1.11
3 1.22
4 1.33
5 1.44
6 1.56
7 1.67
8 1.78
9 1.89
10 2.00

It should be possible to remove the differences in attack per level.

Then, by multiplying that number by attacks per second, it seems to create a base rate. For example a Sharptooth Wolfling has an attack stat of 5 with an attack rate of .8 per second. A Pollen Scorpion has an attack stat of 6 with an attack rate of .6 per second. Using data I collected, here's the base attacks for each over the first 22 levels (2-23):
Level	Wolf	Scorpion
2	21	30
3	27	39
4	34	49
5	41	59
6	48	70
7	56	81
8	64	93
9	73	105
10	81	118
11	91	131
12	100	145
13	110	159
14	120	174
15	131	189
16	142	205
17	153	221
18	165	238
19	177	255
20	189	273
21	202	292
22	215	310
23	228	330

When doing what I described above to their attacks here's what happens:
Level	Wolfling	Scorpion
2	11.57	11.63
3	15.04	14.95
4	18.9	18.83
5	22.76	22.71
6	27	26.58
7	31.24	31.02
8	35.87	35.45
9	40.5	40.43
10	45.51	44.86
11	50.53	50.4
12	55.93	55.38
13	61.33	60.92
14	67.11	66.46
15	72.9	72.55
16	79.07	78.65
17	85.24	84.74
18	91.8	91.38
19	98.36	98.03
20	105.3	104.68
21	112.63	111.88
22	119.57	119.08
23	127.29	126.28

Look how close they are. Infact, here's the midpoints, which I'll be using for the rest of this:
8.4
11.6
15
18.87
22.73
26.79
31.13
35.66
40.47
45.19
50.46
55.66
61.13
66.79
72.73
78.86
84.99
91.59
98.19
104.99
112.25
119.32
126.78

See the pattern? If not, check the increase per level, each time it goes up by level*.2. Then look at what's left. It starts at 5 and adds to the previous level giving you:
Level	Gain	Level+Previous	Base=5
1	3	8	
2	3.2	11.2	
3	3.4	14.6	
4	3.6	18.2	
5	3.8	22	
6	4	26	
7	4.2	30.2	
8	4.4	34.6	
9	4.6	39.2	
10	4.8	44	
11	5	49	
12	5.2	54.2	
13	5.4	59.6	
14	5.6	65.2	
15	5.8	71	
16	6	77	
17	6.2	83.2	
18	6.4	89.6	
19	6.6	96.2	
20	6.8	103	
21	7	110	
22	7.2	117.2	
23	7.4	124.6	
24	7.6	132.2	
25	7.8	140	
26	8	148	
27	8.2	156.2	
28	8.4	164.6	
29	8.6	173.2	
30	8.8	182	
31	9	191	
32	9.2	200.2	
33	9.4	209.6	
34	9.6	219.2	
35	9.8	229	
36	10	239	
37	10.2	249.2	
38	10.4	259.6	
39	10.6	270.2	
40	10.8	281	
41	11	292	
42	11.2	303.2	
43	11.4	314.6	
44	11.6	326.2	
45	11.8	338	
46	12	350	
47	12.2	362.2	
48	12.4	374.6	
49	12.6	387.2	
50	12.8	400	
51	13	413	
52	13.2	426.2	
53	13.4	439.6	
54	13.6	453.2	
55	13.8	467	
56	14	481	
57	14.2	495.2	
58	14.4	509.6	
59	14.6	524.2	
60	14.8	539	
61	15	554	
62	15.2	569.2	
63	15.4	584.6	
64	15.6	600.2	
65	15.8	616	
66	16	632	
67	16.2	648.2	
68	16.4	664.6	
69	16.6	681.2	
70	16.8	698	
71	17	715	
72	17.2	732.2	
73	17.4	749.6	
74	17.6	767.2	
75	17.8	785	
76	18	803	
77	18.2	821.2	
78	18.4	839.6	
79	18.6	858.2	
80	18.8	877	
81	19	896	
82	19.2	915.2	
83	19.4	934.6	
84	19.6	954.2	
85	19.8	974	
86	20	994	
87	20.2	1014.2	
88	20.4	1034.6	
89	20.6	1055.2	
90	20.8	1076	
91	21	1097	
92	21.2	1118.2	
93	21.4	1139.6	
94	21.6	1161.2	
95	21.8	1183	
96	22	1205	
97	22.2	1227.2	
98	22.4	1249.6	
99	22.6	1272.2	
100	22.8	1295	
101	23	1318	
102	23.2	1341.2	
103	23.4	1364.6	
104	23.6	1388.2	
105	23.8	1412	

Compare those to the previous set of numbers and look how close they are:
Level	Actual	Calculated
2	11.6	11.2
3	15	14.6
4	18.87	18.2
5	22.73	22
6	26.79	26
7	31.13	30.2
8	35.66	34.6
9	40.47	39.2
10	45.19	44
11	50.46	49
12	55.66	54.2
13	61.13	59.6
14	66.79	65.2
15	72.73	71
16	78.86	77
17	84.99	83.2
18	91.59	89.6
19	98.19	96.2
20	104.99	103
21	112.25	110
22	119.32	117.2
23	126.78	124.6

Therefore, it's not accurate, but I think it's safe to say that long string of numbers above is the base attack for pets.

Now, with that base attack, divide it by the attack/sec and multiply by the attack tier (those 10 numbers above that ranged from 1 to 2) or the formula (1+((Tier-1)/9) to get the expected pet attack for a level. Remember, when testing this pick things with low tame levels as it's not accounting for that reduction higher tame level pets take. And don't forget about the 20% attack bonus from loyalty if applicable.

Lets verify it from my pet bag:
A Herc at 96 is 2989 attack. Hercs have .8/sec and an attack of 7. Meaning 1205/.8*1.67=2515. There's still the attack bonus to account for though, 2515*1.2=3018. As you can see, I'm close.
A Sharptooth Wolfling at 23 is 228 attack without a loyalty bonus. It has an attack of .8/sec with an attack of 5. That's 124.6/.8*1.44=224.28. Again, close.
My Pollen Scorpion at 57 with a loyalty bonus is 1546 attack. Scorpions have an attack of 6 with an attack/sec of .6. So we want 495.2/.6*1.56*1.2 that's 1545.024 attack.

And for good measure, although I don't have one, according to ecatomb a Jaden Qingfu is 2137 attack at 90 with an attack/sec of .8. Using my pet database (or growth chart), I know a Qingfu has an attack of 4 (actually, I think I got this value from the stickied spreadsheet originally). So we're looking at 1076/.8*1.33*1.2 which equals... 2146.62. Once again, I'm pretty close.

Oh, and if you're curious about what this means for a nix since if you try it you'll quickly realize it's way past 10... it's attack is 21. So much for assuming the scale stopped at 10.
Post edited by Brael - Dreamweaver on

Comments

  • Brael - Dreamweaver
    Brael - Dreamweaver Posts: 1,430 Arc User
    edited December 2009
    I made those comparisons again, along with a couple of others. This time I accounted for tame levels by finding the expected attack at the tame level-1, taking 1/10 of that, and subtracting it from the attack of the level I wanted. For example, a 96 marksman, take 1/10 of it's level 41 attack, and subtract that from the level 96 attack.

    I also added a few more pets to the test just to verify it.
    Name			Level	Loyalty	Real	Calculated	Off By
    Hercules		90	120%	2672	2690		0.6737%
    Hercules		96	120%	2989	3012.5		0.7862%
    Jaden Qingfu		90	120%	2137	2149.76		0.5971%
    Sharptooth Wolfling	23	100%	228	222.95		-2.2149%
    Pollen Scorpion		57	120%	1546	1537.14		-0.5734%
    Varicose Scorpion	90	120%	3336	3344.08		0.2421%
    Prickly Oddfoot Pup	90	120%	1947	1969.33		1.1470%
    Soft Cactopod		90	120%	3117	3150.93		1.0886%
    Crystaline Magmite	96	100%	2103	2155.17		2.4807%
    Celestial Plumpfish	80	100%	1634	1758.18		7.5997%
    Florafang Guard		63	100%	753	806.18		7.0624%
    Shadou Cub		60	60%	469	475.26		1.3352%
    Antelope Pup		63	60%	631	661.82		4.8848%
    Eldergoth Marksman	96	120%	3553	3452.24		-2.8358%
    
    

    Judging by the herc and Qingfu, both of which are level 1 tames, I'm pretty close. However, once tame levels get brought into the equation things seem to change. The Plumpfish is way off for example, though still close enough to give an estimate, it's also possible that they aren't a growth stat of 3 like their chart seems to indicate. They could be something else, which would throw it off a lot..

    I also put this into a spreadsheet incase anyone wants to mess with it.
    Download link

    Anyways, I can't see where I'm off still. Some pets come in high and some come in low so it doesn't seem like a constant that's missing, and being off by 7% (on the florafang especially) makes me think I'm still missing something other than rounding.
  • propan1ol
    propan1ol Posts: 27 Arc User
    edited December 2009
    1) I might have missed something, but is there any way to find/calculate the pet's attack tier? I want to calculate attack stats of the new Tideborn-area pets, but none are in the spreadsheet.

    2) Do you (or someone else) have the formulae for pet pdef, mdef, etc? I think they're calculated in the spreadsheet cells but I fail at practical math...
  • rinuruc
    rinuruc Posts: 0 Arc User
    edited December 2009
    somehow the fact that ur few percentages off each time makes me figure theres a diffrence still somewhere,... maybe types of pets get a slightly diffrent multiplier somewhere,... idk,...
    (dont have exel,... maybe just put it in a pdf file or so (or a txt would even be better so i can just enter it in matlab or so), so everyone can open it,...)
  • Brael - Dreamweaver
    Brael - Dreamweaver Posts: 1,430 Arc User
    edited December 2009
    propan1ol wrote: »
    1) I might have missed something, but is there any way to find/calculate the pet's attack tier? I want to calculate attack stats of the new Tideborn-area pets, but none are in the spreadsheet.

    2) Do you (or someone else) have the formulae for pet pdef, mdef, etc? I think they're calculated in the spreadsheet cells but I fail at practical math...

    The tier comes from the growth chart. There's some pets where that's not accurate on each stat though due to bugs (hercs recently for example), I think the shadou cub is one of these situations.

    The way I calculated this was to use a multiplier since I don't know the base numbers, the same could be done with other stats but we know simpler formulas for them. Pdef/Mdef is 60-120 per level, hp is 22.5-45 per level, and so on. I don't remember accuracy/evasion offhand, regen isn't figured out (and is useless anyways), speed isn't figured out... and is probably bugged. For most pets you can get the growth rate for any stat by using the spreadsheet in the best pet thread stickied on this board.
    rinuruc wrote: »
    somehow the fact that ur few percentages off each time makes me figure theres a diffrence still somewhere,... maybe types of pets get a slightly diffrent multiplier somewhere,... idk,...
    (dont have exel,... maybe just put it in a pdf file or so (or a txt would even be better so i can just enter it in matlab or so), so everyone can open it,...)

    The things that are 7% off I fixed, those were an error on my end (florafang/shadou cub are a 2 on the chart, not a 3). But it throws the shadou cub off when fixing it, which makes me think the data for shadou cub attack is bugged (attack is one level higher on the growth chart than it actually goes up by, and it should be a 1). That gets everything I tested within 2% or so except for the antelope. I think we found evidence of 1 not showing up on the chart before the last time I and a friend of mine tried solving this, but I would need to go back and check those notes.

    If you want to put it in another program, take that base attack category, I have levels 1-105 listed there for you, and then place the multiplier for the attack growth rate and attack speed in there but it will take you less time to download and install open office than it will take to calculate even 3 pets by hand.

    Anyways, on the subject of everything being off, I have four thoughts on it.
    1. Everything is coincidence (unlikely given how close everything is).
    2. The developers used the same formula (perhaps written in a different form) and made an arbitrary table of attack values based on it. Arbitrary pet stats aren't a new idea, practically every level 1 pet (or pet worked backwards to level 1) has some arbitrary starting stats.
    3. It's off because I took the midpoint of .2 and the proper value isn't the midpoint. (this seems unlikely, .195 and .205 throw things off a lot)
    4. They round at some point that I'm not rounding at. This is very likely.
  • rinuruc
    rinuruc Posts: 0 Arc User
    edited December 2009
    theres only a finite amount of places where they can round,... ;-)
    if u try rounding at every possibility,... (every single stat u use in the calculations, make two columns of it,... one rounded one nonrounded,... and than go to the next calculation,... so in the end u ll have a lot of columns of endresults, slightly different from each other,... one will be the right one,... ;-)
  • Brael - Dreamweaver
    Brael - Dreamweaver Posts: 1,430 Arc User
    edited December 2009
    There's still several methods of rounding they could have picked, so simply picking everything and rounding it, isn't necessarily going to work.

    Here's the list for phoenix attack: http://pwi-forum.perfectworld.com/showthread.php?t=360982

    I've got a more complete one at home but that's good enough for now. Being the largest numbers, it will be thrown off the most.

    Anyways, the most accurate I've found for a rounding method so far is rounding up at .8 which is basically TRUNC(stuff+.2)