Hello fellow humans, for I am a human like you

Status
Not open for further replies.
You can see some discussion of my old replays here: https://www.smogon.com/forums/threads/some-generation-1-replays-from-a-pokemon-ai.3666139/

I figured I should update you all on how I've been doing lately with some new replays!

I take advantage some super cool usage stats, so all of the teams I use are generated from those stats and all of my predictions of my foe's teams are as well.

My biggest improvement since the last update is that I can finally predict my opponent's actions. Before, I would just think "Assume my opponent will predict me perfectly, what move should I use?". Now, I think "Determine how likely my opponent is to use each of their moves, and then try to make the best move against that distribution". Currently my prediction code is quite bad, so I'm not actually that good at predicting my opponent, but I should be getting upgraded in that area in the next couple weeks or so.

Action prediction takes time (although I can certainly learn to do it faster), which means that I have less time to analyze the situation. At my weakest setting -- depth=1,0 -- I take about 0.03-0.1 seconds to decide what to do. That's quite speedy! But if I try to do a search to depth=2,1 it took nearly 200 seconds for me to make my first move. I suspect for truly super-human play, I will want something like depth=3,1 or 2,2.

To get a rough idea of what those numbers mean, the first number means "spend more time on tactical analysis", and the second number essentially means "spend more time on strategic analysis / long-term thinking". The first number must be at least 1, the second number must be at least 0.

So here are a few battles I did at depth=1,1:

* https://replay.pokemonshowdown.com/gen1ou-2004351217
* https://replay.pokemonshowdown.com/gen1ou-2004354280
* https://replay.pokemonshowdown.com/gen1ou-2004359938
* https://replay.pokemonshowdown.com/gen1ou-2004363191

At this depth of search, I take about 0.5 to 2 seconds per turn.

You might notice a common theme in a lot of my battles. I play quite well until the end-game, and then I frequently turn a likely win into a guaranteed loss by switching a whole bunch instead of just attacking. I expect this will be fixed by being able to do one level deeper search of tactical play (so depth=2,x). I also really like to use Hyper Beam with Tauros. That is for the same reason -- I don't look far enough ahead to account for the cost of the recharge turn.
 
I am getting better.

I am always one step ahead.

Especially starting on turn 25.

https://replay.pokemonshowdown.com/gen1ou-2011245875?p2

Here's some of my analysis: the early game my estimation of who was winning kept flipping back and forth, but after a few turns I pretty consistently felt like I was behind. Funny enough, Chansey's last move is Counter, I just didn't think my opponent would use Body Slam because Counter would punish it so much, so I never used Counter. I kept predicting Earthquake as the most likely move at around 50% probability.

On turn 26, however:

Predicted 100% chance of using Hyper Beam
Scored moves in 0.198342 seconds: Use Explosion for an expected score of 540
Switch to Lapras for an expected score of -4476
Use Mega Drain for an expected score of -4648
Use Psychic for an expected score of -4916
Switch to Tauros for an expected score of -5689
Switch to Chansey for an expected score of -6687
Use Sleep Powder for an expected score of -6945
Switch to Snorlax for an expected score of -7139
(This was after Tauros was locked into recharge, which displays as "using Hyper Beam", which is why it was predicted at 100%).

This was my big break. I had a guaranteed shot at taking out Tauros.

Due to a bug in my team prediction code, I had spent every turn after the first turn (as soon as Starmie revealed Hydro Pump) thinking every unrevealed Pokemon was Dragonite. This affected early play and made it harder to predict my opponent, which is part of why turn 26 was such a big deal -- all opposing Pokemon were revealed and therefore that bug was no longer relevant. Here's is my comically bad team prediction on turn 2:

Predicted Foe's Generation 1 team:
* Starmie (40.7% HP)
DVs: 0 Atk / 15 Def / 15 Spe / 15 Spc
EVs: 252 HP / 0 Atk / 252 Def / 252 Spe / 252 Spc
- Hydro Pump
- Thunder
- Psychic
- Blizzard
Dragonite (100.0% HP)
- Wrap
- Blizzard
- Hyper Beam
- Thunder Wave
Dragonite (100.0% HP)
DVs: 0 Atk / 15 Def / 15 Spe / 15 Spc
EVs: 252 HP / 0 Atk / 252 Def / 252 Spe / 252 Spc
- Agility
- Surf
- Fire Blast
- Reflect
Dragonite (100.0% HP)
- Ice Beam
- Body Slam
Dragonite (100.0% HP)
DVs: 0 Atk / 15 Def / 15 Spe / 15 Spc
EVs: 252 HP / 0 Atk / 252 Def / 252 Spe / 252 Spc
Dragonite (100.0% HP)
DVs: 0 Atk / 15 Def / 15 Spe / 15 Spc
EVs: 252 HP / 0 Atk / 252 Def / 252 Spe / 252 Spc
But like I said, turn 26 was when things started to turn around, the first time Lapras was vs Golem:

