Pokebattler takes great pride in high simulation accuracy. This article is about the most recent research in Pokemon Go Gym Combat. Simulations are never going to be an exact replica of the real world but we are getting closer and closer every release. The most recent 3.1.0 update to Pokebattler included a few big changes for simulation accuracy that will make a big difference for users of the site. First, an Unknown moveset was added. This chooses a random moveset for each random simulation then averages them together for the best counters for each raid boss when you don’t know what the moves are yet. Secondly, Pokebox raid rankings now automatically use more accurate Bronze Monte Carlo simulations for all users, thanks to the generous donations of my Patreon supporters. This means that 10 random simulations are performed for each Pokemon + boss combination and averaged together. This is significantly more accurate than the single simulation being done before, especially for dodge results. The last and biggest change is the most difficult to see, however, it involves more sophisticated modeling of the charge time for special moves.

Charge Time

First you may be asking, what is charge time? When you use a special, you need to charge it up of course! It’s that blue bar that fills up over time. This takes half a second to do and is best started while you are using a fast move. After you charge up, if you continue to hold down your finger on the screen, your special will automatically cast when it can.

Originally, charge time on special moves was modeled as a 500ms charge time before every move. This penalized multi-bar moves as it adds a flat half a second to every move. A 2 bar move like Outrage normally takes 3.9 seconds. In the original simulations, Outrage would take 4.4 seconds. After months of this, /u/dondon151 informed me that you could charge your special move during the previous quick attack. Some quick testing determined this was correct and the extra time was removed. Fast forward many months and raids are out. Tier 3 raids are mostly solo-able and many high-end players are looking for more accurate times to win. We gave it a bit of thought, and it turns out that charge moves are somewhere between the 2 simulations or perhaps even worse.

What’s wrong with this picture? First, no human can instantly begin charging their special the split millisecond that the energy is available. On top of that, there is some sort of server lag/energy ping pong typically going on. Let’s go for 250ms as the average response time, with the low end at 100ms and the high end at 400ms. This is still quite aggressive in my mind but is achievable if you are paying attention. Third, it turns out there is almost never enough time to charge your move during the prior quick move. Energy appears to be gained from the quick move (and spent from a charge move) when damage is dealt. Or at least that is when the server sends you an energy update. Occasionally there is energy ping pong but that will typically settle down before the next special is ready to go. That means your time to charge a move is duration – damageWindowStart which is less than 500ms charge time + 250ms reaction time in most cases

Modeling Changes

This is the first attempt at accurately modeling this situation and while I am happy with the results so far, I expect people to poke holes in the theory and implementation!

The following changes were made for all strategies

Charge detection time is calculated as a random number of milliseconds between 100 and 400. This gives a relatively fast 250ms on average to start trying to charge the move as soon as you can. Considering that energy is gained at a fairly predictable rate, this seemed reasonable Charge time is 500ms + charge detection time. If the charge detection time finishes before the end of the prior move, the player is assumed to immediately begin charging up the charge move after the detection time. If the charge detection time finishes after the end of the prior move, the player is assumed to have started 1 additional quick attack and will then charge the special move immediately for 500ms

Dragonite Example

Let’s take a look at a detailed Dragonite vs. Entei example from my own Pokebox. Dragon Tail is a move with a 250ms charge window which makes it a good case study. Half the time it should do an extra quick attack and half the time not.

Time Move Damage Energy Current Energy 298.4 Dragon Tail 13 9 9 297.8 Fire Fang 6 3 12 297.4 Dragon Tail 13 9 21 296.8 Fire Fang 6 3 24 296.3 Dragon Tail 13 9 33 295.1 Dragon Tail 13 9 42 295 Fire Fang 6 3 45 294.1 Dragon Tail 13 9 54 292.9 Dragon Tail 13 9 63 291.7 Fire Fang 6 3 66 290.2 Outrage 95 -50 16 289.1 Fire Fang 6 3 19 287.9 Dragon Tail 13 9 28 286.9 Dragon Tail 13 9 37 286.1 Fire Fang 6 3 40 285.8 Dragon Tail 13 9 49 284.6 Dragon Tail 13 9 58 281.5 Outrage 95 -50 8 281.2 Overheat 83 42 50 277.6 Outrage 95 -50 0

The first Outrage shows a case where the charge detection time was greater than 250ms. An additional quick attack is done and then a charge attack is done immediately with the entire charge being done during the prior quick attack. This works because the energy bar is full at the start of the attack, you can trigger your quick attack and immediately perform a charge attack. Dragon Tails 1100ms duration easily covers the maximum 900ms we are using for charge time + charge detection time.

The second Outrage shows a case where the charge detection time was less than 250ms. The damage is dealt from the quick move at 15350 ms into the fight. The special is detected quickly and the charge move begins 110ms later at 15460. 500ms later, the Outrage is fired off at 15960. The damage from Outrage is triggered at 18460. This is just 300 ms before a large Overheat comes in that coincidentally fills up the charge bar to exactly 50 energy.

