1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Cloudflare Security Issue - Change Your Passwords!

    Hello there, Guest!

    Cloudflare, the internet proxy we use to protect ourselves against DDoS and other malicious attacks, reported on 23rd February 2017 that they had patched a bug reported by Google's Project Zero that was exposing sensitive information in random requests, approximately 0.00003% of all requests, since September 2016.

    Whilst it is unlikely that any information has been leaked from this website, we recommend that all users change their passwords here on the Pokémon Online forums, as a precaution. Remember to use a unique and secure password for every site that requires one.

    We apologise for any inconvenience caused.

    Dismiss Notice

Damage Formula

Discussion in 'Development General' started by Kaphotics, May 2, 2012.

  1. Kaphotics

    Kaphotics New Member

    Joined:
    May 2, 2012
    Messages:
    2
    Likes Received:
    0
    Hey guys, just posting here to let you know that the B/W Damage Formula article has been posted at Smogon. The whole thread submission phase took less than a day so not many people got wind of it before it was uploaded.

    Here's the article.

    The Pokecheck.org team is working on an upcoming feature relating to battling, and we discovered (through debugging) that the D/P methodology of calculating damage wasn't matching up with predictions based on the Battle RNG. We then had the entire "damage" portion of the battle code debugged and then made it into a very technical but still readable article for Smogon. We've included the multiplication factors for each special case, as simple 1.x decimal multipliers are not how the game does it.

    If you have questions about the damage formula / article feel free to ask, either here or at #smogonwifi @ synirc.
     
  2. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,645
    Likes Received:
    8
    Looking at the article, at least some moves are using wrong methods, at least Pledges and Present.

    Revamping the modifier and multiplication system would be a tough thing to do, especially since the errors are very small (There's is no 1.1 or 1.3 in floating point either, there's another source for error).
     
  3. Kaphotics

    Kaphotics New Member

    Joined:
    May 2, 2012
    Messages:
    2
    Likes Received:
    0
    Present is weird. It's got 2 rand() calls if it deals damage, one to see if it heals or damages, then how much Base Power. [rand(100) and then rand(80)] -- the article didn't mention this but that's how the game does it.