Predicted Foe's Generation 1 team:
Starmie (90.8% HP)
DVs: 0 Atk / 15 Def / 15 Spe / 15 Spc
EVs: 252 HP / 0 Atk / 252 Def / 252 Spe / 252 Spc
- Hydro Pump
- Recover
- Thunderbolt
- Thunder Wave
Gengar (81.7% HP)
Status: Sleep
- Thunderbolt
- Hypnosis
- Night Shade
- Explosion
Snorlax (12.8% HP)
Status: Freeze
- Body Slam
- Rest
- Hyper Beam
- Earthquake
* Golem (100.0% HP)
- Body Slam
- Explosion
- Earthquake
- Rock Slide
Evaluating to a depth of 1, 1...
Predicted 91.7384% chance of switching to Starmie
Predicted 5.21618% chance of switching to Gengar
Predicted 1.08059% chance of using Body Slam
Predicted 1.08059% chance of using Earthquake
Predicted 0.845786% chance of using Rock Slide
Predicted 0.038488% chance of using Explosion
Scored moves in 0.273146 seconds: Use Thunderbolt for an expected score of 2629
Use Body Slam for an expected score of 978
Use Blizzard for an expected score of 823
Use Sing for an expected score of 303
Switch to Tauros for an expected score of -1334
Switch to Chansey for an expected score of -1669
Switch to Snorlax for an expected score of -1819
Note that unless there is only one legal action, the worst possible move the opponent can make is always predicted to occur 0% of the time, which in this case was "Switch to Snorlax" (thanks to 13% HP and Freeze). We see here a very high probability assigned to the foe switching to Starmie, which is exactly what happened. There was only a 3% chance that the foe would stay in with Golem, and thus that outcome was (correctly) weighted very low in my analysis.

However, the game was still quite close, as my analysis shows for turn 28:

Evaluating to a depth of 1, 1...
Predicted 79.1422% chance of using Thunderbolt
Predicted 17.7622% chance of using Recover
Predicted 3.07458% chance of using Thunder Wave
Predicted 0.0099396% chance of switching to Golem
Predicted 0.00719657% chance of switching to Snorlax
Predicted 0.00380119% chance of switching to Gengar
Scored moves in 0.308867 seconds: Switch to Chansey for an expected score of -1887
Switch to Snorlax for an expected score of -1935
Switch to Tauros for an expected score of -2895
Use Thunderbolt for an expected score of -6455
Use Body Slam for an expected score of -6563
Use Blizzard for an expected score of -6912
Use Sing for an expected score of -7262
My prediction of the foe's actions currently assumes that they know exactly what I am capable of. This limited me earlier in the battle when I predicted the foe would know I have Counter and therefore not use Body Slam, and it limited me here. My Chansey has Softboiled, Ice Beam, Sing, Counter. The foe has a frozen and sleeping Pokemon, so I cannot use Sing or go for a freeze. At this point, staying in is just stalling and slowly worsening my position. Despite this, however, I am able to still make the right decision: If I switch there will be trouble, but if I stay it will be double.

Evaluating to a depth of 1, 1...
Predicted 77.926% chance of using Recover
Predicted 12.5646% chance of using Thunder Wave
Predicted 7.64879% chance of switching to Golem
Predicted 0.927906% chance of switching to Snorlax
Predicted 0.927906% chance of switching to Gengar
Predicted 0.00483858% chance of using Thunderbolt
Scored moves in 0.215547 seconds: Switch to Lapras for an expected score of 642
Use Ice Beam for an expected score of -172
Switch to Tauros for an expected score of -932
Use Soft-Boiled for an expected score of -1459
Use Counter for an expected score of -1501
Use Sing for an expected score of -1501
Switch to Snorlax for an expected score of -1811
I expected Recover or Thunder Wave, which at least don't kill my Lapras. But on the off chance that my foe switches to Golem, I can make forward progress. And sure enough, we end up back in Lapras v. Golem to start out turn 30. This leaves my opponent in a difficult situation: staying in means death to my Blizzard (full moveset is Blizzard, Thunderbolt, Body Slam, Sing). Switching to Starmie means death by Blizzard, Thunderbolt, or Body Slam (and I'm obviously not going to use Sing!). Switching to Snorlax kills Snorlax and deactives freeze clause. Switching to Gengar leads to a likely death and deactiving sleep clause. So my opponent has pretty even odds of a lot of moves, so I take the safe pick:

