1. Welcome to Smogon! Check out the Smogon Starters Hangout for everything you need to know about starting out in the community. Don't forget to introduce yourself in the Introduction and Hangout Thread, too!
  2. Welcome to Smogon Forums! Please take a minute to read the rules.

Programming All Known Pokémon-related Formulas

Discussion in 'Technical Projects' started by Actaeon, Dec 29, 2008.

  1. Actaeon

    Actaeon

    Joined:
    Jun 16, 2008
    Messages:
    51
    LINK: http://rapidshare.com/files/177919329/Pok_mon_Formules.doc.html

    Hi guys, I didn't exactly know where to put this but I made this collection of all mathematic Pokémon-related Formulas which -providing I didn't forget any- covers all ingame calculations the third generation games make.

    I made a nice document out of this information and checked everything ingame and it all seems to be very precise.

    It goes from obvious things like Damage Calculation, Stat Calculation, Hidden Power Calculation, Experience Calculation, etc..., to Catch Chance Calculations and even Berry Powder, Pay Day Money, Escape Chance and things like that, including example calculations.

    Maybe it doesn't all matter very much to competitive play but it is a nice overview for the ones that are specifically interested in the game mechanics, like me.

    I also tried to convert formula's with a lot of text and description into mathematic language to make the document look more consistent.

    If I made any mistakes or if you can think of anything that can be calculated and is not included in this guide, please tell me by mailing to draojurhul@zeelandet.nl (yes it's Dutch)

    Have fun reading, ~

    PS: I didn't really know how to post that link... Can people save the file this way?
  2. darkie

    darkie fuck you i wont do what you tell me
    is a member of the Site Staffis a Smogon Social Media Contributoris a Smogon IRC AOPis a Super Moderatoris a CAP Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus
    Public Relations

    Joined:
    Dec 25, 2005
    Messages:
    6,223
    you'll have to upload it somewhere. we can't access it when you link from your computer.
  3. Actaeon

    Actaeon

    Joined:
    Jun 16, 2008
    Messages:
    51
  4. Wes

    Wes

    Joined:
    May 28, 2008
    Messages:
    339
    Wow, that are a lot of formula's, seeing them all together. Great work. Maybe you should edit the link into your first post.
  5. chaos

    chaos
    is a member of the Site Staffis a Battle Server Administratoris a Programmeris a Smogon IRC SOPis a Contributor to Smogonis an Administratoris a Tournament Director Alumnusis a Researcher Alumnus
    Owner

    Joined:
    Dec 18, 2004
    Messages:
    10,110
    cool, i'd like to see these somewhere on the site
  6. Caelum

    Caelum qibz official stalker
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Forum Moderator Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Apr 5, 2008
    Messages:
    1,656
    It's actually pretty well written, I can make minor tweaks (grammar / standardization stuff)and put in into HTML sometime tomorrow and cache it. I don't know how active the OP is (given that he or she hasn't logged in for 10 days) so that's why I'm volunteering.

    edit: I'll verify some of the more obscure formulas first with other resources just to make sure.
  7. Caelum

    Caelum qibz official stalker
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Forum Moderator Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Apr 5, 2008
    Messages:
    1,656
    Doubling Posting because I need help :(

    I was thinking of just removing a few of the formulas because "they aren't important" but I'd rather keep them if I can find references for them to confirm their accuracy. I've tried searching through Smogon & google but I obviously could have missed it so if anyone could verify and confirm the accuracy of these formulas I can finish this up.

    - The "Escape Rate" formula. I've been unable to find a secondary source to confirm the accuracy of that so if someone could provide that I would appreciate it.

    - The "Pay Day Money" Formula. I've gotten 2 different answers for this so I want to make sure.

    - The Berry Powder Formula. I found about 3 different formulas from random sites so if someone could point me to the correct one / most reliable one I'd appreciate it to confirm.

    thanks !
  8. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Smogon IRC SOp Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    This is an excellent resource.

    Since chaos wants this to be in the site, I would volunteer to compile the formulae in LaTeX and convert them as images. Otherwise the formulae would appear really amateurish in the site.

    I would like to correct some things.

    The damage formula itself isn't 100% accurate, but there's an article already dedicated to that, which this article can refer to.

    In the Critical Hits section, the way it is written holds only for RBY. There, it is actually true that the Level was the thing that doubled. From GSC onwards, this is no longer the case. The Critical Hit doubles in the place that is mentioned in the Damage formula article. Reflect and Light Screen are ignored as well in a critical hit.

    Also, Focus Energy raises the critical hit domain by 2 and not by 1 in DP, unlike what's written in the article. And high critical hit moves raise the critical hit domain by 1 and not by 2 in DP (there's a mistake: high CH moves used to increase the CH domain by 2 and not by 3 before DP!)

    In the stats formula section, I always write one formula that holds both for HP and for the other stats:

    Stat = floor((floor((2 x BS + I + floor(EV/4)) x Level / 100) + X) x N)

    where X = 5 if stat is not HP, and Level + 10 if stat is HP.

    In the status effects section, the burn attack halving effect does not actually happen to the stat in DP but it happens as per the damage formula article.

    I'll check the ball catching formula and the experiece formulae when I get the chance.
  9. Caelum

    Caelum qibz official stalker
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Forum Moderator Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Apr 5, 2008
    Messages:
    1,656
    Heh. That's actually a really good idea, for some reason I didn't even think of doing that.

    About the damage formula bit. I did catch the errors (including the critical hit thing) and I corrected it and referenced yours and Peterko's article. I didn't know the level bit was true in RBY though so thanks for that, I assumed it was just an incorrect multiplier in the original document.

    Thanks for the catches on Focus Energy & I agree the your version of the stat formula is cleaner so I'll be changing that.

    Assuming you (or anything else) confirms the accuracy of the catch rate / experience rate formulas the good bulk of this seems good to go and I can post my version with grammar / corrections before I put it on site to get it looked over sometime in the next few days.


    I still have no idea what the Berry Powder formula is but I might just not include it and hold off on it and add it in later if I get confirmation (it's not exactly the most useful of the formulas anyway lol).

    Thanks X-Act ^__^.
  10. Legend of Elune

    Legend of Elune

    Joined:
    Jan 7, 2009
    Messages:
    39
    My computer says I have no available application that can open it, what do I need to use?
  11. darkie

    darkie fuck you i wont do what you tell me
    is a member of the Site Staffis a Smogon Social Media Contributoris a Smogon IRC AOPis a Super Moderatoris a CAP Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus
    Public Relations

    Joined:
    Dec 25, 2005
    Messages:
    6,223
    it should open fine in a word processing program. if that doesn't work, try redownloading it or making sure that the file type is .doc.
  12. Legend of Elune

    Legend of Elune

    Joined:
    Jan 7, 2009
    Messages:
    39
    Alot better, thank you. .-. :3
  13. Actaeon

    Actaeon

    Joined:
    Jun 16, 2008
    Messages:
    51
    Sorry for not responding quite long...
    The escape rate formula is on bulbapedia iirc.
    Also the guide was not originally written for DP as I have little or no experience there, it was written for RSE/FRLG.
    The Berry Powder formula I can't even remember where I got that... It happened a time ago when I just had FireRed myself. But I used the formula on ingame numbers and it worked very accurate.

    For the Pay Day money, the formula's I find all boil down on the same result, which is in the guide...

    See the following links for verification of some of your doubts:
    http://bulbapedia.bulbagarden.net/wiki/Catch_rate
    http://bulbapedia.bulbagarden.net/wiki/Experience
    http://www.upokecenter.com/games/emerald/guides/crusher.php

    Thank you for posting some mistakes indeed, the critical hit thing was very obvious and the stat formula looks better I agree.
    Feel free to change stuff and it would also be a very good idea to convert it to LateX to make the formulas look better... I'm not very familiar with using LateX but the documents always look very good.
  14. Actaeon

    Actaeon

    Joined:
    Jun 16, 2008
    Messages:
    51
    The reasons I separated the Stat formulas is because when HP is calculated, the Nature is always neutral so it equals 1. Therefore, it could be neglected in the HP formula. The second is of course the 10+L or 5.

    Make sure when you read the guide, the Euclid fonts are installed on your computer. Otherwise it may indeed seem very amateuristic.
    Euclid is the font TeX / LaTeX uses for equations. Therefore, the document already has a quite good layout imo.

    You can install them here if you haven't got them yet: http://levine.sscnet.ucla.edu/general/software/jex/index1.htm
  15. Caelum

    Caelum qibz official stalker
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Forum Moderator Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Apr 5, 2008
    Messages:
    1,656
    I'm actually done with this (apologies to chaos for the delay, I got busy with other stuff in life randomly) but how do I convert Latex to images? I've never done that before (then again I've only written a paper in latex three times and someone else did the technical stuff for me mostly ;-;). I know a way I could do it, but it seems really cheap and wrong lol.

    Probably just a question for X-Act but if anyone else knows that would be nice.


    (PS: Can I just use any image service to hold them, like imageshack or something, or do I give them to chaos to host. just wondering? )
  16. darkie

    darkie fuck you i wont do what you tell me
    is a member of the Site Staffis a Smogon Social Media Contributoris a Smogon IRC AOPis a Super Moderatoris a CAP Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus
    Public Relations

    Joined:
    Dec 25, 2005
    Messages:
    6,223
    Doug can put them on cap.smogon.com if you can't find chaos (though the latter does have spring break this week so he shouldn't be too busy).
  17. Caelum

    Caelum qibz official stalker
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Forum Moderator Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Apr 5, 2008
    Messages:
    1,656
    Yeah, I don't know why I would even consider having imageshack host them in retrospect >__>. I hassle Doug or chaos when X-Act or something else helps me figure out the above. (*note to self* stop relying on others for latex help normally so you aren't dumb =/)


    (and if X-Act reads this, while I'm doing it anyway, do you want me to do Latex stuff for any of your guides with math in it? Just an offer)
  18. X-Act

    X-Act np: Biffy Clyro - Shock Shock
    is a Site Staff Alumnusis a Programmer Alumnusis a Smogon IRC SOp Alumnusis a Researcher Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Feb 17, 2006
    Messages:
    4,675
    I can compile the LateX formulae when I get the chance. My LateX program (MikTeX, a freeware version) can convert a LateX document to .pdf. Then I can copy each formula using Adobe Acrobat and convert it to any image format using Paint Shop Pro.
  19. Caelum

    Caelum qibz official stalker
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Forum Moderator Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Apr 5, 2008
    Messages:
    1,656
    Oh nice. I knew you were busy with a bunch of various things so I didn't know if you'd be able to find time for this so I took it upon myself.

    Anyway, just whenever you get around to it is fine and thanks.
  20. Lorak

    Lorak *leekspin*
    is an Artist Alumnus

    Joined:
    Jan 2, 2008
    Messages:
    3,245
    Do we know the Safari Zone formula for each generation yet? Effect of bait, rock, etc. quantified numerically.
  21. .River

    .River

    Joined:
    Jun 24, 2007
    Messages:
    1,278
    Bumping this as it is very useful and I would like to see the finalised version on the site.
  22. Unbreakable

    Unbreakable

    Joined:
    May 21, 2010
    Messages:
    348
    I have a question regarding not the formulas itself, but rather manipulating them for one's own ends. As written in the LC article, the intended order of operations is rather confusing.

    Here's what I've got so far, though:
    1. Divide the number of EP in the stat by 4.
    2. Floor the result.
    3. Add double the Pokemon's base stat value.
    4. Add the Individual Value in the stat.
    5. Multiply by the Pokemon's level.
    6. Divide by 100.
    7. Floor the result.
    8. Add X.
    9. Multiply by the nature modifier.
    10. Floor the result.

    If this is correct, I wish to be able to solve for the individual value, and I'm not sure how one would go about doing so. On the other hand, if I did eventually get such an expression, I won't need those fancy calculators anymore.

Users Viewing Thread (Users: 0, Guests: 0)