Programming Pokemon Online replay player

Status
Not open for further replies.

Zarel

Not a Yuyuko fan
is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Pokemon Researcheris an Administrator
Creator of PS
Have you ever wanted to watch a Pokemon Online replay instead of just reading it?

I have, and I spent the last week developing an app that does just that:

http://pokemon.aesoft.org/

To-do:
- More sound effects
- Show HP, status, and species of pokemon in pokeballs
- Saving settings
- Pausing idle animations when pausing everything else
- Redesigned start and end screens

Recent updates (earliest to latest):
- Better move animations for punching, biting, and kicking moves
- "Recent replays" list is now newest-to-oldest, and only shows newest 200ish replays (there's a separate "all" button for all of them)
- Move animations for Night Slash, Shadow Claw; placeholder animations for many other moves
- A background
- Perspective "3D-like" effects
- Lots more animated back sprites
- Move animations for Wild Charge, Thunder Fang, Bug Buzz, Sucker Punch
- Color scheme chooser
- Basic background music support
- Support for IE7 and IE8
- Fix for a few crashes on IE9 and some old versions of Firefox
- Aqua Ring is now supported
- Move animations for Safeguard, Seed Flare, Air Slash, Air Cutter
- Redesigned replay footer
- More support for PO's newest replay format
It looks something like this:



It's not completely done yet, but it works perfectly or near-perfectly on around 90% of the replays I've tested it on. It tends to work better on ladder/tournament replays than Challenge Cup replays, since the pool of competitively viable moves is much smaller than the complete pool of moves.

Here's an example replay: http://pokemon.aesoft.org/replay-Ethereal-Sol-vs-Serei--2011-08-13

It shows off weather and Bounce animations. It doesn't show off my Substitute animations, but I assure you those are also pretty awesome.

FAQ

Q: Some pokemon don't have animated back-sprites.

A: Only around 80% of pokemon have animated back-sprites at the moment. For the ones that don't, there's nothing I can do about that. Go rip the GIF yourself or something. :/
Q: Pain Split, Wish, Life Orb, Stealth Rock, Leech Seed, Shell Bell, recoil, or draining damage/healing is being calculated incorrectly, and/or, Regenerator and Natural Cure healing aren't working!

A: You're using a replay from an old a buggy version of Pokemon Online, which doesn't contain this information. The replayer tries to guess the best it can, but it can sometimes be off by a bit. Please update to the latest version of Pokemon Online. complain to Pokemon Online about why they haven't fixed it yet.

In particular, if Life Orb isn't showing up or Stealth Rock is being calculated incorrectly, you're using a very, very old version of Pokemon Online and should really upgrade.
Q: Sometimes, when a pokemon uses Roar, Whirlwind, Dragon Tail, or Circle Throw, the sprite for an opposing nicknamed pokemon doesn't appear.

A: You're using a replay from an old version of Pokemon Online, which doesn't contain this information. The replayer tries to guess the best it can, but if the replay doesn't contain this information, there's nothing it can do. Please update to the latest version of Pokemon Online.
Q: I'm getting the error "This does not appear to be a valid Pokemon Online replay". What's wrong?

A: It's not a valid PO replay. Most likely, you're copy-and-pasting a battle log into a file. You can't do that.

You must use a replay file saved using the "save log" feature of PO. Here's a video guide: http://www.youtube.com/watch?v=SITN1X7dNFU
Q: What about Pokemon Showdown replays?

A: That's planned for the future revamp! Stay tuned, but don't hold your breath, since I have a lot of other things I want to do first.
Q: I have a feature request!

A: Cool! If it's not on the list of feature requests I'll never implement, post it to this thread! I might not implement it, but I'll explain why I will and won't. :)

Here's a list of feature requests I will never implement:

- Better calculation of Pain Split, recoil, Wish, Stealth Rock, or Leech Seed damage/healing on old Pokemon Online replays, or detection of Regenerator/Natural Cure/Life Orb.
-- I know this can be improved, but the guessing algorithms are pretty good already, and since it works perfectly with the latest version of Pokemon Online, it's a lot of work just to slightly improve support for an outdated replay format.

- Stat boosts in the form of "+3 Atk"
-- There are a lot of people arguing both sides. BlueKirby, coyotte508, and I all think the "2.5x Atk" format is better, so that's the format I'm using for now. Having an option for something this minor really isn't feasible. Sorry. :(
Q: I found a bug, now what?

A: Make sure it's not discussed earlier in the FAQ. If it isn't, report it to this thread, and remember: If you are reporting a bug, please give a link to a relevant replay.
 
It's a cool idea, but the flaws you've pointed out certainly hinder it from being too useful.

Perhaps it could be used as a teaching tool in its current state, showing examples of scouting, prediction, risk & reward, etc etc.

Very cool though! Definitely keep working on it. Maybe you could have Regenerator and Natural Cure be automatic on the pokemon that use them, as the pokemon that do always use them. (No more Own Tempo Slowbro or Serene Grace Blissey running around :P)
 