Evaluating to a depth of 1, 1...
Predicted 21.7453% chance of using Body Slam
Predicted 21.7453% chance of using Earthquake
Predicted 20.522% chance of using Rock Slide
Predicted 14.488% chance of using Explosion
Predicted 11.0845% chance of switching to Snorlax
Predicted 10.4148% chance of switching to Gengar
Scored moves in 0.235558 seconds: Use Blizzard for an expected score of 8415
Switch to Snorlax for an expected score of 2008
Switch to Chansey for an expected score of 885
Switch to Tauros for an expected score of 356
Use Body Slam for an expected score of -288
Use Thunderbolt for an expected score of -848
Use Sing for an expected score of -1598
We can see that thanks to this nice match-up for me, my best move is scoring very high, and even my less good moves still have a positive expected score. My foe chooses to save Golem for another turn and sacrifices Snorlax.

Begin turn 31
AI's Generation 1 team:
Tauros (45.6% HP)
- Hyper Beam
- Body Slam
- Blizzard
- Thunderbolt
Snorlax (100.0% HP)
- Amnesia
- Rest
- Body Slam
- Blizzard
Chansey (42.9% HP)
- Soft-Boiled
- Counter
- Sing
- Ice Beam
* Lapras (17.4% HP)
- Blizzard
- Thunderbolt
- Sing
- Body Slam

Predicted Foe's Generation 1 team:
* Starmie (8.7% HP)
DVs: 0 Atk / 15 Def / 15 Spe / 15 Spc
EVs: 252 HP / 0 Atk / 252 Def / 252 Spe / 252 Spc
- Hydro Pump
- Recover
- Thunderbolt
- Thunder Wave
Gengar (81.7% HP)
Status: Sleep
- Thunderbolt
- Hypnosis
- Night Shade
- Explosion
Golem (100.0% HP)
- Body Slam
- Explosion
- Earthquake
- Rock Slide

Evaluating to a depth of 1, 1...
Predicted 79.8601% chance of using Thunderbolt
Predicted 18.3955% chance of using Recover
Predicted 1.72982% chance of using Thunder Wave
Predicted 0.010463% chance of switching to Golem
Predicted 0.00411339% chance of switching to Gengar
Scored moves in 0.271443 seconds: Switch to Snorlax for an expected score of 6301
Switch to Chansey for an expected score of 6073
Switch to Tauros for an expected score of 5301
Use Thunderbolt for an expected score of 1506
Use Body Slam for an expected score of 1394
Use Blizzard for an expected score of 1174
Use Sing for an expected score of 841
Now it doesn't matter what I do, even if I do something really stupid like use Sing I'm still ahead. Snorlax by itself has a pretty good chance of taking out the remainder of the team.

The rest of the match is fairly straightforward, but of note is the prediction probabilities on turn 36:

Evaluating to a depth of 1, 1...
Predicted 75.6261% chance of using Recover
Predicted 19.9904% chance of using Hydro Pump
Predicted 3.46327% chance of switching to Golem
Predicted 0.920181% chance of using Thunder Wave
Scored moves in 0.113965 seconds: Use Body Slam for an expected score of 19568
Switch to Lapras for an expected score of 18675
Use Amnesia for an expected score of 18657
Use Blizzard for an expected score of 18158
Switch to Chansey for an expected score of 16796
Use Rest for an expected score of 16505
Switch to Tauros for an expected score of 16004
Snorlax is out vs Starmie and finally predicts a very high chance of Recover and a very low chance of switching to Golem, which makes the best play to start spamming Body Slam, which is correct as Starmie does try to Recover. After the foe switches to Golem, the risk was that it uses Explosion (54% chance) and takes out my Snorlax. So I switch to Tauros to take that (with a 27% chance of the foe using Earthquake, which is what happened), and then it's easy cleaning from there.

Eventually, we get to turn 46:

Evaluating to a depth of 1, 1...
Predicted 25% chance of using Hydro Pump
Predicted 25% chance of using Recover
Predicted 25% chance of using Thunderbolt
Predicted 25% chance of using Thunder Wave
Scored moves in 0.0782789 seconds: Use Thunderbolt for an expected score of 98305
Use Body Slam for an expected score of 98305
Use Blizzard for an expected score of 90194
Use Sing for an expected score of 18260
Switch to Snorlax for an expected score of 17391
Switch to Chansey for an expected score of 15509
 
Last edited:
I have laddered before (a few years ago), and I think my GXE was around 55-60%. There are a few changes I want to make before doing another ladder run, mostly around improving my ability to predict. Some of the changes were displayed in my most recent log, but I imagine I can get significantly better very soon. I am getting ready to run against a large set of old battle logs so that I can see how accurate my predictions are. This will allow me to try new ways of predicting my foe and see what works the best. Once I have that, I imagine I'll also be able to predict faster, which will allow me to evaluate more positions (hopefully to a depth of 3,1 or 2,2 -- but definitely to 2,1).
 
Status
Not open for further replies.

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

Top