The third Outrage plays out more simply. There is 900ms to detect that we are full on energy and fire off a charge move which we do for effectively no delay. Finally we almost gain enough energy for another Outrage but we die before we can get it off.

*Note that the duration between Dragon Pulses on Dragonite looks funny due to Half-Even Rounding. Rest assured that the duration is a constant 1100 ms between them.

Charge Window For Moves

So what does this mean? The table below gives some clues. Charge Window Ms is calculated as move duration – damage start window Ms. The smaller the Charge Window Ms, the more likely you will not detect that you can do a special move as quickly as you can and you will do an additional auto attack.

A time of 250 Ms means 50% of the time the charge bar detection will happen before the end of the prior move and the other 50% of the time after.

Anything over 400ms will always detect before the end of the quick move.

Anything over 600 ms will sometimes be able to do the entire charge during the quick move.

Anything over 900 ms (currently only Confusion) will always be able to charge during the time period.

In short, a larger number means it is easier to charge during the middle of the prior quick move.

Name Duration Ms Damage Ms Charge Window Ms Acid 800 400 400 Air Slash 1200 1000 200 Astonish 1100 700 400 Bite 500 300 200 Bubble 1200 750 450 Bug Bite 500 250 250 Bullet Punch 900 300 600 Bullet Seed 1100 850 250 Charge Beam 1100 850 250 Confusion 1600 600 1000 Counter 900 700 200 Cut 500 300 200 Dragon Breath 500 300 200 Dragon Tail 1100 850 250 Ember 1000 600 400 Extrasensory 1100 850 250 Feint Attack 900 750 150 Fire Fang 900 640 260 Fire Spin 1100 850 250 Frost Breath 900 450 450 Fury Cutter 400 100 300 Hex 1200 1000 200 Hidden Power 1500 1100 400 Ice Shard 1200 600 600 Infestation 1100 850 250 Iron Tail 1100 850 250 Karate Chop 800 600 200 Lick 500 200 300 Low Kick 600 300 300 Metal Claw 700 430 270 Mud Shot 600 350 250 Mud Slap 1400 1150 250 Peck 1000 450 550 Poison Jab 800 200 600 Poison Sting 600 375 225 Pound 600 340 260 Powder Snow 1000 850 150 Psycho Cut 600 370 230 Quick Attack 800 250 550 Razor Leaf 1000 600 400 Rock Smash 1300 550 750 Rock Throw 900 500 400 Scratch 500 300 200 Shadow Claw 700 250 450 Snarl 1100 850 250 Spark 700 300 400 Splash 1730 1030 700 Steel Wing 800 500 300 Struggle Bug 1500 1200 300 Sucker Punch 700 300 400 Tackle 500 300 200 Thunder Shock 600 300 300 Vine Whip 600 350 250 Volt Switch 2300 1800 500 Water Gun 500 300 200 Wing Attack 800 550 250 Zen Headbutt 1100 850 250

Future Work

Modeling charge moves is very tricky to do and I have tried to err on the side of caution in this implementation. I have implemented a strategy that was overall the best across the board but there are localized situations where this could be improved on.

Assumptions:

Using specials as soon as possible is always preferable. Overfill on energy bar should be avoided at all costs. As seen in the Dragonite example, even a 2 bar move can easily overfill from a large raid boss attack. Dragonite was only 300ms and a couple incoming damage points shy of wasting some energy. This is particularly true for full bar moves as an incoming large damage move can be an enormous energy waste. By careful avoiding early pre-queuing of quick attacks, charge attacks can be charged during the charge window. This means you don’t use your quick attack until you see whether or not the energy that came in was enough to get you a full energy bar or not!

Some possible improvements:

Multibar moves should probably always do an extra quick attack if it is safe to do so. This allows them to better hide the cast time of the multi bar moves. Calculating whether losing the 500ms to the charge is better DPS or not. Using Hydro Pump instead of a Water Gun might always be a win regardless.

Summary

Overall I am quite happy with the increased simulation quality for Pokebattler users. The Bronze Monte Carlo results, in particular, should help Pokebox users dramatically. No more weird edge conditions caused by perfect energy use 6 fights in a row! The increased time to win from the charge time changes makes the solo raid attempts far more realistic. There is still a lot of work to do to help with this though! It turns out there is a large variation between attempts. The Dragonite fight vs. Entei above is 795.8 seconds on average. But on any particular try it could be 826.6 seconds or it could be 778.2 seconds or anywhere in between or beyond! These aren’t even the best or worst scenarios, just random ones I found by hand. That’s an awfully large window and showing just a single number to represent it is misleading.

TLDR: Counter, Water Gun and Bite are not quite as good as they might seem