### Leveling math.

Posted:

**February 24th, 2013, 10:26 am**Ever wanted to maximize your XP gains? or to raise faster in ranking sites?

Easy: always use pets that are two levels lower than half the target level. Obviously, you'll eventually need to use more unefficient pets, if you want to reach to 25 with any pet, but I imagine it's good to know these things anyway.

While battling tamers, I always noticed how I would gain wildly different gains in XP. At first I thought lower level pets would get more experience, but a carried lvl1 would get about as much as a carried lvl20. Something was off and I wanted to figure what it was.

I batled several arcane eyes and came to several conclusions:

-rarity of either the player's pet or the target is not taken in consideration for XP gains.

-the 'difficulty bonus' is just possitive feedback for the player: it does not effect XP gains.

-the only factors are the levels of both player's pets and target.

With that, I was able to come up with [XP=45+5*lvl] (for same level battles); and a modifier for different levels. This modifier ranges from 0.2 (for targets 4 levels below the player) and increases by 0.2 per level: same level battles would have a modifier of [1], targets 1 level higher than the player have a modifier of [1.2], etc. All this can be expressed as:

(45 + 5 * plvl) * (1 + 0.2 * diff)

where 'plvl' is the player level and 'diff' is the level difference. For diff<=-5, XP gais are null.

This is the base XP gain; it gest multiplied by several factors:

Safari Hat: 1.1

Target amount of pets: 1 for 1 pet, 2 for 2 pets, and 2.5 for 3 pets.

Tamer bonus: 5 for pandaria tamers, 3 for tamers like Lydia and Trixxie, 2.5 for the lowest ones like Julia Stevens or Zunta. I didn't check the Outland/Northrend ones.

For instance, a carried lvl10 pet against Aki and using the hat would get:

plvl = 10

diff = 25 - 10 = 15

hat_bonus = 1.1

number_of_pets_bonus = 2.5

tamer_bonus = 5

XP = (45 + 5 * plvl) * (1 + 0.2 * diff) * hat_bonus * number_of_pets_bonus * tamer_bonus = 5225 points.

To figure how to optimize XP gains, we can take the derivative of that function to figure the maxima; or, rather the derivative of the siginificant bit: the base xp gain:

f(plvl) = (45 + 5 * plvl) * (1 + 0.2 * (tlvl - plvl)) || plvl and tlvl being the player and the target levels.

f'(plvl) = 2*plvl - tlvl +4

maxima --> 2plvl - tlvl + 4 = 0

Max xp gain occurs at player level [tlvl/2 - 2] for any given target level.

For instance, pandaria tamers are all lvl25, so maximum gain will be at [25/2-2 = 10.5] which is levels 10 and 11.

Lydia and Trixxy both have lvl 19 pets, so the maximum gain happens at [19/2-2=7.5] or levels 7 and 8: with a hat and a lvl7 carried pet, much like the example above, pets against Lydia would get (45+5*7)(1+0.2*12)*1.1*2.5*3 = 2244 xp

Easy: always use pets that are two levels lower than half the target level. Obviously, you'll eventually need to use more unefficient pets, if you want to reach to 25 with any pet, but I imagine it's good to know these things anyway.

While battling tamers, I always noticed how I would gain wildly different gains in XP. At first I thought lower level pets would get more experience, but a carried lvl1 would get about as much as a carried lvl20. Something was off and I wanted to figure what it was.

I batled several arcane eyes and came to several conclusions:

-rarity of either the player's pet or the target is not taken in consideration for XP gains.

-the 'difficulty bonus' is just possitive feedback for the player: it does not effect XP gains.

-the only factors are the levels of both player's pets and target.

With that, I was able to come up with [XP=45+5*lvl] (for same level battles); and a modifier for different levels. This modifier ranges from 0.2 (for targets 4 levels below the player) and increases by 0.2 per level: same level battles would have a modifier of [1], targets 1 level higher than the player have a modifier of [1.2], etc. All this can be expressed as:

(45 + 5 * plvl) * (1 + 0.2 * diff)

where 'plvl' is the player level and 'diff' is the level difference. For diff<=-5, XP gais are null.

This is the base XP gain; it gest multiplied by several factors:

Safari Hat: 1.1

Target amount of pets: 1 for 1 pet, 2 for 2 pets, and 2.5 for 3 pets.

Tamer bonus: 5 for pandaria tamers, 3 for tamers like Lydia and Trixxie, 2.5 for the lowest ones like Julia Stevens or Zunta. I didn't check the Outland/Northrend ones.

For instance, a carried lvl10 pet against Aki and using the hat would get:

plvl = 10

diff = 25 - 10 = 15

hat_bonus = 1.1

number_of_pets_bonus = 2.5

tamer_bonus = 5

XP = (45 + 5 * plvl) * (1 + 0.2 * diff) * hat_bonus * number_of_pets_bonus * tamer_bonus = 5225 points.

To figure how to optimize XP gains, we can take the derivative of that function to figure the maxima; or, rather the derivative of the siginificant bit: the base xp gain:

f(plvl) = (45 + 5 * plvl) * (1 + 0.2 * (tlvl - plvl)) || plvl and tlvl being the player and the target levels.

f'(plvl) = 2*plvl - tlvl +4

maxima --> 2plvl - tlvl + 4 = 0

Max xp gain occurs at player level [tlvl/2 - 2] for any given target level.

For instance, pandaria tamers are all lvl25, so maximum gain will be at [25/2-2 = 10.5] which is levels 10 and 11.

Lydia and Trixxy both have lvl 19 pets, so the maximum gain happens at [19/2-2=7.5] or levels 7 and 8: with a hat and a lvl7 carried pet, much like the example above, pets against Lydia would get (45+5*7)(1+0.2*12)*1.1*2.5*3 = 2244 xp