Re: An interesting find with stats.
Posted: Fri Feb 27, 2009 8:42 am
I was playing with Corrupt, and I happened to find another variable that influences a Denjuu's stats. Why is it that when you hack a Denjuu's base stats to all be the same, the stats themselves are all different? For example, if you hack Crypto's base stats all to 10, he'll have 14 HP, 12 Speed, 16 Attack, 14 Defense, 12 Denma Attack, and 12 Denma Defense at Level 5. That doesn't even make any sense! And why is is that two Denjuu can have the same base stats, yet have different max stats? For example, Fungus and Keshi both have base Speeds of 14, but their max Speeds are 112 and 63, respectively -- a difference of 49! So there HAS to be something else influencing stats!
Well, guess what... now I found it.
You see, there are variables (which I will call "Level Influence" throughout this topic) that make certain stats increase faster than others when a Denjuu raises levels. These variables are in offsets $9C715-$9CB28, and there are 6 bytes for every Denjuu, which makes sense, because each Denjuu has 6 stats (HP, Speed, Attack, Defense, Denma Attack, and Denma Defense in that order). Essentially, the higher the variables, the more a stat raises when it levels up. I experimented with these variables to find what exactly how they worked. I set all these variables to 100 for every Denjuu, then looked at the stats of low-level Denjuu. I found the following:
Lv. 2: 50 + Base Stat
Lv. 3: 100 + Base Stat
Lv. 4: 150 + Base Stat
Lv. 5: 200 + Base Stat
See a pattern here? For every level increased, the stat increases by half of the Level Influence. Or if you want to look at it another way, for every two levels, the stat increases by the Level Influence. I changed these values and got similar results (e.g. when I changed them to 50, the stats increased by 25 each level). These Level Influence variables are multiplied by the level subtracted by 1, then divided by 2, and finally added to the base stat. Actually, a formula might help:
Stat = Base stat + (Level - 1) * Level Influence / 2
This looks confusing, though not as much as the stat formula in Pokémon. And I could figure it out without any assembly code, too!
Also, some notes:
- If a stat exceeds 255, it will be reduced mod 256. So, if a stat ends up being 256, it will become 0. 257->1, 258->2, 259->3, 260->4, and so on. In practice, this never happens, because the designers were careful to prevent this. Just be aware of this if you plan to hack Denjuu's stats. (This means Level Influence variables should never be any higher than 5. If it's at 5, the highest base stat you can have without overflow is 10. If it's at 4, the highest base stat you can have without overflow is 59, which is higher than anything in the game. At 3, the highest base stat you can have is 108; at 2, it's 157, and at 1, it's 206.)
- If a stat ends up being a fraction (which is possible if the level is an even number, and the level influence is an odd number), it either rounds up or down depending on the situation. So far, I've only seen the stat round up if the Denjuu is at Level 2 (probably to balance it out). It seems to round down in all other cases. So if a Denjuu is at Level 2, a stat of 9.5 will become 10, but if a Denjuu is at any other level, then 9.5 would become 9.
- Because of the nature of the formula, if the level is 1 or the Level Influence is 0 (neither of which are possible without hacking), then the stat will be equal to the base stat. That's really low!
Now let's do an example with Crypto, and let's suppose it's at Level 5!
As we already established months ago, Crypto's base stats are: 38 HP, 10 Speed, 16 Attack, 10 Defense, 06 Denma Attack, 06 Denma Defense.
Now, we have to find the Level Influences. Since the offset of the data starts at $9C715, Crypto is Denjuu #5, and there are 6 bytes for every Denjuu, Crypto's data goes from $9C72D-$9C732. These bytes are:
02 01 03 02 01 01
This means for every two levels, Crypto will gain 2 HP, 1 Speed, 3 Attack (not very surprising), 2 Defense, 1 Denma Attack, and 1 Denma Defense.
Now that we have that, we are ready to do the math!
First, let's do HP:
HP = Base HP + (Level - 1) * Level Influence / 2
HP = 38 + (5 - 1) * 2 / 2
HP = 38 + 4 * 2 / 2
HP = 38 + 8 / 2
HP = 38 + 4
HP = 42
Now Speed:
Speed = Base Speed + (Level - 1) * Level Influence / 2
Speed = 10 + (5 - 1) * 1 / 2
Speed = 10 + 4 * 1 / 2
Speed = 10 + 2
Speed = 12
Now Attack:
Attack = Base Attack + (Level - 1) * Level Influence / 2
Attack = 16 + (5 - 1) * 3 / 2
Attack = 16 + 4 * 3 / 2
Attack = 16 + 12 / 2
Attack = 16 + 6
Attack = 22
See why Crypto has good Attack? Its base Attack is good, and it grows a lot per level!
Now Defense:
Defense = Base Defense + (Level - 1) * Level Influence / 2
Defense = 10 + (5 - 1) * 2 / 2
Defense = 10 + 4 * 2 / 2
Defense = 10 + 4
Defense = 14
Now Denma Attack:
Denma Attack = Base Denma Attack + (Level - 1) * Level Influence / 2
Denma Attack = 6 + (5 - 1) * 1 / 2
Denma Attack = 6 + 4 * 1 / 2
Denma Attack = 6 + 2
Denma Attack = 8
Finally, Denma Defense:
Denma Defense = Base Denma Defense + (Level - 1) * Level Influence / 2
Denma Defense = 6 + (5 - 1) * 1 / 2
Denma Defense = 6 + 4 * 1 / 2
Denma Defense = 6 + 2
Denma Defense = 8
Now it all makes sense! I would like to do one more example though, this time with a Level 2 Oshe:
Oshe's Base Stats are 32 HP, 08 Speed, 08 Attack, 11 Defense, 04 Denma Attack, and 04 Denma Defense. Oshe's data for level influence is from $9C721-$9C726. The data is:
02 01 02 02 01 01
So every 2 levels, Oshe gains 2 HP, 1 Speed, 2 Attack, 2 Defense, 1 Denma Attack, and 1 Denma Defense. Now let's find the stats!
HP:
HP = Base HP + (Level - 1) * Level Influence / 2
HP = 32 + (2 - 1) * 2 / 2
HP = 32 + 1 * 2 / 2
HP = 32 + 1
HP = 33
Speed:
Speed = Base Speed + (Level - 1) * Level Influence / 2
Speed = 8 + (2 - 1) * 1 / 2
Speed = 8 + 1 * 1 / 2
Speed = 8 + 1 / 2
Speed = 8.5
This one rounds up to 9. I think it rounds up because it's at Level 2. When a Denjuu is not at Level 2, I've seen it round down...
Attack:
Attack = Base Attack + (Level - 1) * Level Influence / 2
Attack = 8 + (2 - 1) * 2 / 2
Attack = 8 + 1 * 2 / 2
Attack = 8 + 1
Attack = 9
Defense:
Defense = Base Defense + (Level - 1) * Level Influence / 2
Defense = 11 + (2 - 1) * 2 / 2
Defense = 11 + 1 * 2 / 2
Defense = 11 + 1
Defense = 12
Denma Attack:
Denma Attack = Base Denma Attack + (Level - 1) * Level Influence / 2
Denma Attack = 4 + (2 - 1) * 1 / 2
Denma Attack = 4 + 1 * 1 / 2
Denma Attack = 4 + 1 / 2
Denma Attack = 4.5
Again, this one happens to round up, so it's 5.
Denma Defense
Denma Defense = Base Denma Defense + (Level - 1) * Level Influence / 2
Denma Defense = 4 + (2 - 1) * 1 / 2
Denma Defense = 4 + 1 * 1 / 2
Denma Defense = 4 + 1 / 2
Denma Defense = 4.5
Again, rounds up to 5.
So that's how stats work. And unlike Pokémon, there doesn't seem to be any DVs (random variables that make each Pokémon slightly different from each other) or EVs (variables that increase your stats from battling). Much simpler! Though, on the other hand, it seems a little too simple like this...
By the way, Telefang 2 might use the same pattern. Remember when each Denjuu seemed to have TWO base stats? Well one of them might affect the stat growth rate per level, just like this game! I need to figure out if it does!
And finally, I need to dump this data real soon... And maybe use it on Wikifang...
Well, guess what... now I found it.
You see, there are variables (which I will call "Level Influence" throughout this topic) that make certain stats increase faster than others when a Denjuu raises levels. These variables are in offsets $9C715-$9CB28, and there are 6 bytes for every Denjuu, which makes sense, because each Denjuu has 6 stats (HP, Speed, Attack, Defense, Denma Attack, and Denma Defense in that order). Essentially, the higher the variables, the more a stat raises when it levels up. I experimented with these variables to find what exactly how they worked. I set all these variables to 100 for every Denjuu, then looked at the stats of low-level Denjuu. I found the following:
Lv. 2: 50 + Base Stat
Lv. 3: 100 + Base Stat
Lv. 4: 150 + Base Stat
Lv. 5: 200 + Base Stat
See a pattern here? For every level increased, the stat increases by half of the Level Influence. Or if you want to look at it another way, for every two levels, the stat increases by the Level Influence. I changed these values and got similar results (e.g. when I changed them to 50, the stats increased by 25 each level). These Level Influence variables are multiplied by the level subtracted by 1, then divided by 2, and finally added to the base stat. Actually, a formula might help:
Stat = Base stat + (Level - 1) * Level Influence / 2
This looks confusing, though not as much as the stat formula in Pokémon. And I could figure it out without any assembly code, too!
Also, some notes:
- If a stat exceeds 255, it will be reduced mod 256. So, if a stat ends up being 256, it will become 0. 257->1, 258->2, 259->3, 260->4, and so on. In practice, this never happens, because the designers were careful to prevent this. Just be aware of this if you plan to hack Denjuu's stats. (This means Level Influence variables should never be any higher than 5. If it's at 5, the highest base stat you can have without overflow is 10. If it's at 4, the highest base stat you can have without overflow is 59, which is higher than anything in the game. At 3, the highest base stat you can have is 108; at 2, it's 157, and at 1, it's 206.)
- If a stat ends up being a fraction (which is possible if the level is an even number, and the level influence is an odd number), it either rounds up or down depending on the situation. So far, I've only seen the stat round up if the Denjuu is at Level 2 (probably to balance it out). It seems to round down in all other cases. So if a Denjuu is at Level 2, a stat of 9.5 will become 10, but if a Denjuu is at any other level, then 9.5 would become 9.
- Because of the nature of the formula, if the level is 1 or the Level Influence is 0 (neither of which are possible without hacking), then the stat will be equal to the base stat. That's really low!
Now let's do an example with Crypto, and let's suppose it's at Level 5!
As we already established months ago, Crypto's base stats are: 38 HP, 10 Speed, 16 Attack, 10 Defense, 06 Denma Attack, 06 Denma Defense.
Now, we have to find the Level Influences. Since the offset of the data starts at $9C715, Crypto is Denjuu #5, and there are 6 bytes for every Denjuu, Crypto's data goes from $9C72D-$9C732. These bytes are:
02 01 03 02 01 01
This means for every two levels, Crypto will gain 2 HP, 1 Speed, 3 Attack (not very surprising), 2 Defense, 1 Denma Attack, and 1 Denma Defense.
Now that we have that, we are ready to do the math!
First, let's do HP:
HP = Base HP + (Level - 1) * Level Influence / 2
HP = 38 + (5 - 1) * 2 / 2
HP = 38 + 4 * 2 / 2
HP = 38 + 8 / 2
HP = 38 + 4
HP = 42
Now Speed:
Speed = Base Speed + (Level - 1) * Level Influence / 2
Speed = 10 + (5 - 1) * 1 / 2
Speed = 10 + 4 * 1 / 2
Speed = 10 + 2
Speed = 12
Now Attack:
Attack = Base Attack + (Level - 1) * Level Influence / 2
Attack = 16 + (5 - 1) * 3 / 2
Attack = 16 + 4 * 3 / 2
Attack = 16 + 12 / 2
Attack = 16 + 6
Attack = 22
See why Crypto has good Attack? Its base Attack is good, and it grows a lot per level!
Now Defense:
Defense = Base Defense + (Level - 1) * Level Influence / 2
Defense = 10 + (5 - 1) * 2 / 2
Defense = 10 + 4 * 2 / 2
Defense = 10 + 4
Defense = 14
Now Denma Attack:
Denma Attack = Base Denma Attack + (Level - 1) * Level Influence / 2
Denma Attack = 6 + (5 - 1) * 1 / 2
Denma Attack = 6 + 4 * 1 / 2
Denma Attack = 6 + 2
Denma Attack = 8
Finally, Denma Defense:
Denma Defense = Base Denma Defense + (Level - 1) * Level Influence / 2
Denma Defense = 6 + (5 - 1) * 1 / 2
Denma Defense = 6 + 4 * 1 / 2
Denma Defense = 6 + 2
Denma Defense = 8
Now it all makes sense! I would like to do one more example though, this time with a Level 2 Oshe:
Oshe's Base Stats are 32 HP, 08 Speed, 08 Attack, 11 Defense, 04 Denma Attack, and 04 Denma Defense. Oshe's data for level influence is from $9C721-$9C726. The data is:
02 01 02 02 01 01
So every 2 levels, Oshe gains 2 HP, 1 Speed, 2 Attack, 2 Defense, 1 Denma Attack, and 1 Denma Defense. Now let's find the stats!
HP:
HP = Base HP + (Level - 1) * Level Influence / 2
HP = 32 + (2 - 1) * 2 / 2
HP = 32 + 1 * 2 / 2
HP = 32 + 1
HP = 33
Speed:
Speed = Base Speed + (Level - 1) * Level Influence / 2
Speed = 8 + (2 - 1) * 1 / 2
Speed = 8 + 1 * 1 / 2
Speed = 8 + 1 / 2
Speed = 8.5
This one rounds up to 9. I think it rounds up because it's at Level 2. When a Denjuu is not at Level 2, I've seen it round down...
Attack:
Attack = Base Attack + (Level - 1) * Level Influence / 2
Attack = 8 + (2 - 1) * 2 / 2
Attack = 8 + 1 * 2 / 2
Attack = 8 + 1
Attack = 9
Defense:
Defense = Base Defense + (Level - 1) * Level Influence / 2
Defense = 11 + (2 - 1) * 2 / 2
Defense = 11 + 1 * 2 / 2
Defense = 11 + 1
Defense = 12
Denma Attack:
Denma Attack = Base Denma Attack + (Level - 1) * Level Influence / 2
Denma Attack = 4 + (2 - 1) * 1 / 2
Denma Attack = 4 + 1 * 1 / 2
Denma Attack = 4 + 1 / 2
Denma Attack = 4.5
Again, this one happens to round up, so it's 5.
Denma Defense
Denma Defense = Base Denma Defense + (Level - 1) * Level Influence / 2
Denma Defense = 4 + (2 - 1) * 1 / 2
Denma Defense = 4 + 1 * 1 / 2
Denma Defense = 4 + 1 / 2
Denma Defense = 4.5
Again, rounds up to 5.
So that's how stats work. And unlike Pokémon, there doesn't seem to be any DVs (random variables that make each Pokémon slightly different from each other) or EVs (variables that increase your stats from battling). Much simpler! Though, on the other hand, it seems a little too simple like this...
By the way, Telefang 2 might use the same pattern. Remember when each Denjuu seemed to have TWO base stats? Well one of them might affect the stat growth rate per level, just like this game! I need to figure out if it does!
And finally, I need to dump this data real soon... And maybe use it on Wikifang...