toshimelonhead

Honey Badger don't care.
is a Tiering Contributor
I think this is a great tool. The only thing I would like to see is some type of complete status update for the rest of the team. I don't know how easy this is to program but this would make it easier to point out past mistakes instead of looking at a log.
 
Looks great. However, whenever I try one of my logs, it starts out with my opponent sending out both of our leads on their side of the field and then it freezes. Know what the problem might be?

The problem might be that these are Gen 3 games.
 

Celestavian

Smooth
is a Community Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Past SPL Champion
It seems to act weird with weather starters switching in, regardless of if their weather is up or not. Every replay I've uploaded so far craps out around Turn 3, and they all seem to have the weather issue in common. Oddly, I can't fin any other replay that duplicates the problem. Besides that, I really like this thing. I have trouble visualizing stuff when reading logs, so I hope people start using this stuff for warstories.

Edit: I also noticed that if a Pokemon behind a sub faints, it's faded silhouette stays for the remainder of the match.
 
I think the best way to move it forward, simply, is to post it in the Developer's Den on Pokemon Online forums.

You'll definitely get a lot of help and support there.
 

Zarel

Not a Yuyuko fan
is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Pokemon Researcheris an Administrator
Creator of PS
It's a cool idea, but the flaws you've pointed out certainly hinder it from being too useful.
Are you sure the flaws are that great? They haven't been a problem in any of the replays I've shown so far.

I've implemented Regenerator for Mienfoo/Mienshao and Natural Cure for Staryu/Starmie; I'll wait for a better detection system before implementing it for other gens.

I think this is a great tool. The only thing I would like to see is some type of complete status update for the rest of the team. I don't know how easy this is to program but this would make it easier to point out past mistakes instead of looking at a log.
Could you clarify what you mean by "complete status update"?

Edit: Is there also a way of making these secure? ;)
Secure, as in private? Not so far. I'll eventually introduce a private replay option, but as for now I don't have one.

Looks great. However, whenever I try one of my logs, it starts out with my opponent sending out both of our leads on their side of the field and then it freezes. Know what the problem might be?

The problem might be that these are Gen 3 games.
Gen 3 is supported fine.

PO replays don't tell you who's on which side, so I had to manually write detection code. It turns out my detection code didn't work well with spaces in your name. I've fixed that; your replays work now.

http://aesoft.org/pokemon/replay-Tamaaa-vs-Crafty-Scrafty--2011-08-13
http://aesoft.org/pokemon/replay-mark-all-vs-Crafty-Scrafty--2011-08-13
http://aesoft.org/pokemon/replay-Crafty-Scrafty-vs-Treiner-Orenge--2011-08-14

It seems to act weird with weather starters switching in, regardless of if their weather is up or not. Every replay I've uploaded so far craps out around Turn 3, and they all seem to have the weather issue in common. Oddly, I can't fin any other replay that duplicates the problem. Besides that, I really like this thing. I have trouble visualizing stuff when reading logs, so I hope people start using this stuff for warstories.
Was that the naming issue? I accidentally broke nicknamed pokemon while implementing the "number of pokemon left" indicator today.

Are these the replays you're talking about?

http://aesoft.org/pokemon/replay-jrrrrrrr-vs-Hawkstarr--2011-08-11
http://aesoft.org/pokemon/replay-iconic-vs-Hawkstar--2011-05-14

They seem to work fine after all the fixes I did today. Try refreshing it?

Edit: I also noticed that if a Pokemon behind a sub faints, it's faded silhouette stays for the remainder of the match.
Fixed.
 

Super

This space for rent
is a Battle Simulator Admin Alumnusis a Programmer Alumnusis a Forum Moderator Alumnus
Dude, this is amazing. Mad props to you. I can tell you worked your ass off on this.

Shame about what it can't do though.
 

Celestavian

Smooth
is a Community Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis a Past SPL Champion
aeo said:
Was that the naming issue? I accidentally broke nicknamed pokemon while implementing the "number of pokemon left" indicator today.

Are these the replays you're talking about?

http://aesoft.org/pokemon/replay-jrrrrrrr-vs-Hawkstarr--2011-08-11
http://aesoft.org/pokemon/replay-iconic-vs-Hawkstar--2011-05-14

They seem to work fine after all the fixes I did today. Try refreshing it?
Yep! Works like a charm now. I didn't even pay attention to the fact they were all named as well.

I haven't noticed anything else wrong with those two replays, so it looks really good! No more boring logs.
 

Birkal

We have the technology.
is a Top Artistis a Top CAP Contributoris a Top Smogon Media Contributoris a Site Content Manager Alumnusis a Battle Simulator Admin Alumnusis a Senior Staff Member Alumnusis a Community Contributor Alumnus
What I could see being quite useful is the ability to speed up / slow down the matches! Then you could watch at your own pace. In the same vein, if you could "search" through different turns, that would be pretty spiffy. Just input that you want to start playing on Turn 20 and work from there.

