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 Metagame Calculator

Discussion in 'Technical Projects' started by Seymor, May 4, 2009.

  1. Seymor

    Seymor

    Joined:
    Apr 28, 2009
    Messages:
    15
    http://www.megaupload.com/?d=I0K1U1C9

    File size should be 944.04 KB; Don't trust anything else.

    Important Notes::

    I am reaching the excel barrier. Working on the sheet is starting to be slow due to the large amount of calculations that are being done. The pokemon damage calculation has to occur at least 200 times every time the file recalculates. Due to this, I am declaring that all of the major changes to the file have been completed. Minor updates and bug fixes might come later but as of now, this is mostly done.






    New metagame sheet version 45

    Changes::
    • Random fixes which I have forgotten about
    • New Damage Tier Sheet
      • This is the last mass calculator that I will be doing. You can use a specific attack from a specific pokemon and see how much damage it will do to all of the pokemon that are used in your metagame under various conditions.
      • Those numbers for Lickylicky exploding should be correct. Essentially, ghosts and double resists are the only things that survive. Deoxy-A faints 25 times from it.
    New metagame sheet version 40

    Changes::
    • Random fixes which I have forgotten about
    • SPEED CHART!
      • There is now a speed chart that will tell you the speed of all of the pokemon in any given tier
        • Curse, Dragon Dance, Agility included
        • Choice Scarf included
        • Minimum, Half and Maximum EV support
        • Minimum/Maximum IV support
        • Nature Support
      • I have outlined the probable combinations of speed boosts, nature boosts, ev boosts etc on top and then ordered them so that the lowest speeds are on the left and the highest speeds are on the right (For mew.. some pokemon can be out of order, like Shuckle, Deoxy-S and Ninjask due to their outlandish speeds)
      • I have taken the liberty of highlighting important speed points for the overused metagame. I don't know any speed points for the underused, uber, neverused metagames.
    New metagame sheet version 36

    Changes::
    • Fixed the sheet
      • The sheet will now complain about macros being run because of the user defined functions that I use to calculate things such as variable base power moves and to do the cascade flooring.
      • Goto Tools -> Options -> OpenOffice.org -> Security -> Macro Security and set the security level to Medium or Low.
      • Alternatively; Tools -> Options -> OpenOffice.org -> Security -> Macro Security Click the Trusted Sources Tab and add in the folder that you downloaded the spreadsheet as a trusted source
    • Changes the look of the spreadsheet a bit
    • Deleted the Your Pokemon v2 Sheet.
      • This sheet is nothing like what I wanted it to be at this time. Therefore, I removed it. There are plenty of damage calculators which do the exact same thing as this did. Later, when I have more time, I will add it back in as I originally intended it to be.
    • Type Effects are now conditionally formatted
    • Vertically condensed the spreadsheet.
    • Hidden Powers are now added to the attack chart
      • Type in Hidden Power <Element> as an attack if you wish to use it. The movesets that are already in the sheet should already have that.
    • Hidden Fun Stuff
    New metagame sheet version 32

    Changes::
    • The Your pokemon damage calculator has been completely redone and is now Your Pokemon Version 2.0
    • The Metagame damage Calculator has been completely redone and is now Metagame Damage Calculator 3.0
      • Damage calculator accuracy improved
      • Support for upto 6 attacking moves and 7 defending moves
      • 1800+ movesets from smogon have been added to the calculator
        • You no longer have to input stats. You only need to imput the pokemon and the pokemon movesets name
      • The percent damage will now be red (OHKO) if over 100% and be yellow (2HKO) if over 50%
    • Calculator should be 100% accurate and takes into account quite a few moves that have variable base power.
    • Stealth Rock and Spikes damage is now calculated
    • Speed Calculations should be 100% accurate
    • There is now a sheet to store your team information as you test your team out
    • Other changes were made that I can't think of on top of the my head. We'll call these general improvements
    I'm hoping to get some good feedback now. Seeing the feedback that I recieved last time, I think there might be a lack of interest in a metagame calculator. Barring me seeing any interest this will probably be the final version that I make since I am completely satisfied with the current state of the calculator.

    Bugs::
    • Inform me.
    General::

    The metagame calculator is currently in .ods format. Ods is the format for OpenOffice.org, which is free, open source etc. As soon as I figure out a way to convert the spreadsheet into excel format without breaking it, I will.

    The background color of the cells are semi-meaningful. Anything that is light gray is meant to be an option. These can be changed either by directly typing in the value or using a drop down menu, if applicable. Anything that is light blue is a calculation. You can check them out to see whats happening in the cell, but it might be unwise to mess with them if you do not know what you are doing.

    Anything on the charts can be changed and, in fact, the calculator allows you to create your own pokemon or moves if you want (Although any novel mechanism, or really any advanced mechanism, will not be implemented).

    The background is black because I think it's cool.

    Many of the tables are currently taken from the Pokemon Resource by CardOfTheHearts. I am in the process of modifying them for my own needs.

    Furthermore, I encourage people to make corrections to the spreadsheet. Many of the attacks that are in the game are not in the spreadsheet due to me simply forgetting about them (Actually because the description of what they do is too long and the script I ran to get the data didn't account for it). I will upload and credit anybody who makes significant improvements to the spreadsheet.

    Conclusion::

    I am eager to hear some feedback on this. For now, enjoy beating the metagame.
  2. CardsOfTheHeart

    CardsOfTheHeart

    Joined:
    Aug 21, 2007
    Messages:
    1,970
    After looking at this for a bit, I have to say: this looks like it took a lot of work. (This is why I'm not taking any time right now to revamp the Resource; too much work.)

    Right now, I see one little issue that you might want to look at:

    The actual damage calculations are inaccurate.

    Yup, your damage calculator is suffering from a case of MetalKid Syndrome; the damage is slightly inflated.

    Example: WishBliss vs the DDMence that you left in the analyzer

    Case 1 - 80 SpA Blissey Ice Beam vs 4 HP Naughty Salamence

    Libelldra's calculator:
    206 Atk vs 176 Def & 332 HP (95 Base Power): 320 - 380 (96.39% - 114.46%)
    My calculator: 320 - 380
    Your calculator: 324 - 381

    Case 2 - +1 252 Atk Naughty Salamence Outrage vs 252 Def Blissey

    Libelldra's calculator:
    607 Atk vs 119 Def & 651 HP (120 Base Power): 853 - 1005 (131.03% - 154.38%)
    My calculator: 853 - 1005
    Your calculator: 856 - 1007

    The problem is that there is no FLOOR function anywhere in the formula. Remember, there has to be a floor after EVERY operation. Of course, that could complicate things when you're trying to fix it; Excel 2003 won't allow that many functions in a single cell. I'm not sure if OpenOffice has similar limits.


    A couple of smaller issues I saw:

    - Mod1, Mod2, and Mod3 are consolidated to one cell for each. Each variable in each Mod needs to be accounted for separately. For example, if Mixed Sweeper Electivire attacked RestTalk Rhyperior with Cross Chop, Solid Rock would need to be factored in and the result floored before Expert Belt; it DOES make a difference.
    (Also, Solid Rock doesn't seem to be accounted for; when I tried the above example in your calculator, the result of Mod3 was 1.2.)

    - In the simple damage calculator, STAB isn't accounted for. The STAB cell is looking for if the move's type equals one of two cells in the Moves area of the Pokemon sheet; in other words, it will always be 1.

    That's all I found at a glance. I'd have to look at it further for more possible errors.

    All in all, this looks promising. I hope that my Resource ends up more like this. Now I just have to find time to do it...
  3. Seymor

    Seymor

    Joined:
    Apr 28, 2009
    Messages:
    15
    I am aware of this. I'm going to have to think out how I can fix this a bit more than I had to think out the rest of the calculator.

    I am semi-aware of this. Didn't know that Solid Rock was acting up.

    The simple damage calculator is, in general, more inaccurate than the metagame calculator. On multiple occasions Open office thought it knew better than I did and tried to reassign things that I didn't want to be assigned (This is, of course, really my fault).

    The simple damage calculator is nowhere near done. Like I meantioned, I want the calculator to be able to account for 4 the next 4 moves on each side.


    Attack Pokemon:Move ::: Defend Pokemon:Move

    Azelf: Switch to Salamence ::: Blissey: Seismic Toss
    Salamence: Dragon Dance ::: Blissey: Switch to Metagross
    Salamence: Outrage ::: Metagross: Stone Edge
    Salamence: Outrage ::: Metagross: Stone Edge




  4. Seymor

    Seymor

    Joined:
    Apr 28, 2009
    Messages:
    15
    http://www.megaupload.com/?d=PZPMOOUT

    New metagame sheet version 32

    File Size is 385.05 KB, No idea how the size went down but I'm cool with it.


    Changes::
    • The Your pokemon damage calculator has been completely redone and is now Your Pokemon Version 2.0
    • The Metagame damage Calculator has been completely redone and is now Metagame Damage Calculator 3.0
      • Damage calculator accuracy improved
      • Support for upto 6 attacking moves and 7 defending moves
      • 1800+ movesets from smogon have been added to the calculator
        • You no longer have to input stats. You only need to imput the pokemon and the pokemon movesets name
      • The percent damage will now be red (OHKO) if over 100% and be yellow (2HKO) if over 50%
    • Calculator should be 100% accurate and takes into account quite a few moves that have variable base power.
    • Stealth Rock and Spikes damage is now calculated
    • Speed Calculations should be 100% accurate
    • There is now a sheet to store your team information as you test your team out
    • Other changes were made that I can't think of on top of the my head. We'll call these general improvements
    I'm hoping to get some good feedback now. Seeing the feedback that I recieved last time, I think there might be a lack of interest in a metagame calculator. Barring me seeing any interest this will probably be the final version that I make since I am completely satisfied with the current state of the calculator.
  5. Clocks

    Clocks

    Joined:
    Apr 9, 2009
    Messages:
    24
    I can't speak for anyone else, but I would be interested in seeing this project go on as the metagame continues to shift. (Especially with a huge shift likely when Heart Gold and Soul Silver are released.) I used the Metagame Calculator 2.0 quite a bit to help build an OU team to give me general estimates of how I wanted to place my EVs. (I used another calculator to finetune them, since it wasn't 100% accurate then.) With the damage calculator 100% accurate, this calculator will become that much more useful for developing spreads.

    As for the most recent update, I'm getting #NAME? for a ton of the readouts. I have no idea whatsoever why this is, so I really can't make any critiques at the moment. I'll edit this post if I solve this problem though.
  6. Seymor

    Seymor

    Joined:
    Apr 28, 2009
    Messages:
    15
    Which readouts?

    Is it a calculating cell (light blue or conditionally formatted, if you click on them they have some sort of formula in the cell)? Is it a validity cell (light gray, when you click on it you get a drop down box)?


    The metagame calculator uses User Defined Functions now so that I can take into account a large amount of variables using code instead of using excel. This is my first time using them so I have no idea how it reacts when placed on other peoples computers.

    I can update everything in the spreadsheet for heartgold and soul silver in about 5-10 minutes assuming that the movesets are posted on smogon and the learnsets are posted somewhere.
  7. Clocks

    Clocks

    Joined:
    Apr 9, 2009
    Messages:
    24
    It's actually both the calculating cells and validity cells. This is probably unnecessary but here's a link to a screenshot.

    http://i41.tinypic.com/2ev6hch.jpg


    It's good to hear that changing movesets isn't too time consuming of a process. I may add in some movesets from the Project Uber thread as well as other uber threats not in the analysis once I get this up and running.
  8. Seymor

    Seymor

    Joined:
    Apr 28, 2009
    Messages:
    15
    I know exactly what the problem is. All of those cells have a UDF (User defined Function) in them. I am currently on another computer and I'm gonna see what is necessary to get the spreadsheet working on this computer then post the materials. I'll also post my latest version (v36).


    Fixed.
  9. Clocks

    Clocks

    Joined:
    Apr 9, 2009
    Messages:
    24
    This version's definitely working just as needed. I haven't had the time to really mess with it yet, hence my not writing a reply yet. The only thing which I've immediately noticed is flash fire Pokemon taking damage from fire moves, volt absorb Pokemon taking damage from electric moves, and so on. However, this is not a critical problem.

    Also, the link in the first post to the most recent calculator currently hyperlinks to the old version when you click on it, despite the text reading the correct Megaupload link.

    I'll either edit this post or post again if I find more to add on about the metagame calculator.
  10. Seymor

    Seymor

    Joined:
    Apr 28, 2009
    Messages:
    15
    And that is why I list the file size.

    Also, updated. Speed chart is awesome.
  11. Mister Militia

    Mister Militia

    Joined:
    Jul 13, 2008
    Messages:
    338
    I'm DLing it. I wont have time to mess with it, but it sounds like if you can get this user friendly, It will be a lot of help for me as I never bother running calcs. Also I have a hard time knowing what pokemon can survive a + 1 Gyra, Kingdra, Tyranitar ect. This sounds like a great help.

    I'll let you know what I think when I sit down with it, but let it be known you have support!
  12. Clocks

    Clocks

    Joined:
    Apr 9, 2009
    Messages:
    24
    Something I've noticed when building an ubers team is that the metagame calculator always assumes that the opposing Pokemon will come in on a full three layers of spikes and stealth rock in regards to their health, even if you have put down that there are no stealth rocks and spikes. This usually isn't too important for OU and below, but it makes a significant impact in regard to Kyogres and water spout's maximum possible damage in ubers. (What's scary to note is that specs version is still doing an upwards of 70% to me.)

    I wish that I had more to say about this right now but I really haven't noticed much. It's really quite useful and I'm using it whenever I work on custom EV spreads and really want to take the time on them.
  13. Seymor

    Seymor

    Joined:
    Apr 28, 2009
    Messages:
    15
    Under defending pokemon, set spikes layers to 0 and stealth rock to false.
  14. Seymor

    Seymor

    Joined:
    Apr 28, 2009
    Messages:
    15
    Update, Version 45

    Updated the original post a bit. It's all very sloppy but it's 3:16 AM right now and I'm pretty lazy at the moment.
  15. simple1212

    simple1212

    Joined:
    Sep 3, 2009
    Messages:
    1

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