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.

Technical Machine: A Pokemon AI

Discussion in 'Stark Mountain' started by david stone, Mar 29, 2010.

  1. Abacus

    Abacus

    Joined:
    Jul 31, 2007
    Messages:
    311
    Any updates? I love hearing about this project
  2. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    Technical Machine is about to fight Fred.
  3. MewMaster

    MewMaster

    Joined:
    Sep 18, 2010
    Messages:
    30
    Will this be a match on PO? If so, I assume it will have a ton of spectators.
  4. NatGeo

    NatGeo sun's coming up
    is a Contributor Alumnus

    Joined:
    Sep 4, 2010
    Messages:
    2,428
    MewMaster, it was on Pokemon Lab, and i must say I'm impressed by the intuition of Technical Machine. Great work obi, I hope this gets onto PO sometime.
  5. Abacus

    Abacus

    Joined:
    Jul 31, 2007
    Messages:
    311
    Is there a log?
  6. lars

    lars

    Joined:
    May 17, 2011
    Messages:
    265
    I didn't read all of the middle parts of the thread, but from what I saw this is an awesome idea!

    I have wondered if there is a "best possible" pokemon team. After an AI that can competitively battle is developed (which I see is in process), another AI that creates teams could be made. Then the battle AI could determine which team wins the most often.
  7. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    7! posts

    OK, I'll post the battle log for our most recent battle, along with my commentary and TM's thought process. In this battle, Technical Machine was searching two turns ahead before moving, and encountered a couple of bugs in the middle and end of the battle that caused issues.

    Remember: to read Technical Machine's evaluation of a position, lower scores always benefit the foe, higher scores always benefit Technical Machine. Therefore, Technical Machine assumes that for each response to its moves, the foe will pick the move with the lowest (most negative or least positive) score. This best response is the score of that move for Technical Machine. Technical Machine then picks its own move with the highest score (the move for which the foe's response is the weakest).

    Turn 0 (open)
    Analyzing...
    Fred2.1 sent out Jirachi (lvl 100 Jirachi)!
    Technical Machine sent out D64Sdvs (lvl 100 Hippowdon ♂)!
    D64Sdvs's Sand Stream whipped up a sandstorm!
    A sandstorm brewed!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ ** Jirachi
    ======================
    AI team:
    Technical Machine:
    Hippowdon (100% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Blissey (100% HP) @ Leftovers ** ofJKdnD
    ----Ability: Natural Cure
    ----- Wish
    ----- Softboiled
    ----- Toxic
    ----- Flamethrower
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (100% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Heatran (100% HP) @ Choice Scarf **
    ----Ability: Flash Fire
    ----- Earth Power
    ----- Fire Blast
    ----- Explosion
    ----- Dragon Pulse
    Flygon (100% HP) @ Choice Scarf **
    ----Ability: Levitate
    ----- Earthquake
    ----- U-turn
    ----- Outrage
    ----- Stone Edge
    Rotom-W (100% HP) @ Leftovers **
    ----Ability: Levitate
    ----- Shadow Ball
    ----- Hydro Pump
    ----- Thunderbolt
    ----- Trick
    Suicune (100% HP) @ Leftovers **
    ----Ability: Pressure
    ----- Calm Mind
    ----- Surf
    ----- Ice Beam
    ----- Hidden Power
    Roserade (100% HP) @ Focus Sash **
    ----Ability: Natural Cure
    ----- Toxic Spikes
    ----- Sleep Powder
    ----- Leaf Storm
    ----- Hidden Power
    ======================
    Evaluating to a depth of 2...
    Evaluating Earthquake
    ----Evaluating the foe's Iron Head
    ----Estimated score is 901
    ----Evaluating the foe's Fire Punch
    ----Estimated score is 1103
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 1227
    ----Evaluating the foe's Ice Punch
    ----Estimated score is 904
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1959
    ----Evaluating the foe switching to Flygon
    ----Estimated score is 1300
    ----Evaluating the foe switching to Rotom-W
    ----Estimated score is 1959
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 555
    ----Evaluating the foe switching to Roserade
    ----Estimated score is 736
    Estimated score is 555
    Evaluating Slack Off
    ----Evaluating the foe's Iron Head
    ----Estimated score is 525
    Evaluating Stealth Rock
    ----Evaluating the foe's Iron Head
    ----Estimated score is 1019
    ----Evaluating the foe's Fire Punch
    ----Estimated score is 1280
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 1395
    ----Evaluating the foe's Ice Punch
    ----Estimated score is 1055
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1543
    ----Evaluating the foe switching to Flygon
    ----Estimated score is 1300
    ----Evaluating the foe switching to Rotom-W
    ----Estimated score is 1543
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 813
    ----Evaluating the foe switching to Roserade
    ----Estimated score is 913
    Estimated score is 813
    Evaluating Roar
    ----Evaluating the foe's Iron Head
    ----Estimated score is 288
    Evaluating switching to Celebi
    ----Evaluating the foe's Iron Head
    ----Estimated score is -145
    Evaluating switching to Blissey
    ----Evaluating the foe's Iron Head
    ----Estimated score is -472
    Evaluating switching to Skarmory
    ----Evaluating the foe's Iron Head
    ----Estimated score is -48
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Iron Head
    ----Estimated score is -140
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Iron Head
    ----Estimated score is -278
    Use Stealth Rock for a minimum expected score of 813


    You see here that Technical Machine starts the battle like many people would: Stealth Rock.

    Turn 1 (open)
    Analyzing...
    Begin turn #1
    Fred2.1 withdrew Jirachi!
    Fred2.1 sent out Celebi (lvl 100 Celebi)!
    D64Sdvs used Stealth Rock!
    Pointed stones float in the air around your foe's team!
    The sandstorm rages.
    Celebi is buffeted by the sandstorm!
    Celebi lost 3/48 of its health!
    Celebi's Leftovers restored its health a little!
    Celebi regained 3/48 of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ ** Jirachi
    Celebi (100% HP) @ Leftovers ** Celebi
    ======================
    AI team:
    [removed because it's the same]
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Celebi (100% HP) @ Leftovers ** Celebi
    ----Ability: Natural Cure
    ----- Recover
    ----- Grass Knot
    ----- Thunder Wave
    ----- Leaf Storm
    Heatran (100% HP) @ Choice Scarf **
    ----Ability: Flash Fire
    ----- Earth Power
    ----- Fire Blast
    ----- Explosion
    ----- Dragon Pulse
    Suicune (100% HP) @ Leftovers **
    ----Ability: Pressure
    ----- Calm Mind
    ----- Surf
    ----- Ice Beam
    ----- Hidden Power
    Flygon (100% HP) @ Choice Scarf **
    ----Ability: Levitate
    ----- Earthquake
    ----- U-turn
    ----- Outrage
    ----- Stone Edge
    Rotom-H (100% HP) @ Leftovers **
    ----Ability: Levitate
    ----- Shadow Ball
    ----- Thunderbolt
    ----- Overheat
    ----- Trick
    ======================
    Evaluating to a depth of 2...
    Evaluating Earthquake
    ----Evaluating the foe's Recover
    ----Estimated score is 1000
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 54
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 900
    ----Evaluating the foe's Leaf Storm
    ----Estimated score is -748
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 2110
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 2848
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 1326
    ----Evaluating the foe switching to Flygon
    ----Estimated score is 1935
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 2848
    Estimated score is -748
    Evaluating Slack Off
    ----Evaluating the foe's Recover
    ----Estimated score is 899
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 465
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 799
    ----Evaluating the foe's Leaf Storm
    ----Estimated score is -748
    Evaluating Stealth Rock
    ----Evaluating the foe's Recover
    ----Estimated score is 899
    ----Evaluating the foe's Grass Knot
    ----Estimated score is -46
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 799
    ----Evaluating the foe's Leaf Storm
    ----Estimated score is -748
    Evaluating Roar
    ----Evaluating the foe's Recover
    ----Estimated score is 1296
    ----Evaluating the foe's Grass Knot
    ----Estimated score is -114
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 1196
    ----Evaluating the foe's Leaf Storm
    ----Estimated score is -748
    Evaluating switching to Celebi
    ----Evaluating the foe's Recover
    ----Estimated score is 1065
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 1027
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 965
    ----Evaluating the foe's Leaf Storm
    ----Estimated score is 1060
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 931
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 833
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 1220
    ----Evaluating the foe switching to Flygon
    ----Estimated score is 1033
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 921
    Estimated score is 833
    Evaluating switching to Blissey
    ----Evaluating the foe's Recover
    ----Estimated score is 1274
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 1192
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 1174
    ----Evaluating the foe's Leaf Storm
    ----Estimated score is 1164
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 880
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1000
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 1300
    ----Evaluating the foe switching to Flygon
    ----Estimated score is 931
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 1273
    Estimated score is 880
    Evaluating switching to Skarmory
    ----Evaluating the foe's Recover
    ----Estimated score is 1178
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 1070
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 1078
    ----Evaluating the foe's Leaf Storm
    ----Estimated score is 1060
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1124
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 833
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Recover
    ----Estimated score is 1124
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 904
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 1024
    ----Evaluating the foe's Leaf Storm
    ----Estimated score is 720
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Recover
    ----Estimated score is 981
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 838
    Switch to Blissey for a minimum expected score of 880


    I think that switching to Skarmory is probably the better move here than Blissey, but Technical Machine is worried about the foe switching to Heatran. Therefore, it doesn't want to needlessly switch to Skarmory when it would just have to go to Blissey or Tentacruel or something right away. Technical Machine is close in its analysis here: Blissey's switch got a score of 880; switching to Skarmory most likely would get a score of 833.

    Turn 2 (open)
    Analyzing...
    Begin turn #2
    Technical Machine withdrew D64Sdvs!
    Technical Machine sent out ofJKdnD (lvl 100 Blissey ♀)!
    Celebi used Psychic!
    ofJKdnD lost 66/651 (10%) of its health!
    The sandstorm rages.
    Celebi is buffeted by the sandstorm!
    Celebi lost 3/48 of its health!
    ofJKdnD is buffeted by the sandstorm!
    ofJKdnD lost 40/651 (6%) of its health!
    Celebi's Leftovers restored its health a little!
    Celebi regained 3/48 of its health!
    ofJKdnD's Leftovers restored its health a little!
    ofJKdnD regained 40/651 (6%) of its health!
    ======================
    AI team:
    [cut]
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ ** Jirachi
    Celebi (100% HP) @ Leftovers ** Celebi
    ----- Psychic
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Celebi (100% HP) @ Leftovers ** Celebi
    ----Ability: Natural Cure
    ----- Psychic
    ----- Recover
    ----- Grass Knot
    ----- Thunder Wave
    Heatran (100% HP) @ Choice Scarf **
    ----Ability: Flash Fire
    ----- Earth Power
    ----- Fire Blast
    ----- Explosion
    ----- Dragon Pulse
    Suicune (100% HP) @ Leftovers **
    ----Ability: Pressure
    ----- Calm Mind
    ----- Surf
    ----- Ice Beam
    ----- Hidden Power
    Flygon (100% HP) @ Choice Scarf **
    ----Ability: Levitate
    ----- Earthquake
    ----- U-turn
    ----- Outrage
    ----- Stone Edge
    Rotom-H (100% HP) @ Leftovers **
    ----Ability: Levitate
    ----- Shadow Ball
    ----- Thunderbolt
    ----- Overheat
    ----- Trick
    ======================
    Evaluating to a depth of 2...
    Evaluating Wish
    ----Evaluating the foe's Psychic
    ----Estimated score is 1209
    ----Evaluating the foe's Recover
    ----Estimated score is 1214
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 1214
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 1114
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1168
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1000
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 1128
    ----Evaluating the foe switching to Flygon
    ----Estimated score is 931
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 1335
    Estimated score is 931
    Evaluating Softboiled
    ----Evaluating the foe's Psychic
    ----Estimated score is 1203
    ----Evaluating the foe's Recover
    ----Estimated score is 1214
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 1214
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 1114
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 820
    Evaluating Toxic
    ----Evaluating the foe's Psychic
    ----Estimated score is 1123
    ----Evaluating the foe's Recover
    ----Estimated score is 1259
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 1177
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 1159
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 785
    Evaluating Flamethrower
    ----Evaluating the foe's Psychic
    ----Estimated score is 1148
    ----Evaluating the foe's Recover
    ----Estimated score is 1284
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 1202
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 1184
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1200
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1000
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 1258
    ----Evaluating the foe switching to Flygon
    ----Estimated score is 956
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 1403
    Estimated score is 956
    Evaluating switching to Hippowdon
    ----Evaluating the foe's Psychic
    ----Estimated score is 359
    Evaluating switching to Celebi
    ----Evaluating the foe's Psychic
    ----Estimated score is 791
    Evaluating switching to Skarmory
    ----Evaluating the foe's Psychic
    ----Estimated score is 797
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Psychic
    ----Estimated score is 138
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Psychic
    ----Estimated score is 963
    ----Evaluating the foe's Recover
    ----Estimated score is 987
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 674
    Use Flamethrower for a minimum expected score of 956


    I think it's interesting here that Flamethrower could ever be the "safest" move when the foe has Heatran. This is a big advantage to depth = 2 over depth = 1. Even though Heatran can switch in and absorb Flash Fire, what does it do after that? Then it's just hitting like Specs Heatran with its 8 PP Fire Blast against a Wish Softboiled Blissey. Technical Machine identifies that this isn't a true gain for Heatran and thus doesn't care about it. It's more concerned about the physical attacker Flygon coming in and damaging stuff. It can't see far enough ahead to realize that Skarmory can just come in and use Spikes then.

    Turn 3 (open)
    Analyzing...
    Begin turn #3
    Celebi used Psychic!
    ofJKdnD lost 61/651 (9%) of its health!
    ofJKdnD used Flamethrower!
    A critical hit!
    It's super effective!
    Celebi lost 29/48 of its health!
    The sandstorm rages.
    Celebi is buffeted by the sandstorm!
    Celebi lost 3/48 of its health!
    ofJKdnD is buffeted by the sandstorm!
    ofJKdnD lost 40/651 (6%) of its health!
    Celebi's Leftovers restored its health a little!
    Celebi regained 3/48 of its health!
    ofJKdnD's Leftovers restored its health a little!
    ofJKdnD regained 40/651 (6%) of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ ** Jirachi
    Celebi (39.77900552486188% HP) @ Leftovers ** Celebi
    ----- Psychic
    ======================
    AI team:
    [same]
    ======================
    Predicting...
    ======================
    Foe team:
    [same]
    Celebi (39.77900552486188% HP) @ Leftovers ** Celebi
    [same]
    ======================
    Evaluating to a depth of 2...
    Evaluating Wish
    ----Evaluating the foe's Psychic
    ----Estimated score is 1573
    ----Evaluating the foe's Recover
    ----Estimated score is 1379
    ----Evaluating the foe's Grass Knot
    ----Estimated score is 1578
    ----Evaluating the foe's Thunder Wave
    ----Estimated score is 1478
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1806
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1617
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 1805
    ----Evaluating the foe switching to Flygon
    ----Estimated score is 1553
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 2012
    Estimated score is 1379
    Evaluating Softboiled
    ----Evaluating the foe's Psychic
    ----Estimated score is 1573
    ----Evaluating the foe's Recover
    ----Estimated score is 1379
    Evaluating Toxic
    ----Evaluating the foe's Psychic
    ----Estimated score is 1562
    ----Evaluating the foe's Recover
    ----Estimated score is 1327
    Evaluating Flamethrower
    ----Evaluating the foe's Psychic
    ----Estimated score is 2520
    ----Evaluating the foe's Recover
    ----Estimated score is 1326
    Evaluating switching to Hippowdon
    ----Evaluating the foe's Psychic
    ----Estimated score is 564
    Evaluating switching to Celebi
    ----Evaluating the foe's Psychic
    ----Estimated score is 965
    Evaluating switching to Skarmory
    ----Evaluating the foe's Psychic
    ----Estimated score is 1274
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Psychic
    ----Estimated score is 605
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Psychic
    ----Estimated score is 1496
    ----Evaluating the foe's Recover
    ----Estimated score is 1117
    Use Wish for a minimum expected score of 1379


    This is another interesting thing to come out of this battle. Most people would think that if Flamethrower was the best move last turn, it's certainly the best move this turn, when Celebi is weakened! Technical Machine analyzes things differently. It sees that it would need another CH to kill Celebi with Flamethrower, so it decides to make sure it will have full health at the end of two turns, while the foe will be slightly damaged from Flamethrower. I consider this to be a poor, overly cautious play, but Celebi isn't really a big threat to this team.

    Turn 4 (open)
    Analyzing...
    Begin turn #4
    Fred2.1 withdrew Celebi!
    Fred2.1 sent out Tyranitar (lvl 100 Tyranitar ♂)!
    Tyranitar's Sand Stream whipped up a sandstorm!
    Pointed stones dug into Tyranitar!
    Tyranitar lost 6/48 of its health!
    ofJKdnD used Wish!
    ofJKdnD made a wish!
    The sandstorm rages.
    ofJKdnD is buffeted by the sandstorm!
    ofJKdnD lost 40/651 (6%) of its health!
    ofJKdnD's Leftovers restored its health a little!
    ofJKdnD regained 40/651 (6%) of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ ** Jirachi
    Celebi (39.77900552486188% HP) @ Leftovers ** Celebi
    ----- Psychic
    Tyranitar (87.569060773480658% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ======================
    AI team:
    [same]
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Celebi (39.77900552486188% HP) @ Leftovers ** Celebi
    ----Ability: Natural Cure
    ----- Psychic
    ----- Recover
    ----- Grass Knot
    ----- Thunder Wave
    Tyranitar (87.569060773480658% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Crunch
    ----- Stone Edge
    ----- Earthquake
    ----- Pursuit
    Heatran (100% HP) @ Choice Scarf **
    ----Ability: Flash Fire
    ----- Earth Power
    ----- Fire Blast
    ----- Explosion
    ----- Dragon Pulse
    Suicune (100% HP) @ Leftovers **
    ----Ability: Pressure
    ----- Calm Mind
    ----- Surf
    ----- Ice Beam
    ----- Hidden Power
    Rotom-H (100% HP) @ Leftovers **
    ----Ability: Levitate
    ----- Shadow Ball
    ----- Thunderbolt
    ----- Overheat
    ----- Trick
    ======================
    Evaluating to a depth of 2...
    Evaluating Wish
    ----Evaluating the foe's Crunch
    ----Estimated score is 1623
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1436
    ----Evaluating the foe's Earthquake
    ----Estimated score is 1805
    ----Evaluating the foe's Pursuit
    ----Estimated score is 1907
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1665
    ----Evaluating the foe switching to Celebi
    ----Estimated score is 1879
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1845
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 2085
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 2058
    Estimated score is 1436
    Evaluating Softboiled
    ----Evaluating the foe's Crunch
    ----Estimated score is 1686
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1655
    ----Evaluating the foe's Earthquake
    ----Estimated score is 1845
    ----Evaluating the foe's Pursuit
    ----Estimated score is 1912
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1665
    ----Evaluating the foe switching to Celebi
    ----Estimated score is 1879
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1845
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 2085
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 2058
    Estimated score is 1655
    Evaluating Toxic
    ----Evaluating the foe's Crunch
    ----Estimated score is 1863
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1673
    ----Evaluating the foe's Earthquake
    ----Estimated score is 1991
    ----Evaluating the foe's Pursuit
    ----Estimated score is 2193
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1665
    ----Evaluating the foe switching to Celebi
    ----Estimated score is 2130
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1845
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 2374
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 2345
    Estimated score is 1665
    Evaluating Flamethrower
    ----Evaluating the foe's Crunch
    ----Estimated score is 1720
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1549
    Evaluating switching to Hippowdon
    ----Evaluating the foe's Crunch
    ----Estimated score is 2059
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 2069
    ----Evaluating the foe's Earthquake
    ----Estimated score is 2069
    ----Evaluating the foe's Pursuit
    ----Estimated score is 2069
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 2050
    ----Evaluating the foe switching to Celebi
    ----Estimated score is 1260
    Evaluating switching to Celebi
    ----Evaluating the foe's Crunch
    ----Estimated score is 1433
    Evaluating switching to Skarmory
    ----Evaluating the foe's Crunch
    ----Estimated score is 1821
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1823
    ----Evaluating the foe's Earthquake
    ----Estimated score is 1831
    ----Evaluating the foe's Pursuit
    ----Estimated score is 1831
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1769
    ----Evaluating the foe switching to Celebi
    ----Estimated score is 1958
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1479
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Crunch
    ----Estimated score is 1698
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1408
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Crunch
    ----Estimated score is 1568
    Use Toxic for a minimum expected score of 1665


    But the poor, overly cautious play pays off as it allows a free switch into Tyranitar by Hippowdon or Skarmory.

    However, Technical Machine fails to take advantage of this because of a limitation of its team predictor. It believes Tyranitar to be using a Choice Scarf, and therefore it will fail to KO with Stone Edge unless it gets a critical hit. It rates the odds of that happening as being not as important as hitting Tyranitar with Toxic. However, if Tyranitar has a Choice Band (51% as likely as a Choice Scarf), then Blissey is dead.

    Turn 5 (open)
    Analyzing...
    Begin turn #5
    Tyranitar used Stone Edge!
    ofJKdnD lost 524/651 (80%) of its health!
    ofJKdnD fainted!
    The sandstorm rages.
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ ** Jirachi
    Celebi (39.77900552486188% HP) @ Leftovers ** Celebi
    ----- Psychic
    Tyranitar (87.569060773480658% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ======================
    AI team:
    [same]
    Blissey (0% HP) @ Leftovers ** ofJKdnD
    [same]
    ======================
    Predicting...
    ======================
    Foe team:
    [same]
    ======================
    Evaluating to a depth of 2...
    Evaluating switching to Hippowdon
    Estimated score is -67
    Evaluating switching to Celebi
    Evaluating switching to Skarmory
    Evaluating switching to Tentacruel
    Evaluating switching to Spiritomb
    Switch to Hippowdon for a minimum expected score of -67


    Hippowdon is clearly the safest switch into such a powerful Tyranitar. But here we see a limitation of my log analyzer. It currently doesn't do reverse damage calculations to try to identify items. Therefore, it still believes Tyranitar to have a Choice Scarf instead of a Choice Band.

    Replacing on turn 5 (open)
    Analyzing...
    Technical Machine sent out D64Sdvs (lvl 100 Hippowdon ♂)!
    D64Sdvs's Sand Stream whipped up a sandstorm!
    ======================
    AI team:
    Technical Machine:
    Hippowdon (100% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (100% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ ** Jirachi
    Celebi (39.77900552486188% HP) @ Leftovers ** Celebi
    ----- Psychic
    Tyranitar (87.569060773480658% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ======================
    Predicting...
    ======================
    Foe team:
    [same]
    ======================
    Evaluating to a depth of 2...
    Evaluating Earthquake
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 843
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 936
    ----Evaluating the foe switching to Celebi
    ----Estimated score is -214
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1260
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 126
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 1260
    Estimated score is -214
    Evaluating Slack Off
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 161
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 142
    ----Evaluating the foe switching to Celebi
    ----Estimated score is -648
    Evaluating Stealth Rock
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 134
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 142
    ----Evaluating the foe switching to Celebi
    ----Estimated score is -648
    Evaluating Roar
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -103
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 20
    ----Evaluating the foe switching to Celebi
    ----Estimated score is 172
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 89
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 89
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 87
    Estimated score is -103
    Evaluating switching to Celebi
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -336
    Evaluating switching to Skarmory
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -299
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -949
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -459
    Use Roar for a minimum expected score of -103


    Smart move here. The worst thing Tyranitar can do is a weak Stone Edge. Hippowdon uses Roar so that everything it can switch to gets hit by SR, plus whatever Tyranitar chooses to switch to. Even if Tyranitar predicts the Roar and stays in, it's not doing much, and Hippowdon gets to face a random opponent instead of something the foe wants to bring in.

    Notice how it only analyzes Stone Edge and switching. It believes the foe to have a Choice item, and therefore doesn't evaluate moves the foe cannot make. This is why I think Technical Machine would do great with a choice item team: It would only have to evaluate up to 6 moves on most turns, instead of 11. This could allow it to search further ahead.

    Turn 6 (open)
    Analyzing...
    Begin turn #6
    Fred2.1 withdrew Tyranitar!
    Fred2.1 sent out Celebi (lvl 100 Celebi)!
    Pointed stones dug into Celebi!
    Celebi lost 6/48 of its health!
    D64Sdvs used Roar!
    Fred2.1 sent out Tyranitar (lvl 100 Tyranitar ♂)!
    Tyranitar's Sand Stream whipped up a sandstorm!
    Pointed stones dug into Tyranitar!
    Tyranitar lost 6/48 of its health!
    The sandstorm rages.
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ ** Jirachi
    Celebi (27.348066298342541% HP) @ Leftovers ** Celebi
    ----- Psychic
    Tyranitar (75.138121546961329% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ======================
    AI team:
    [same]
    ======================
    Predicting...
    ======================
    Foe team:
    [same]
    ======================
    Evaluating to a depth of 2...
    Evaluating Earthquake
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1257
    ----Evaluating the foe's Crunch
    ----Estimated score is 1151
    ----Evaluating the foe's Earthquake
    ----Estimated score is 1206
    ----Evaluating the foe's Pursuit
    ----Estimated score is 1277
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1373
    ----Evaluating the foe switching to Celebi
    ----Estimated score is 1156
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1754
    ----Evaluating the foe switching to Suicune
    ----Estimated score is 384
    ----Evaluating the foe switching to Rotom-H
    ----Estimated score is 1754
    Estimated score is 384
    Evaluating Slack Off
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 594
    ----Evaluating the foe's Crunch
    ----Estimated score is 576
    ----Evaluating the foe's Earthquake
    ----Estimated score is 594
    ----Evaluating the foe's Pursuit
    ----Estimated score is 594
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 456
    ----Evaluating the foe switching to Celebi
    ----Estimated score is -153
    Evaluating Stealth Rock
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 567
    ----Evaluating the foe's Crunch
    ----Estimated score is 439
    ----Evaluating the foe's Earthquake
    ----Estimated score is 515
    ----Evaluating the foe's Pursuit
    ----Estimated score is 586
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 456
    ----Evaluating the foe switching to Celebi
    ----Estimated score is -153
    Evaluating Roar
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 234
    Evaluating switching to Celebi
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -82
    Evaluating switching to Skarmory
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -45
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -688
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -197
    Use Earthquake for a minimum expected score of 384


    Now it can safely Earthquake because the foe cannot bring in Celebi and survive. The worst it can do is switch to the predicted Suicune. It doesn't want to risk Roar because Tyranitar gets in a free hit, and Roar may bring in Celebi and allow it to Recover or Grass Knot Hippowdon.

    If you're wondering why it thinks the foe switching Suicune into Earthquake is worse than Rotom-H, it's because of what happens next. Rotom-H at least gets hit by Stealth Rock, and since it doesn't predict a Trick variant, it feels like it can safely take Rotom on.

    Turn 7 (open)
    Analyzing...
    Begin turn #7
    Fred2.1 withdrew Tyranitar!
    Fred2.1 sent out Celebi (lvl 100 Celebi)!
    Pointed stones dug into Celebi!
    Celebi lost 6/48 of its health!
    D64Sdvs used Earthquake!
    A critical hit!
    It's not very effective...
    Celebi lost 7/48 of its health!
    Celebi fainted!
    The sandstorm rages.
    Fred2.1 sent out Machamp (lvl 100 Machamp ♂)!
    Pointed stones dug into Machamp!
    Machamp lost 3/48 of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ ** Jirachi
    Celebi (0% HP) @ Leftovers ** Celebi
    ----- Psychic
    Tyranitar (75.138121546961329% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (100% HP) @ ** Machamp
    ======================
    AI team:
    Technical Machine:
    Hippowdon (100% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (100% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Celebi (0% HP) @ Leftovers ** Celebi
    ----Ability: Natural Cure
    ----- Psychic
    ----- Recover
    ----- Grass Knot
    ----- Thunder Wave
    Tyranitar (75.138121546961329% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ----- Crunch
    ----- Earthquake
    ----- Pursuit
    Machamp (100% HP) @ Lum Berry ** Machamp
    ----Ability: No Guard
    ----- DynamicPunch
    ----- Payback
    ----- Bullet Punch
    ----- Ice Punch
    Heatran (100% HP) @ Choice Scarf **
    ----Ability: Flash Fire
    ----- Earth Power
    ----- Fire Blast
    ----- Explosion
    ----- Dragon Pulse
    Suicune (100% HP) @ Leftovers **
    ----Ability: Pressure
    ----- Calm Mind
    ----- Surf
    ----- Ice Beam
    ----- Hidden Power
    ======================
    Evaluating to a depth of 2...
    Evaluating switching to Celebi
    Estimated score is 1054
    Switch to Celebi for a minimum expected score of 1054


    And here you see the biggest bug in my program at the time of this battle. I have since fixed it, but the issue came from the foe switching, and then the Pokemon they switch to being replaced. This led to the switch being overwritten, so the Pokemon was never properly fainted. This is why you see Technical Machine evaluating switching to Celebi and nothing else, with no foe responses. It's just confused about what's happening in the battle. This bug will lead to Technical Machine making a few strange plays later on in the battle that will prove quite costly.

    Turn 8 (open)
    Analyzing...
    Begin turn #8
    Technical Machine withdrew D64Sdvs!
    Technical Machine sent out OLfxghg3 (lvl 100 Celebi)!
    Machamp used DynamicPunch!
    It's not very effective...
    OLfxghg3 lost 76/404 (18%) of its health!
    OLfxghg3 became confused!
    The sandstorm rages.
    OLfxghg3 is buffeted by the sandstorm!
    OLfxghg3 lost 25/404 (6%) of its health!
    Machamp is buffeted by the sandstorm!
    Machamp lost 3/48 of its health!
    OLfxghg3's Leftovers restored its health a little!
    OLfxghg3 regained 25/404 (6%) of its health!
    Machamp's Leftovers restored its health a little!
    Machamp regained 3/48 of its health!
    ======================
    AI team:
    Technical Machine:
    Hippowdon (100% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (100% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ ** Jirachi
    Celebi (0% HP) @ Leftovers ** Celebi
    ----- Psychic
    Tyranitar (75.138121546961329% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (100% HP) @ ** Machamp
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Celebi (0% HP) @ Leftovers ** Celebi
    ----Ability: Natural Cure
    ----- Psychic
    ----- Recover
    ----- Grass Knot
    ----- Thunder Wave
    Tyranitar (75.138121546961329% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ----- Crunch
    ----- Earthquake
    ----- Pursuit
    Machamp (100% HP) @ Lum Berry ** Machamp
    ----Ability: No Guard
    ----- DynamicPunch
    ----- Payback
    ----- Bullet Punch
    ----- Ice Punch
    Heatran (100% HP) @ Choice Scarf **
    ----Ability: Flash Fire
    ----- Earth Power
    ----- Fire Blast
    ----- Explosion
    ----- Dragon Pulse
    Suicune (100% HP) @ Leftovers **
    ----Ability: Pressure
    ----- Calm Mind
    ----- Surf
    ----- Ice Beam
    ----- Hidden Power
    ======================
    Evaluating to a depth of 2...
    Evaluating switching to Hippowdon
    Estimated score is 786
    Switch to Hippowdon for a minimum expected score of 786


    Notice how it believes its own team to be at 100% health for everything, when Celebi is actually down in HP. Also note again that the bug continues to destroy Technical Machine's evaluation of the situation, where it only evaluates switching to the first legal switch (now Hippowdon), without considering any foe responses. This bug would likely continue until the foe switches, to try and reset Technical Machine's view of what the foe can do, and the rest of the battle will be marred by this bug.

    Turn 9 (open)
    Analyzing...
    Begin turn #9
    Technical Machine withdrew OLfxghg3!
    Technical Machine sent out D64Sdvs (lvl 100 Hippowdon ♂)!
    D64Sdvs's Sand Stream whipped up a sandstorm!
    Fred2.1 withdrew Machamp!
    Fred2.1 sent out Jirachi (lvl 100 Jirachi)!
    Pointed stones dug into Jirachi!
    Jirachi lost 3/48 of its health!
    The sandstorm rages.
    Jirachi's Leftovers restored its health a little!
    Jirachi regained 3/48 of its health!
    ======================
    AI team:
    Technical Machine:
    Hippowdon (100% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (100% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    Tyranitar (75.138121546961329% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (100% HP) @ ** Machamp
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Tyranitar (75.138121546961329% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ----- Crunch
    ----- Earthquake
    ----- Pursuit
    Machamp (100% HP) @ Lum Berry ** Machamp
    ----Ability: No Guard
    ----- DynamicPunch
    ----- Payback
    ----- Bullet Punch
    ----- Ice Punch
    Heatran (100% HP) @ Choice Scarf **
    ----Ability: Flash Fire
    ----- Earth Power
    ----- Fire Blast
    ----- Explosion
    ----- Dragon Pulse
    Gyarados (100% HP) @ Leftovers **
    ----Ability: Intimidate
    ----- Waterfall
    ----- Dragon Dance
    ----- Stone Edge
    ----- Earthquake
    ======================
    Evaluating to a depth of 2...
    Evaluating Earthquake
    ----Evaluating the foe's Iron Head
    ----Estimated score is 1916
    ----Evaluating the foe's Fire Punch
    ----Estimated score is 2121
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 2208
    ----Evaluating the foe's Ice Punch
    ----Estimated score is 1965
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 2943
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 2131
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 3198
    ----Evaluating the foe switching to Gyarados
    ----Estimated score is 1290
    Estimated score is 1290
    Evaluating Slack Off
    ----Evaluating the foe's Iron Head
    ----Estimated score is 1439
    ----Evaluating the foe's Fire Punch
    ----Estimated score is 1415
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 1451
    ----Evaluating the foe's Ice Punch
    ----Estimated score is 1394
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 1588
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1587
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1589
    ----Evaluating the foe switching to Gyarados
    ----Estimated score is 1290
    Evaluating Stealth Rock
    ----Evaluating the foe's Iron Head
    ----Estimated score is 1390
    ----Evaluating the foe's Fire Punch
    ----Estimated score is 1403
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 1451
    ----Evaluating the foe's Ice Punch
    ----Estimated score is 1288
    Evaluating Roar
    ----Evaluating the foe's Iron Head
    ----Estimated score is 1404
    ----Evaluating the foe's Fire Punch
    ----Estimated score is 1450
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 1503
    ----Evaluating the foe's Ice Punch
    ----Estimated score is 1308
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 1640
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1576
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1641
    ----Evaluating the foe switching to Gyarados
    ----Estimated score is 1691
    Estimated score is 1308
    Evaluating switching to Celebi
    ----Evaluating the foe's Iron Head
    ----Estimated score is 1167
    Evaluating switching to Skarmory
    ----Evaluating the foe's Iron Head
    ----Estimated score is 1198
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Iron Head
    ----Estimated score is 1260
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Iron Head
    ----Estimated score is 1035
    Use Roar for a minimum expected score of 1308


    So what looked like a brilliant switch to lure out Jirachi was actually just a bugged move that got lucky. Fortunately, now that the foe has switched, Technical Machine has some sense of what to do again. It even correctly removed Celebi from the foe's team now that it's fainted. However, this error will come up again later to haunt Technical Machine.

    Also take note of how this ruined the log analyzer with regard to Machamp's item. We know from the log that Machamp has Leftovers, but because of that bugged few turns, Technical Machine believed the foe to have a 0% HP Celebi out, and thus didn't properly apply Leftovers to Machamp.

    Turn 10 (open)
    Analyzing...
    Begin turn #10
    Fred2.1 withdrew Jirachi!
    Fred2.1 sent out Machamp (lvl 100 Machamp ♂)!
    Pointed stones dug into Machamp!
    Machamp lost 3/48 of its health!
    D64Sdvs used Roar!
    Fred2.1 sent out Starmie (lvl 100 Starmie)!
    Pointed stones dug into Starmie!
    Starmie lost 6/48 of its health!
    The sandstorm rages.
    Starmie is buffeted by the sandstorm!
    Starmie lost 3/48 of its health!
    Starmie's Leftovers restored its health a little!
    Starmie regained 3/48 of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    Tyranitar (75.138121546961329% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (93.859649122807014% HP) @ ** Machamp
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ======================
    AI team:
    [same]
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Tyranitar (75.138121546961329% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ----- Crunch
    ----- Earthquake
    ----- Pursuit
    Machamp (93.859649122807014% HP) @ Lum Berry ** Machamp
    ----Ability: No Guard
    ----- DynamicPunch
    ----- Payback
    ----- Bullet Punch
    ----- Ice Punch
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----Ability: Natural Cure
    ----- Thunderbolt
    ----- Ice Beam
    ----- Surf
    ----- Rapid Spin
    Heatran (100% HP) @ Choice Scarf **
    ----Ability: Flash Fire
    ----- Earth Power
    ----- Fire Blast
    ----- Explosion
    ----- Dragon Pulse
    ======================
    Evaluating to a depth of 2...
    Evaluating Earthquake
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 2328
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 461
    ----Evaluating the foe's Surf
    ----Estimated score is 285
    ----Evaluating the foe's Rapid Spin
    ----Estimated score is 1549
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 2755
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 2791
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 2671
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 3046
    Estimated score is 285
    Evaluating Slack Off
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 1068
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 843
    ----Evaluating the foe's Surf
    ----Estimated score is 764
    ----Evaluating the foe's Rapid Spin
    ----Estimated score is 441
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1651
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 2109
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1651
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 2110
    Estimated score is 441
    Evaluating Stealth Rock
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 1068
    ----Evaluating the foe's Ice Beam
    ----Estimated score is -84
    Evaluating Roar
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 1871
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 858
    ----Evaluating the foe's Surf
    ----Estimated score is 575
    ----Evaluating the foe's Rapid Spin
    ----Estimated score is 1014
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1937
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 2007
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1940
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 2008
    Estimated score is 575
    Evaluating switching to Celebi
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 1116
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 646
    ----Evaluating the foe's Surf
    ----Estimated score is 1066
    ----Evaluating the foe's Rapid Spin
    ----Estimated score is 476
    Evaluating switching to Skarmory
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is -288
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 542
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 965
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 892
    ----Evaluating the foe's Surf
    ----Estimated score is 797
    ----Evaluating the foe's Rapid Spin
    ----Estimated score is 586
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1074
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 1263
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1482
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1152
    Estimated score is 586
    Switch to Spiritomb for a minimum expected score of 586


    It is interesting that Technical Machine chooses to go to Spiritomb, even though I don't have Ghosts blocking Rapid Spin implemented yet. However, Spiritomb is actually going to be very bad for Technical Machine here, as I forgot to remove Rest from its move set (and it doesn't quite understand how Rest works).

    Turn 11 (open)
    Analyzing...
    Begin turn #11
    Technical Machine withdrew D64Sdvs!
    Technical Machine sent out Dls40sjsd (lvl 100 Spiritomb ♂)!
    Dls40sjsd is exerting its Pressure!
    Starmie used Surf!
    Dls40sjsd lost 106/304 (34%) of its health!
    The sandstorm rages.
    Starmie is buffeted by the sandstorm!
    Starmie lost 3/48 of its health!
    Dls40sjsd is buffeted by the sandstorm!
    Dls40sjsd lost 19/304 (6%) of its health!
    Starmie's Leftovers restored its health a little!
    Starmie regained 3/48 of its health!
    Dls40sjsd's Leftovers restored its health a little!
    Dls40sjsd regained 19/304 (6%) of its health!
    ======================
    AI team:
    Technical Machine:
    Hippowdon (100% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (65.131578947368425% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    Tyranitar (75.138121546961329% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (93.859649122807014% HP) @ ** Machamp
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----- Surf
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Tyranitar (75.138121546961329% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ----- Crunch
    ----- Earthquake
    ----- Pursuit
    Machamp (93.859649122807014% HP) @ Lum Berry ** Machamp
    ----Ability: No Guard
    ----- DynamicPunch
    ----- Payback
    ----- Bullet Punch
    ----- Ice Punch
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----Ability: Natural Cure
    ----- Surf
    ----- Thunderbolt
    ----- Ice Beam
    ----- Rapid Spin
    Heatran (100% HP) @ Choice Scarf **
    ----Ability: Flash Fire
    ----- Earth Power
    ----- Fire Blast
    ----- Explosion
    ----- Dragon Pulse
    ======================
    Evaluating to a depth of 2...
    Evaluating Calm Mind
    ----Evaluating the foe's Surf
    ----Estimated score is 758
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 889
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 775
    ----Evaluating the foe's Rapid Spin
    ----Estimated score is 305
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 987
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 1178
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1310
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1189
    Estimated score is 305
    Evaluating Dark Pulse
    ----Evaluating the foe's Surf
    ----Estimated score is 325
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 1048
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 911
    ----Evaluating the foe's Rapid Spin
    ----Estimated score is 898
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1061
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 1166
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1353
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1229
    Estimated score is 325
    Evaluating Psychic
    ----Evaluating the foe's Surf
    ----Estimated score is -257
    Evaluating Rest
    ----Evaluating the foe's Surf
    ----Estimated score is 794
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 909
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 784
    ----Evaluating the foe's Rapid Spin
    ----Estimated score is 481
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 947
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 1066
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1383
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 964
    Estimated score is 481
    Evaluating switching to Hippowdon
    ----Evaluating the foe's Surf
    ----Estimated score is -740
    Evaluating switching to Celebi
    ----Evaluating the foe's Surf
    ----Estimated score is 648
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 698
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 228
    Evaluating switching to Skarmory
    ----Evaluating the foe's Surf
    ----Estimated score is -537
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Surf
    ----Estimated score is 398
    Use Rest for a minimum expected score of 481


    And there is the second biggest bug in this battle for Technical Machine. It doesn't understand how Rest works, so it uses it.

    Turn 12 (open)
    Analyzing...
    Begin turn #12
    Fred2.1 withdrew Starmie!
    Fred2.1 sent out Tyranitar (lvl 100 Tyranitar ♂)!
    Tyranitar's Sand Stream whipped up a sandstorm!
    Pointed stones dug into Tyranitar!
    Tyranitar lost 6/48 of its health!
    Dls40sjsd used Rest!
    Dls40sjsd fell asleep!
    Dls40sjsd regained 106/304 (34%) of its health!
    The sandstorm rages.
    Dls40sjsd is buffeted by the sandstorm!
    Dls40sjsd lost 19/304 (6%) of its health!
    Dls40sjsd's Leftovers restored its health a little!
    Dls40sjsd regained 19/304 (6%) of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    Tyranitar (62.707182320441987% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (93.859649122807014% HP) @ ** Machamp
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----- Surf
    ======================
    AI team:
    Technical Machine:
    Hippowdon (100% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (100% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Tyranitar (62.707182320441987% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ----- Crunch
    ----- Earthquake
    ----- Pursuit
    Machamp (93.859649122807014% HP) @ Lum Berry ** Machamp
    ----Ability: No Guard
    ----- DynamicPunch
    ----- Payback
    ----- Bullet Punch
    ----- Ice Punch
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----Ability: Natural Cure
    ----- Surf
    ----- Thunderbolt
    ----- Ice Beam
    ----- Rapid Spin
    Heatran (100% HP) @ Choice Scarf **
    ----Ability: Flash Fire
    ----- Earth Power
    ----- Fire Blast
    ----- Explosion
    ----- Dragon Pulse
    ======================
    Evaluating to a depth of 2...
    Evaluating Calm Mind
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1201
    ----Evaluating the foe's Crunch
    ----Estimated score is 1207
    ----Evaluating the foe's Earthquake
    ----Estimated score is 1400
    ----Evaluating the foe's Pursuit
    ----Estimated score is 1408
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1305
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1699
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 1784
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1349
    Estimated score is 1201
    Evaluating Dark Pulse
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1195
    Evaluating Psychic
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1138
    Evaluating Rest
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1172
    Evaluating switching to Hippowdon
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1982
    ----Evaluating the foe's Crunch
    ----Estimated score is 1876
    ----Evaluating the foe's Earthquake
    ----Estimated score is 1930
    ----Evaluating the foe's Pursuit
    ----Estimated score is 2001
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1678
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1678
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 1168
    Evaluating switching to Celebi
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1138
    Evaluating switching to Skarmory
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1411
    ----Evaluating the foe's Crunch
    ----Estimated score is 1774
    ----Evaluating the foe's Earthquake
    ----Estimated score is 2083
    ----Evaluating the foe's Pursuit
    ----Estimated score is 1944
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1256
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1849
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 1321
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 904
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 546
    Use Calm Mind for a minimum expected score of 1201


    Yikes!

    Turn 13 (open)
    Analyzing...
    Begin turn #13
    Tyranitar used Stone Edge!
    Dls40sjsd lost 262/304 (86%) of its health!
    Dls40sjsd is fast asleep.
    The sandstorm rages.
    Dls40sjsd is buffeted by the sandstorm!
    Dls40sjsd lost 19/304 (6%) of its health!
    Dls40sjsd's Leftovers restored its health a little!
    Dls40sjsd regained 19/304 (6%) of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    Tyranitar (62.707182320441987% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (93.859649122807014% HP) @ ** Machamp
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----- Surf
    ======================
    AI team:
    Technical Machine:
    Hippowdon (100% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (13.815789473684211% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Predicting...
    ======================
    Foe team:
    [same]
    ======================
    Evaluating to a depth of 2...
    Evaluating Calm Mind
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 239
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 340
    ----Evaluating the foe switching to Starmie
    ----Estimated score is -253
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 121
    Estimated score is -253
    Evaluating Dark Pulse
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 412
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 483
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 492
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 254
    Estimated score is 1
    Evaluating Psychic
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1
    Evaluating Rest
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1
    Evaluating switching to Hippowdon
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1099
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 795
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 795
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 285
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 1254
    Estimated score is 285
    Evaluating switching to Celebi
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 195
    Evaluating switching to Skarmory
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 468
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 373
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 966
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 438
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 21
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -393
    Switch to Hippowdon for a minimum expected score of 285


    It picks up on the threat and switches to safety.

    Turn 14 (open)
    Analyzing...
    Begin turn #14
    Technical Machine withdrew Dls40sjsd!
    Technical Machine sent out D64Sdvs (lvl 100 Hippowdon ♂)!
    D64Sdvs's Sand Stream whipped up a sandstorm!
    Tyranitar used Stone Edge!
    It's not very effective...
    D64Sdvs lost 105/420 (25%) of its health!
    The sandstorm rages.
    D64Sdvs's Leftovers restored its health a little!
    D64Sdvs regained 26/420 (6%) of its health!
    ======================
    AI team:
    Technical Machine:
    Hippowdon (81.19047619047619% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (13.815789473684211% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    Tyranitar (62.707182320441987% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (93.859649122807014% HP) @ ** Machamp
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----- Surf
    ======================
    Predicting...
    ======================
    Foe team:
    [same]
    ======================
    Evaluating to a depth of 2...
    Evaluating Earthquake
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1070
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1730
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 1686
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 1307
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 2013
    Estimated score is 1070
    Evaluating Slack Off
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 1066
    Evaluating Stealth Rock
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 847
    Evaluating Roar
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 289
    Evaluating switching to Celebi
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 62
    Evaluating switching to Skarmory
    ----Evaluating the foe's Stone Edge
    ----Estimated score is 335
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -525
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Stone Edge
    ----Estimated score is -128
    Use Earthquake for a minimum expected score of 1070


    Turn 15 (open)
    Analyzing...
    Begin turn #15
    Fred2.1 withdrew Tyranitar!
    Fred2.1 sent out Machamp (lvl 100 Machamp ♂)!
    Pointed stones dug into Machamp!
    Machamp lost 3/48 of its health!
    D64Sdvs used Earthquake!
    Machamp lost 18/48 of its health!
    The sandstorm rages.
    Machamp is buffeted by the sandstorm!
    Machamp lost 3/48 of its health!
    Machamp's Leftovers restored its health a little!
    Machamp regained 3/48 of its health!
    D64Sdvs's Leftovers restored its health a little!
    D64Sdvs regained 26/420 (6%) of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    Tyranitar (62.707182320441987% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (50.292397660818715% HP) @ Leftovers ** Machamp
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----- Surf
    ======================
    AI team:
    Technical Machine:
    Hippowdon (87.38095238095238% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (13.815789473684211% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Tyranitar (62.707182320441987% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ----- Crunch
    ----- Earthquake
    ----- Pursuit
    Machamp (50.292397660818715% HP) @ Leftovers ** Machamp
    ----Ability: No Guard
    ----- DynamicPunch
    ----- Payback
    ----- Bullet Punch
    ----- Ice Punch
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----Ability: Natural Cure
    ----- Surf
    ----- Thunderbolt
    ----- Ice Beam
    ----- Rapid Spin
    Heatran (100% HP) @ Choice Scarf **
    ----Ability: Flash Fire
    ----- Earth Power
    ----- Fire Blast
    ----- Explosion
    ----- Dragon Pulse
    ======================
    Evaluating to a depth of 2...
    Evaluating Earthquake
    ----Evaluating the foe's DynamicPunch
    ----Estimated score is 1276
    ----Evaluating the foe's Payback
    ----Estimated score is 2025
    ----Evaluating the foe's Bullet Punch
    ----Estimated score is 2044
    ----Evaluating the foe's Ice Punch
    ----Estimated score is 1159
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 2300
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 2193
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 1876
    ----Evaluating the foe switching to Heatran
    ----Estimated score is 2575
    Estimated score is 1159
    Evaluating Slack Off
    ----Evaluating the foe's DynamicPunch
    ----Estimated score is 1634
    ----Evaluating the foe's Payback
    ----Estimated score is 1642
    ----Evaluating the foe's Bullet Punch
    ----Estimated score is 1642
    ----Evaluating the foe's Ice Punch
    ----Estimated score is 1483
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1242
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 1770
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 732
    Evaluating Stealth Rock
    ----Evaluating the foe's DynamicPunch
    ----Estimated score is 1309
    ----Evaluating the foe's Payback
    ----Estimated score is 1527
    ----Evaluating the foe's Bullet Punch
    ----Estimated score is 1548
    ----Evaluating the foe's Ice Punch
    ----Estimated score is 1189
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 1176
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 1767
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 671
    Evaluating Roar
    ----Evaluating the foe's DynamicPunch
    ----Estimated score is 686
    Evaluating switching to Celebi
    ----Evaluating the foe's DynamicPunch
    ----Estimated score is 663
    Evaluating switching to Skarmory
    ----Evaluating the foe's DynamicPunch
    ----Estimated score is 790
    Evaluating switching to Tentacruel
    ----Evaluating the foe's DynamicPunch
    ----Estimated score is 401
    Evaluating switching to Spiritomb
    ----Evaluating the foe's DynamicPunch
    ----Estimated score is 429
    Use Earthquake for a minimum expected score of 1159


    Turn 16 (open)
    Analyzing...
    Begin turn #16
    Machamp used DynamicPunch!
    D64Sdvs lost 132/420 (31%) of its health!
    D64Sdvs became confused!
    D64Sdvs is confused!
    D64Sdvs used Earthquake!
    A critical hit!
    Machamp lost 21/48 of its health!
    Machamp fainted!
    The sandstorm rages.
    D64Sdvs's Leftovers restored its health a little!
    D64Sdvs regained 26/420 (6%) of its health!
    Fred2.1 sent out Blissey (lvl 100 Blissey ♀)!
    Pointed stones dug into Blissey!
    Blissey lost 6/48 of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    Tyranitar (62.707182320441987% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (50.292397660818715% HP) @ Leftovers ** Machamp
    ----- DynamicPunch
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----- Surf
    Blissey (59.077380952380949% HP) @ ** Blissey
    ======================
    AI team:
    Technical Machine:
    Hippowdon (93.571428571428569% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (13.815789473684211% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Tyranitar (62.707182320441987% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ----- Crunch
    ----- Earthquake
    ----- Pursuit
    Machamp (50.292397660818715% HP) @ Leftovers ** Machamp
    ----Ability: No Guard
    ----- DynamicPunch
    ----- Payback
    ----- Bullet Punch
    ----- Ice Punch
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----Ability: Natural Cure
    ----- Surf
    ----- Thunderbolt
    ----- Ice Beam
    ----- Rapid Spin
    Blissey (59.077380952380949% HP) @ Leftovers ** Blissey
    ----Ability: Natural Cure
    ----- Seismic Toss
    ----- Softboiled
    ----- Toxic
    ----- Wish
    ======================
    Evaluating to a depth of 2...
    Evaluating Earthquake
    ----Evaluating the foe's Seismic Toss
    ----Estimated score is 1935
    ----Evaluating the foe's Softboiled
    ----Estimated score is 1689
    ----Evaluating the foe's Toxic
    ----Estimated score is 2306
    ----Evaluating the foe's Wish
    ----Estimated score is 2113
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 2724
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 2617
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 2589
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 2292
    Estimated score is 1689
    Evaluating Slack Off
    ----Evaluating the foe's Seismic Toss
    ----Estimated score is 1535
    Evaluating Stealth Rock
    ----Evaluating the foe's Seismic Toss
    ----Estimated score is 1352
    Evaluating Roar
    ----Evaluating the foe's Seismic Toss
    ----Estimated score is 1361
    Evaluating switching to Celebi
    ----Evaluating the foe's Seismic Toss
    ----Estimated score is 831
    Evaluating switching to Skarmory
    ----Evaluating the foe's Seismic Toss
    ----Estimated score is 1274
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Seismic Toss
    ----Estimated score is 1049
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Seismic Toss
    ----Estimated score is 1714
    ----Evaluating the foe's Softboiled
    ----Estimated score is 1414
    Use Earthquake for a minimum expected score of 1689


    And now I think you see the leftovers of that previous switching bug. Here, Blissey takes the damage instead of Machamp, so Technical Machine believes Machamp to still be alive. This means that Technical Machine will now have to take Machamp into account for the rest of the battle. This will lead to incorrect analysis later on in the battle.

    Turn 17 (open)
    Analyzing...
    Begin turn #17
    Blissey used Flamethrower!
    D64Sdvs lost 85/420 (20%) of its health!
    D64Sdvs is confused!
    D64Sdvs used Earthquake!
    Blissey lost 19/48 of its health!
    The sandstorm rages.
    Blissey is buffeted by the sandstorm!
    Blissey lost 3/48 of its health!
    Blissey's Leftovers restored its health a little!
    Blissey regained 3/48 of its health!
    D64Sdvs's Leftovers restored its health a little!
    D64Sdvs regained 26/420 (6%) of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    Tyranitar (62.707182320441987% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (50.292397660818715% HP) @ Leftovers ** Machamp
    ----- DynamicPunch
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----- Surf
    Blissey (19.49404761904762% HP) @ Leftovers ** Blissey
    ----- Flamethrower
    ======================
    AI team:
    Technical Machine:
    Hippowdon (79.523809523809518% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (13.815789473684211% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Tyranitar (62.707182320441987% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ----- Crunch
    ----- Earthquake
    ----- Pursuit
    Machamp (50.292397660818715% HP) @ Leftovers ** Machamp
    ----Ability: No Guard
    ----- DynamicPunch
    ----- Payback
    ----- Bullet Punch
    ----- Ice Punch
    Starmie (87.588652482269509% HP) @ Leftovers ** Starmie
    ----Ability: Natural Cure
    ----- Surf
    ----- Thunderbolt
    ----- Ice Beam
    ----- Rapid Spin
    Blissey (19.49404761904762% HP) @ Leftovers ** Blissey
    ----Ability: Natural Cure
    ----- Flamethrower
    ----- Seismic Toss
    ----- Softboiled
    ----- Toxic
    ======================
    Evaluating to a depth of 2...
    Evaluating Earthquake
    ----Evaluating the foe's Flamethrower
    ----Estimated score is 1784
    ----Evaluating the foe's Seismic Toss
    ----Estimated score is 1791
    ----Evaluating the foe's Softboiled
    ----Estimated score is 2485
    ----Evaluating the foe's Toxic
    ----Estimated score is 2045
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 3045
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 2943
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 2915
    ----Evaluating the foe switching to Starmie
    ----Estimated score is 2626
    Estimated score is 1784
    Evaluating Slack Off
    ----Evaluating the foe's Flamethrower
    ----Estimated score is 1767
    Evaluating Stealth Rock
    ----Evaluating the foe's Flamethrower
    ----Estimated score is 1459
    Evaluating Roar
    ----Evaluating the foe's Flamethrower
    ----Estimated score is 1614
    Evaluating switching to Celebi
    ----Evaluating the foe's Flamethrower
    ----Estimated score is 903
    Evaluating switching to Skarmory
    ----Evaluating the foe's Flamethrower
    ----Estimated score is 917
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Flamethrower
    ----Estimated score is 1328
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Flamethrower
    ----Estimated score is 560
    Use Earthquake for a minimum expected score of 1784


    And now it's evaluating incorrectly due to Blissey and Hippowdon's HP being wrong.

    Turn 18 (open)
    Analyzing...
    Begin turn #18
    Blissey used Flamethrower!
    D64Sdvs lost 86/420 (20%) of its health!
    D64Sdvs snapped out of confusion!
    D64Sdvs used Earthquake!
    A critical hit!
    Blissey lost 23/48 of its health!
    Blissey fainted!
    The sandstorm rages.
    D64Sdvs's Leftovers restored its health a little!
    D64Sdvs regained 26/420 (6%) of its health!
    Fred2.1 sent out Starmie (lvl 100 Starmie)!
    Pointed stones dug into Starmie!
    Starmie lost 6/48 of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    Tyranitar (62.707182320441987% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (50.292397660818715% HP) @ Leftovers ** Machamp
    ----- DynamicPunch
    Starmie (0.3546099290780142% HP) @ Leftovers ** Starmie
    ----- Surf
    Blissey (19.49404761904762% HP) @ Leftovers ** Blissey
    ----- Flamethrower
    ======================
    AI team:
    Technical Machine:
    Hippowdon (85.714285714285708% HP) @ Leftovers ** D64Sdvs
    ----Ability: Sand Stream
    ----- Earthquake
    ----- Slack Off
    ----- Stealth Rock
    ----- Roar
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    Skarmory (100% HP) @ Shed Shell ** 124652Dss
    ----Ability: Keen Eye
    ----- Spikes
    ----- Roost
    ----- Drill Peck
    ----- Whirlwind
    Tentacruel (100% HP) @ Leftovers ** Dkeos40
    ----Ability: Liquid Ooze
    ----- Toxic Spikes
    ----- Rapid Spin
    ----- Surf
    ----- Sludge Bomb
    Spiritomb (13.815789473684211% HP) @ Leftovers ** Dls40sjsd
    ----Ability: Pressure
    ----- Calm Mind
    ----- Dark Pulse
    ----- Psychic
    ----- Rest
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Tyranitar (62.707182320441987% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ----- Crunch
    ----- Earthquake
    ----- Pursuit
    Machamp (50.292397660818715% HP) @ Leftovers ** Machamp
    ----Ability: No Guard
    ----- DynamicPunch
    ----- Payback
    ----- Bullet Punch
    ----- Ice Punch
    Starmie (0.3546099290780142% HP) @ Leftovers ** Starmie
    ----Ability: Natural Cure
    ----- Surf
    ----- Thunderbolt
    ----- Ice Beam
    ----- Rapid Spin
    Blissey (19.49404761904762% HP) @ Leftovers ** Blissey
    ----Ability: Natural Cure
    ----- Flamethrower
    ----- Seismic Toss
    ----- Softboiled
    ----- Toxic
    ======================
    Evaluating to a depth of 2...
    Evaluating Earthquake
    ----Evaluating the foe's Surf
    ----Estimated score is 2066
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 3731
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 3006
    ----Evaluating the foe's Rapid Spin
    ----Estimated score is 2902
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 4009
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 4380
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 4352
    ----Evaluating the foe switching to Blissey
    ----Estimated score is 3937
    Estimated score is 2066
    Evaluating Slack Off
    ----Evaluating the foe's Surf
    ----Estimated score is 3320
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 3814
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 3438
    ----Evaluating the foe's Rapid Spin
    ----Estimated score is 2948
    ----Evaluating the foe switching to Jirachi
    ----Estimated score is 2900
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is 3507
    ----Evaluating the foe switching to Machamp
    ----Estimated score is 3441
    ----Evaluating the foe switching to Blissey
    ----Estimated score is 3507
    Estimated score is 2900
    Evaluating Stealth Rock
    ----Evaluating the foe's Surf
    ----Estimated score is 2066
    Evaluating Roar
    ----Evaluating the foe's Surf
    ----Estimated score is 1314
    Evaluating switching to Celebi
    ----Evaluating the foe's Surf
    ----Estimated score is 3166
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 3153
    ----Evaluating the foe's Ice Beam
    ----Estimated score is 2766
    Evaluating switching to Skarmory
    ----Evaluating the foe's Surf
    ----Estimated score is 2471
    Evaluating switching to Tentacruel
    ----Evaluating the foe's Surf
    ----Estimated score is 3029
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is 2777
    Evaluating switching to Spiritomb
    ----Evaluating the foe's Surf
    ----Estimated score is 2612
    Use Slack Off for a minimum expected score of 2900


    More wrong results.


    The rest of the battle is messed up due to these incorrect results, so I'll just summarize it:

    Starmie uses Surf on the next turn, KOing Hippowdon. This leaves me with Celebi, Skarmory, Tentacruel, and Spiritomb. Technical Machine decides to bring out Skarmory, because it wants to lay Spikes and thinks Starmie is about to die to Sand Storm. However, Starmie gets a CH Thunderbolt, stopping Skarmory in its tracks.

    Technical Machine then sends out Tentacruel, because it wants to lay Toxic Spikes, and it thinks Starmie is about to die to Sand Storm. Thunderbolt, Toxic Spikes; Thunderbolt, Toxic Spikes; then Technical Machine's 28% HP Tentacruel decides to stay in and use Toxic Spikes again. It realizes that Thunderbolt KOs, and it doesn't want to switch to another Pokemon and risk Celebi getting hit by Ice Beam or Spiritomb dying from anything. However, it is more worried about Starmie using Rapid Spin and destroying all of its hard work. So the best move is Toxic Spikes (at least as far as it can tell searching to a depth of 2).

    Tentacruel faints to Thunderbolt and brings in Spiritomb. Starmie switches to Tyranitar as Spiritomb attempts to do something (but its still asleep). Tyranitar uses Stone Edge and faints Spiritomb.

    This leaves the game at the following:

    Fred2.1:
    Jirachi (100% HP) @ Leftovers
    Tyranitar (44.19889502762431% HP) @ Choice Band
    ----Ability: Sand Stream
    ----- Stone Edge
    Starmie with mid-range HP left @ Leftovers
    ----- Thunderbolt
    ----- Surf
    ======================
    AI team:
    Technical Machine:
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic

    In other words, if Celebi can beat Jirachi (and Starmie doesn't have CH Ice Beam waiting), Technical Machine wins. Otherwise, Fred wins.

    Technical Machine, despite its flaws, still some some analysis left. It has been counting PP this battle, and sees that Tyranitar it out of Stone Edge PP. It can safely Calm Mind as Tyranitar is forced to Struggle or switch. Tyranitar is at low enough HP that it will die to entry hazards if it switches. So as far as Technical Machine thinks, the only foes that can come in now are Jirachi and Machamp.

    Turn 26 (open)
    Analyzing...
    Begin turn #26
    Fred2.1 withdrew Tyranitar!
    Fred2.1 sent out Jirachi (lvl 100 Jirachi)!
    Pointed stones dug into Jirachi!
    Jirachi lost 3/48 of its health!
    OLfxghg3 used Calm Mind!
    OLfxghg3's special attack was raised!
    OLfxghg3's special defence was raised!
    The sandstorm rages.
    OLfxghg3 is buffeted by the sandstorm!
    OLfxghg3 lost 25/404 (6%) of its health!
    Jirachi's Leftovers restored its health a little!
    Jirachi regained 3/48 of its health!
    OLfxghg3's Leftovers restored its health a little!
    OLfxghg3 regained 25/404 (6%) of its health!
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    Tyranitar (13.259668508287293% HP) @ ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    Machamp (50.292397660818715% HP) @ Leftovers ** Machamp
    ----- DynamicPunch
    Starmie (0.3546099290780142% HP) @ Leftovers ** Starmie
    ----- Thunderbolt
    ----- Surf
    Blissey (19.49404761904762% HP) @ Leftovers ** Blissey
    ----- Flamethrower
    ======================
    AI team:
    Technical Machine:
    Celebi (100% HP) @ Leftovers ** OLfxghg3
    ----Ability: Natural Cure
    ----- Calm Mind
    ----- Recover
    ----- Grass Knot
    ----- Psychic
    ======================
    Predicting...
    ======================
    Foe team:
    Fred2.1:
    Jirachi (100% HP) @ Leftovers ** Jirachi
    ----Ability: Serene Grace
    ----- Iron Head
    ----- Fire Punch
    ----- Thunderbolt
    ----- Ice Punch
    Tyranitar (13.259668508287293% HP) @ Choice Scarf ** Tyranitar
    ----Ability: Sand Stream
    ----- Stone Edge
    ----- Crunch
    ----- Earthquake
    ----- Pursuit
    Machamp (50.292397660818715% HP) @ Leftovers ** Machamp
    ----Ability: No Guard
    ----- DynamicPunch
    ----- Payback
    ----- Bullet Punch
    ----- Ice Punch
    Starmie (0.3546099290780142% HP) @ Leftovers ** Starmie
    ----Ability: Natural Cure
    ----- Thunderbolt
    ----- Surf
    ----- Ice Beam
    ----- Rapid Spin
    Blissey (19.49404761904762% HP) @ Leftovers ** Blissey
    ----Ability: Natural Cure
    ----- Flamethrower
    ----- Seismic Toss
    ----- Softboiled
    ----- Toxic
    ======================
    Evaluating to a depth of 2...
    Evaluating Calm Mind
    ----Evaluating the foe's Iron Head
    ----Estimated score is -2706
    ----Evaluating the foe's Fire Punch
    ----Estimated score is -2737
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is -2630
    ----Evaluating the foe's Ice Punch
    ----Estimated score is -2763
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is -2195
    ----Evaluating the foe switching to Machamp
    ----Estimated score is -2143
    ----Evaluating the foe switching to Starmie
    ----Estimated score is -1971
    ----Evaluating the foe switching to Blissey
    ----Estimated score is -2176
    Estimated score is -2763
    Evaluating Recover
    ----Evaluating the foe's Iron Head
    ----Estimated score is -2721
    ----Evaluating the foe's Fire Punch
    ----Estimated score is -2724
    ----Evaluating the foe's Thunderbolt
    ----Estimated score is -2708
    ----Evaluating the foe's Ice Punch
    ----Estimated score is -2757
    ----Evaluating the foe switching to Tyranitar
    ----Estimated score is -2295
    ----Evaluating the foe switching to Machamp
    ----Estimated score is -2282
    ----Evaluating the foe switching to Starmie
    ----Estimated score is -2071
    ----Evaluating the foe switching to Blissey
    ----Estimated score is -2315
    Estimated score is -2757
    Evaluating Grass Knot
    ----Evaluating the foe's Iron Head
    ----Estimated score is -2776
    Evaluating Psychic
    ----Evaluating the foe's Iron Head
    ----Estimated score is -2768
    Evaluating switching to Celebi
    ----Evaluating the foe's Iron Head
    ----Estimated score is -2876
    Use Recover for a minimum expected score of -2757


    Tyranitar switches out to Jirachi as Celebi uses Calm Mind.

    The rest of the battle is speed tie Jirachi and Celebi, with Jirachi using Iron Head and Celebi using Recover (even when Celebi is at full health it uses Recover).

    However, Technical Machine isn't the only player in this battle, and while Fred's simplicity has prevented it from encountering any bugs so far, that proves to be its Achilles's Heel. 24 turns later, Jirachi runs out of Iron Head PP, and Fred, not being smart enough to count PP, believes that it can still use Iron Head, and thus attempts to select it. Pokemon Lab does not allow you to select moves that you cannot select (obviously), and thus Fred freezes, giving Technical Machine the game.

    I have since fixed the bugs outlined in this log, and I am looking forward to fighting Fred in our third and final match! (Technically, fourth, but my client disconnected in our first match early on in the battle)
  8. zarator

    zarator Credits to Mos-Quitoxe for the cute sprite^^
    is a Community Contributoris a Contributor Alumnus

    Joined:
    Mar 12, 2008
    Messages:
    4,977
    This work is impressive, Obi. If I faced an opponent who played like TM, I would have hardly imagined I was facing a machine. Sort of a Touring Test, I guess^^

    Keep it up.
  9. lars

    lars

    Joined:
    May 17, 2011
    Messages:
    265
    wow, I skipped a few turns, but I would love to read more battles done by AI
  10. MewMaster

    MewMaster

    Joined:
    Sep 18, 2010
    Messages:
    30
    It battles better than me! Lol :P (Seriously it does)
  11. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
  12. Setsuna

    Setsuna Prototype
    is a Tutor Alumnusis a Site Staff Alumnusis a Team Rater Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Jan 1, 2009
    Messages:
    1,158
    The battle vs Cathy's and bearzly's AI was pretty delightful. This is an excellent work on your side, obi.

    By the way, I was going to take a look at the code available in the HG repository that you set up, but unfortunately I'm getting an error when accessing the page. Thought I'd point that out.
  13. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    Looks like I have an outdated link on my website. I've been meaning to update that for a while now, I should be doing it today or tomorrow.
  14. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    I recently received a message from someone asking if they can help with Technical Machine, and this is what I sent them:

    Technical Machine currently only runs on Pokemon Lab, but it can load team files from Pokemon Lab or Pokemon Online. I will be adding support for Pokemon Online soon, though. To battle, you must copy the entire log for the turn into the program. To make sure you get everything, copy from "Begin turn #x" to "=======..." and paste it into the program, then press enter, then enter a ~, then press enter again. I'll be adding a better way to input logs soon as well.

    I have only compiled it on Linux using g++. I do not know how well or if it will compile on Windows using Microsoft Visual C++, or any other compiler. In theory there shouldn't be a problem because I have only used standard C++ in my code. If compiling on Linux, the process is very easy: simply open a terminal, navigate to your folder that Technical Machine is in, and then type:

    make ai

    or

    make aio

    ai will give you the debug version, aio will give you the optimized, full-speed version. Other options are make predict, make predicto, make rdc, and make rdco.
  15. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    My newest changes require C++0x support enabled, but it should help ensure that the program compiles and runs on any computer, not just those that have 64-bit longs. I used fixed-width data types (int64_t) to make sure that all numbers are as big as they need to be. This means that those of you who were just talking to me about getting TM to run should get the newest version of the source code, especially if you are on 32-bit computers or 64-bit Windows.
  16. tomtom5858

    tomtom5858

    Joined:
    Nov 10, 2010
    Messages:
    425
    Is this ever going to have a Python version? I have a Mac, so Python is far easier to work with.
  17. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    No. I may write the interface between simulator and AI in Python, but the core is and will continue to be C++.
  18. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    Technical Machine is now able to log into a Pokemon Lab server. Once I get the network team format coded, it will be able to start battles on its own.
  19. Luxpluff91

    Luxpluff91

    Joined:
    Jan 30, 2011
    Messages:
    1,359
    That's awesome, good work
  20. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    Technical Machine is now capable of battling on its own. I have a couple of bugs to work out, but for the most part, it's a fully functional, hands-free battler. The next step is to add generation 5 support.
  21. Lady Salamence

    Lady Salamence
    is a Smogon Social Media Contributor Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus

    Joined:
    Aug 4, 2010
    Messages:
    3,955
    Would it be possible that an actual human, not another AI, could test TM?
  22. Unbreakable

    Unbreakable

    Joined:
    May 21, 2010
    Messages:
    348
    So...people can now challenge this thing and learn what (not) to do without being humiliated by kids half their age?

    Dude, screw Battling 101, sign me up to test this once it gets on PO.
  23. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    About two months ago, Technical Machine fought Hunter, who is a human. The bugs encountered in that battle have since been worked out, fortunately. I'm working out the remaining major bugs now, as well as implementing automated battle logging and things like that.
  24. Lady Salamence

    Lady Salamence
    is a Smogon Social Media Contributor Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus

    Joined:
    Aug 4, 2010
    Messages:
    3,955
    Is it possible another person could play against AI anytime soon?

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