Jump to content

Calculations of Max Stats and Experience


Recommended Posts

Hi all,

First off, I am really sorry if this is in the wrong forum; I wasn't quite sure where to put it ^^"

I am currently writing a .pkm-editing program as a personal project. Through research and reading through helpful websites I have managed to tack together functions that create a PID from IVs, extract data from the PID and IVs and finds sets of IVs for PIDs.

However, I have hit a dead end. My next task is to write functions that a) calculate the Pokémon's level from its experience points and vice-versa, and b) calculate the max stats from base stats, level, EVs and IVs. I am aware that for the former the growth rates are different for each Pokémon - however, two forumlae are undetermined (fluctuating and erratic, I believe). For the latter, I'm really not sure how the max stats are calculated as a Pokémon is levelling up.

What I'm really asking is: can anyone provide information on either of these issues? How does Pokésav calculate experience and level? Does it have a built-in database of all the Pokémon species? And how does it calculate the max stats? Again, does it have all the Pokémon species' base stats built in?And how are the stats calculated at different levels? Do I need to emulate the environment of the actual game to calculate these?

Sorry; long post is long :3 Any help would be much appreciated.

Thanks in advance.

Link to comment
Share on other sites

Thank you for the prompt reply, KazoWAR. I'm not that familiar with Bulbapedia yet so it's helpful to have those direct links :)

A little light reading for me then ;)

PS I am guessing this means that I need to have some sort of database in my program containing data on EXP growth type and base stats for each species of Pokémon?

Link to comment
Share on other sites

To compute the level of a pokemon from its experience, you can use this file to give you the thresholds for each level for every exp growth rate, and this file to give you the growth rates of every evo line. You can thank Eevee from veekun.com for extracting those

Thanks for that link, xfr :) What do you mean by the growth rates of every evolution line?

Link to comment
Share on other sites

There are 6 differents growth rates, and the level of a pokemon is a direct function of the growth rate and experience. The first link I posted is basically how to compute the level from the growth rate and experience. To compute the level of a pokemon you will thus need to know what is its growth rate. The second link I posted gives you growth rates for every evolution line (the growth rate is the same among members of the same evo line); to use that data you must use this file to find out the id of the evolution chain of the pokemon of which you want to know the level, then the two previous files can be used to compute the level.

Link to comment
Share on other sites

What language are you writing this in? I have a .net dll that can handle a lot of that, but needs a bit of work on the level/exp functions (they're, uhh, wrong - off by a bit and I haven't bothered to fix it), but has a DB of growth rates, etc.

Link to comment
Share on other sites

What language are you writing this in? I have a .net dll that can handle a lot of that, but needs a bit of work on the level/exp functions (they're, uhh, wrong - off by a bit and I haven't bothered to fix it), but has a DB of growth rates, etc.

I am actually writing this in .NET (well, I'm using VB Studio 2010) :) That might be extremely helpful to have a look at actually - I may not use any of the code directly but I am always up for new ways of doing things. My program is a bit inefficient at the moment (it's a little slower than Pokésav, etc. - due to me being a novice programmer!) so I'd love to see how other people write things.

Thanks for the explanation on that, xfr. I might stick to just computing the growth rate and experience separately for each Pokémon - this will work best with the database structure I have going.

Cheers for the help :D

Link to comment
Share on other sites

http://dl.dropbox.com/u/17115146/Pokehack.zip

Here's what I have. It's in C#

If you don't have Visual Studio Professional, you'll have to download C# express, compile it and then reference it in your project. Otherwise, you can reference it in.

Sample usage:

Dim pkm As Byte() = File.ReadAllBytes(pathtopoke)
Dim poke As New PokeHack.Pokemon(pkm)
poke.HeldItem = PokeHack.Pokemon.ConvertStringToItemID("Master Ball")
poke.Level = 100

Edited by willaien
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...