This is super cool and keep up the good work!
 
This is great stuff, I gave it a spin and I have to say it was really impressive and very fun to watch. Fantastic work!

I put in one of my battles and here are some mistakes I observed:

- Entei took way too much damage on turn 29/30, reducing its health to 0 when it should have been around 40%. I'm not sure what happened here...
- It can't represent Leech Seed recovery very well (it must be nearly impossible to implement)
- Scyther takes normal damage from Stealth Rock.

This is a link to it for your reference: http://aesoft.org/pokemon/replay-MMF-test1-vs-No-Luck-Involved--2011-07-30

I hope you will find this useful and I am really looking forward to this getting better and better because it is one of the most exciting things I have seen in a while. Hats off to you aeo!
 

Zarel

Not a Yuyuko fan
is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Pokemon Researcheris an Administrator
Creator of PS
I'll eventually introduce a private replay option, but as for now I don't have one.
I just introduced a checkbox for uploading private replays!

It will make your replays not show up on the replay list, and give the replay a URL that can't be guessed. It's not something ridiculously secure, though, so I wouldn't recommend uploading replays in which you talk about your plans to commit murder or anything like that.

What I could see being quite useful is the ability to speed up / slow down the matches! Then you could watch at your own pace. In the same vein, if you could "search" through different turns, that would be pretty spiffy. Just input that you want to start playing on Turn 20 and work from there.
Yeah, that's been on the to-do list from the beginning. I'll do it eventually, but I can't promise anything anytime soon. :(
 

Pocket

be the upgraded version of me
is a Site Content Manager Alumnusis a Team Rater Alumnusis a Community Leader Alumnusis a Community Contributor Alumnusis a Tiering Contributor Alumnusis a Top Contributor Alumnus
Yea, I also just uploaded a battle where I embarrassingly lost to a Bulk Up Toxicroak, but Stealth Rock damage did 13% for both Gyarados and Thundurus.

http://aesoft.org/pokemon/replay-Thousand-Sunny-2nd-vs-Crametrain--2011-08-16

Also, my opponent started out with 5 Pokeballs - is this because I did not saw the 6th monster of his team?

And occasionally when I lose my mons, an extra Pokeball shows up on my side. I ended up with like 9 Pokeballs on my side lol.
 

Zarel

Not a Yuyuko fan
is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Pokemon Researcheris an Administrator
Creator of PS
- Entei took way too much damage on turn 29/30, reducing its health to 0 when it should have been around 40%. I'm not sure what happened here...
A pokemon's HP is set to 0 at the point the replayer believes is the last time it took damage before fainting - this is to deal with rounding errors.

I forgot to include Flare Blitz recoil and Spikes as possible damage sources - this has been fixed.

- It can't represent Leech Seed recovery very well (it must be nearly impossible to implement)
It currently estimates Leech Seed recovery by assuming both pokemon have the same HP stat. I can see it being off if you seed a Chansey or have Leech Seed lasting for tons of turns. Nothing I can do about that. :(

- Scyther takes normal damage from Stealth Rock.
Yeah. The replayer itself currently has no type chart, nor any idea what types pokemon are. Fixing that's on the to-do list, but I don't know if it'll be done anytime soon.

I hope you will find this useful and I am really looking forward to this getting better and better because it is one of the most exciting things I have seen in a while. Hats off to you aeo!
^_^

Yea, I also just uploaded a battle where I embarrassingly lost to a Bulk Up Toxicroak, but Stealth Rock damage did 13% for both Gyarados and Thundurus.
Yeah, as mentioned, this is on the to-do list (it's been on the to-do list on the first post of this thread ever since it was first posted, incidentally).

Also, my opponent started out with 5 Pokeballs - is this because I did not saw the 6th monster of his team?
Yep. And because PO doesn't log any pokemon that doesn't get sent out.

And occasionally when I lose my mons, an extra Pokeball shows up on my side. I ended up with like 9 Pokeballs on my side lol.
Yeah, it happens when something happens to your pokemon after they faint:

Oceanborn fainted!
Oceanborn had its energy drained!

The replay viewer assumes it happened to a different still-alive pokemon named Oceanborn, and adds it to your team. I just fixed it.
 

firecape

This is the end...
is a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
this is really cool, I can't even imagine all the work you put into it. Hopefully we can reward you with a small token of our gratitude soon enough.

I wonder what this will do to warstories
 
This is pretty sweet; it's impressive you've even added attack animations (simple yet effective!). They definitely help to visualize the flow of the battle.
 
This is fucking awesome you a genious son Can you upload battle to youtube and such? becausethat would be pure epicness
 

symphonyx64

Private messages are the best way to reach me
is a Community Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Simulator Moderator Alumnusis a Past WCoP Champion
This is fucking awesome you a genious son Can you upload battle to youtube and such? becausethat would be pure epicness
You can screen record it then upload it to Youtube. Although, I'm sure aeo has an export to video feature planned in the pipeline :P. If you could implement something along those lines, that would be super slick!
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top