1. New to the forums? Check out our Mentorship Program!
    Our mentors will answer your questions and help you become a part of the community!
  2. Welcome to Smogon Forums! Please take a minute to read the rules.

Programming sim2pkm

Discussion in 'Technical Projects' started by Antar, Dec 24, 2012.

  1. Antar

    Antar Self-anointed Czar of LC UU
    is a Battle Server Administratoris a Programmeris a Super Moderatoris a Community Contributor
    Official Data Miner

    Joined:
    Feb 17, 2010
    Messages:
    3,150
    [​IMG]

    sim2pkm is a project that grew out of Challenge Cup for Wi-Fi, but while sim2pkm makes CC4Wifi obsolete, it's a far more ambitious--and, I hope, useful--application.

    sim2pkm will take any plaintext or json-format team export from the teambuilders for Pokemon Online or Pokemon Showdown and make them into pkm files for easy importing into Pokegen (or Pokesav if you're not doing BW2 stuff). While these pkm files are NOT designed to pass hack checks (and thus are unlikely to be usable for Nintendo events, random matchups or the GBU competition), the program does do some rudimentary "legality checking," meaning, for example, that an Entei that knows Extremespeed will be forced to be shiny, to have no nickname and will be put in a Cherish Ball.

    Unlike CC4Wifi, sim2pkm comes with an easy-to-use graphical interface and should be simple enough for anyone to use.

    For those of you who love random battles, the sim2pkm interface includes links to web scripts that generate either Challenge Cup or PS-style "randbats" teams.

    sim2pkm is written in Python and should be usable on all modern desktop operating systems.

    Download links:

    Other links:
    Monache likes this.
  2. aim

    aim pokeaimMD
    is an official Team Rateris a Smogon Social Media Contributoris a Tiering Contributoris Smogon Frontier's Videoroom Editor
    Mentor

    Joined:
    Jun 11, 2010
    Messages:
    586
    OMG ty bro so much - Joey
  3. Sol64

    Sol64

    Joined:
    Apr 1, 2009
    Messages:
    271
    Seems useful if you don't like having to copy everything over and back (especially for lazy bones).

    Will this have auto updates like Pokegen?
  4. Antar

    Antar Self-anointed Czar of LC UU
    is a Battle Server Administratoris a Programmeris a Super Moderatoris a Community Contributor
    Official Data Miner

    Joined:
    Feb 17, 2010
    Messages:
    3,150
    No auto-updates, sorry.

    SPEAKING OF, I recommend re-downloading if you already downloaded it: there was a pretty big bug in v1.1 regarding formes.
  5. d.hgss

    d.hgss

    Joined:
    Oct 4, 2010
    Messages:
    44
  6. NixHex

    NixHex No excuses
    is a member of the Site Staffis a Forum Moderatoris a Pokemon Researcheris a Contributor to Smogonis a Battle Server Moderator
    Moderator

    Joined:
    Oct 6, 2009
    Messages:
    2,629
    Antar, you should note that since they aren't designed to pass hack checks, these Pokemon will not even be GBU legal either.
  7. Antar

    Antar Self-anointed Czar of LC UU
    is a Battle Server Administratoris a Programmeris a Super Moderatoris a Community Contributor
    Official Data Miner

    Joined:
    Feb 17, 2010
    Messages:
    3,150
    So noted!
  8. el fizz

    el fizz

    Joined:
    Dec 31, 2008
    Messages:
    334
    THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! THE BEST! </grohl>
  9. BlakBlastoise

    BlakBlastoise

    Joined:
    Dec 4, 2007
    Messages:
    3,204
    I'm just posting in this thread to show off how many more posts i have than all the other youtube people

    but this program looks legit. Only thing better than this would be to make a thing that converts battle logs into vs recorder matches. now that would be pwr ful
  10. Antar

    Antar Self-anointed Czar of LC UU
    is a Battle Server Administratoris a Programmeris a Super Moderatoris a Community Contributor
    Official Data Miner

    Joined:
    Feb 17, 2010
    Messages:
    3,150
    I've been trying on and off to get Zarel/bmelts and Xfr/Bond697/Kaphotics into a room together to make this happen.

    Btw, just released another version (sorry) that fixes some compatibility issues with PO.
  11. chimpact

    chimpact fire nation
    is an official Team Rateris a Smogon Social Media Contributoris a Tiering Contributor

    Joined:
    Oct 22, 2006
    Messages:
    1,787
    not bad :]
  12. MikeDecIsHere

    MikeDecIsHere And the haters gonna hate hate hate hate hate.
    is a Battle Server Moderatoris a Smogon Social Media Contributor Alumnusis a Forum Moderator Alumnus
    Mentor

    Joined:
    Sep 28, 2010
    Messages:
    2,555
    I love how all the youtubers are posting here.

    GOod shit antar
    Monache likes this.
  13. AceStarThe3rd

    AceStarThe3rd

    Joined:
    Mar 20, 2012
    Messages:
    23
  14. Lunanight

    Lunanight

    Joined:
    Apr 24, 2010
    Messages:
    82
    Awesome program is awesome :)
  15. MakaiMai

    MakaiMai

    Joined:
    Mar 15, 2012
    Messages:
    32
    Just when I thought you couldn't get more awesome. :D
  16. Exclamation!

    Exclamation!

    Joined:
    Dec 21, 2010
    Messages:
    201
    This, THIS would be the best thing ever. I'd be forever gratefull for this.
  17. RotomPoison

    RotomPoison

    Joined:
    Mar 1, 2012
    Messages:
    1,369
    I downloaded CC4Wifi a few days ago then I see "makes CC4Wifi obsolete"

    Lol whatever, thanks Antar.
  18. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    779
    It wouldn't be too hard to make replays (and upload them); we've done that many months ago.

    If the Replay -> Video were to happen, all that would need to be done is just overwrite a previously existing a WiFi battle video file with a proper team / player name, the battle instructions (move choice & target) and the Battle RNG Seed. The game essentially carries out the battle again with pre-defined choices. There's a small concern with uploading: they only let you store a certain amount of battle videos per player. At Pokecheck we don't do submitting, only fetching. (because submitting tons of videos is fishy)

    I know there's other customizations that can be done like using a different trainer sprite, background, and music.

    Good place to start on 'structure' of videos is here. Even though it's from B/W times it's still the same.
  19. Antar

    Antar Self-anointed Czar of LC UU
    is a Battle Server Administratoris a Programmeris a Super Moderatoris a Community Contributor
    Official Data Miner

    Joined:
    Feb 17, 2010
    Messages:
    3,150
    It's the replay -> battle vid direction that I think most of us are interested in (the convenience of battling on a simulator married to the quality of a DS battle video).

    This, as I understand it, is the reason we don't have this today: basically, the simulator would have to written in such a way as to reproduce exactly the same instructions, based on the same seed.

    So basically, Pokemon Showdown would have to run the reverse-engineered battle engine that you guys are working on with the Vs. Player. We'd need to marry the two projects, and I'm guessing that's not an easy task.
  20. Organization Member XIV

    Organization Member XIV

    Joined:
    Oct 22, 2012
    Messages:
    669
    All the Youtubers are posting here because you all use this stuff and no one else does XD.
  21. Exclamation!

    Exclamation!

    Joined:
    Dec 21, 2010
    Messages:
    201
    Regardless of whether or not we would be able to convert battle logs into VS Recorder matches, having the sim run the exact same RNG as the cartridges would be something really, really neat to have. Even tough that crits/misses/whatever happen with the same frequency they would on the DS, the fact that they don't do so exactly when they would on the DS kind of bothers me, tbh.

    As Antar said, I think that most people would have no interest in uploading the matches to the Nintendo servers, but would just like to be able to record the actual playback as a video file. At least that's what I would like to do. Does the replay video really have to conform to the RNG if people don't plan on uploading it to the Nintendo servers? Correct me if I'm wrong, but the video you linked doesn't even follow the game mechanics, right?

    Btw, sorry for not thanking you for the program, Antar. I got so excited with the possibility of turning PS logs into VS recorder matches that I forgot. Thank you very much for your work!
  22. WreckDra

    WreckDra

    Joined:
    Mar 4, 2012
    Messages:
    415
    Found this error when converting. This is what Terminal said:File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1410, in __call__
    File "gui.py", line 51, in doTheThing
    pokes.append(sim2pkm.sim2poke(entry))
    File "/Users/russellschreiner/Downloads/sim2pkm-mac/sim2pkm/sim2pkm.py", line 286, in sim2poke
    if species[0] not in string.lowercase + string.uppercase:
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xaa in position 26: ordinal not in range(128)

    I am using the OSX version BTW but i am not quite sure what this means.
    I bet it is nothing a little Antar Magic won't fix though :]
  23. WreckDra

    WreckDra

    Joined:
    Mar 4, 2012
    Messages:
    415
    And now the script is telling terminal to quit whenever i open sim2pkm
    i am beginning to wonder if the convert and quit command is still in effect for some reason.
  24. Antar

    Antar Self-anointed Czar of LC UU
    is a Battle Server Administratoris a Programmeris a Super Moderatoris a Community Contributor
    Official Data Miner

    Joined:
    Feb 17, 2010
    Messages:
    3,150
    Macs are weird--on neither Linux nor Windows do the pastes somehow incorporate these non-ascii characters. Anyway, I fixed it. Delete the old version and install the new version at your earliest convenience.

    And yeah, if sim2pkm throws an error like that, you have to close it before reopening and trying again.
  25. WreckDra

    WreckDra

    Joined:
    Mar 4, 2012
    Messages:
    415
    Thank you very much sir
    this program is probably the best thing since sliced bread

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