• Follow our Instagram!
  • Curious about what we're currently doing about bots? Check out the latest updates from staff in this thread.

FIGHT Button Implementation Side Effects (Desync/Infinite Sleep)

I am curious how this would work in practice:

Would this mean Counter could potentially work more frequently - where it would currently be canceled due to Desync Clause? The only way for it to fail is if the target picked a non-Normal/Fighting-type move?

Two examples:
1. Paralyzed Snorlax clicks Body Slam on Chansey, next turn Snorlax clicks Earthquake and FPs on Counter.
2. Paralyzed Snorlax clicks Earthquake on Chansey, next turn Snorlax clicks Body Slam and FPs on Counter.

Both of these cause desyncs on cart. In example 1 Counter works on Chansey’s side but fails on Snorlax’s side. In example 2 Counter works on Snorlax’s side but fails on Chansey’s side.

Current implementation means desyncs result in move failure no matter what so counter fails in both examples here. The new proposal is to just take what’s on the target’s side so Counter would work in example 2, but not example 1.
 
Two examples:
1. Paralyzed Snorlax clicks Body Slam on Chansey, next turn Snorlax clicks Earthquake and FPs on Counter.
2. Paralyzed Snorlax clicks Earthquake on Chansey, next turn Snorlax clicks Body Slam and FPs on Counter.

Both of these cause desyncs on cart. In example 1 Counter works on Chansey’s side but fails on Snorlax’s side. In example 2 Counter works on Snorlax’s side but fails on Chansey’s side.

Current implementation means desyncs result in move failure no matter what so counter fails in both examples here. The new proposal is to just take what’s on the target’s side so Counter would work in example 2, but not example 1.
Thanks for clarifying! That's what I figured. I think those changes are worth the update to Desync Clause imo.
 
Fascinating!

And option 2 seems like a very sensible approach that balances maximising cart accuracy without including utterly gamebreaking nonsense. Nice work!
 
I also have to ask another question for these people with a fervour to cart accuracy. How far do they actually want to take this. A precedent where we just ban every thing that could cause an issue in cart, no matter how niche the situation opens up such an awful door. There are definitely countless desyncs that are undiscovered, are we just going to ban everything that caused one. What if we somehow find out Body Slam or Ice-type moves and what have you not can cause a desyncs under hyper specific circumstance, are we going to ban them and therefore take away vital tools? There has to be a line drawn in the sand for how far this was going to be taken, and this was decided back when desync clause was implemented. To be honest this just feels like the limited amount of people who never liked desync clause to begin with are just trying to use a new reason to get it removed, despite it being the wish of the players to have desync clause as it was literally voted on.

If we really want to be fair open and democratic about this, let's go ahead and hold another vote on desync clause, as this bug here is something that directly falls under the jurisdiction of it. This thread needs to go to Policy Review either way, I'm not really sure why it's in the RBY thread and not there to begin with. I think we all know how that vote would turn out though.
 
Last edited:
option 4 - get rid of the fight button and go back to the way it was before
:blobthumbsup:
Completely ignorant comment (sorry, I was mean :D ). The Fight button is just an interface to indicate that no actual move is being committed. Even if we displayed the moves in the client, the internal behavior would still follow the updated logic that matches the cartridge. That's already what happens when you're still trapped after 2 turns—since you don't know if you're still trapped, the moves are shown. However, internally, no move is committed.
Any option that bans Counter would be loathsome to me. Worshipping cart accuracy is not close to being worth banning as prominent an aspect of the metagame as Counter. I would rather revert the updated logic of the internal behavior to what it was before the fight button implementation than allow Counter to be banned.

Expanding desync to make this work so that we have both the updated logic and Counter naturally seems like the ideal outcome. If the devs can't figure it out, then either ignore it or revert the update. Removing Counter would be a needless net negative to RBY.
 
Would doing something like - if move abort move if turn use offline implementation - be off the table? Its not as consistent as we'd like but its not completely insane, its closer to cart accuracy than just ignoring it or deciding the interraction ourselves (which should be completely off the table, alongside other mods that change how the game functions in a way thats not these 2.) and keeps the status quo for moves like counter.
 
I think that, broadly, enforcing complete cart accuracy is an unfeasible goal and one we already give up on in specific situations for competitive balance (Freeze/Sleep clauses in particular). Not to say that cart accuracy isn't valuable (I personally think that the many quirks specific to RBY make these tiers more interesting than many modern tiers), but removing significant parts of the metagame in pursuit of it feels like the wrong approach. I strongly oppose banning Counter and Quick Attack. These moves add meaningful depth to metagames that already by their nature have extremely limited options, and unlike other moves we've banned, like evasion and PT moves, this is not an issue of competitive balance, just one of philosophy.
 
Holy shit, Counter continues to break the game. That's wild, I can't believe no-one's tried to ban it yet! Imagine if something had been done idk, several years ago or something

The thing that bothers me is that people are still somehow misrepresenting a push for cartridge accuracy as requiring us to ban half the moves in the game or something by deliberately failing to consider alternatives it conveniently creates a caricature of cart accuracy. It really fails to seriously consider how you'd go about replicating the games in person. In an in-person tournament/match DQs would absolutely be on the table, and triggering literally every desync bar this one requires a player to knowingly select a move that can potentially trigger a desync. With how niche most desync scenarios are, this would have an extremely limited impact on gameplay.

As for this one, I support bans of these moves (rip Quick Attack Flareon lead). We've finally found a desync scenario where you cannot reasonably attribute a cause to one player so I don't think my preferred DQ solution is useful here, meaning a ban is required. If there's an alternate solution that's cart-compatible and doesn't require a ban I'd love to hear it, but I'm not seeing it rn
 
Last edited:
I have always been pro-patch when it comes to desyncs, and the main reason for that is the same one I had several years ago when I voted to preserve Counter: I played the cartridge game enough as a kid to see how much the game desyncs in link battles (and 6 year old me didn't use Counter). It's very likely that there's a whole desync iceberg we don't even realize exists.

If we end up banning every move that causes a desync, chances are we'll push the game in an absurd direction if we go too far down the rabbit hole of mechanic research. We've all seen RBY speedruns and we know how breakable these games are. They were not programmed to be used the way we use them today.

The cartridge accuracy arguments will always feel fallacious to me. We play on simulators with perfect IVs on all Pokemon, %HP bars, visible PP counts, full team information at any given time, a cancel button, damage calculators... Some of these things are technically replicable in real life (like counting with pen and paper) but in practice no one would actually be doing that in a tournament setting, and others are simply impossible to replicate (cancel button and %HP bars). None of these things are cartdridge accurate, but I think we can all agree they improve our experience.

I don't believe we're trying to play a perfect replication of the RBY games: we're trying to play some sort of an idealized version of them. And in an ideal version, desyncs are bugs that the programmers would have fixed.

If the community / PS developers want to ban Counter because they are tired of dealing with a new hassle every 6 months, I think that's reasonable. But applying a strict "desync = ban" policy is IMO dangerous and could lead us to making decisions we'd rather avoid in the future.

I believe all desync cases should be patched, for the sake of simplicty and to stay consistent with how we've chosen to emulate the game.
 
EDIT: i slightly misunderstood the details and this was not an intentional change to sleep behavior but unintentional changes caused by changes unrelated to sleep. my point still stands that this cart desync should have an official solution on how we handle it. both the current behavior and old "status quo" behavior (unintentionally) modded out this desync and while the community clearly just wants to handle this by modding it out, i just want an official statement on how we will be modding this. both the status quo and current behavior are completely valid ways to handle this. i do not have the time or energy to edit this post to better emphasize that this was actually an indirect change to sleep rather than a direct one, but the original point that this should have a conclusion still stands the same. and i want to make very very clear i have zero malice towards the dev who made changes to the sim that caused this. i am truly grateful people keep this game alive and running for free and this is not a failure on the devs side at all, but i think the community is way more apathetic about the indirect changes it had than they should be and there may be a bit of a communication gap between devs and players. this isnt a post about that exact topic so ill stop there. i just wanted to make it clear no one person is at fault that the community is completely apathetic to how we should be treating this desync.

i wanted to bump this to ask something since this interaction came up again in a tour game (https://replay.pokemonshowdown.com/smogtours-gen1ou-939195 turns 14-18 have the sleeping mons going 2nd vs things they usually outspeed due to the counter on turn 12). i wanted to ask WHY did we change sleep to behave according to the side of the player with changed priority? unless im misunderstanding this does not make the game more accurate to cart as both ignoring the priority change on both sides or accepting the priority change on both sides are both not accurate to cartridge.

which makes me wonder why we changed anything? if both the status quo and this change are both inaccurate to cart, why did we not stick to the status quo of the mod we already had in sim unintentionally? the discussion is firmly on the side of "mod it in some way" and all im really asking for is someone with the authority to make the calls to just say what we should do as a mod? the status quo already modded this interaction and the new behaviour is also a mod so i am very confused why we traded 1 mod for another when both are mods ignoring cartridge behavior. its kind of infuriating we literally changed sim behavior from one mod to another and absolutely everyone is completely apathetic to the fact we literally changed how sleep behaves on the simulator due to a desync we discovered and the new mod is not even actually officially a part of desync clause mod

both ignoring the priority changes (the old status quo before any of this) and recognizing the priority changes (behavior sim now has) are cart inaccurate so i do not understand why we changed the status quo if this isn't even a real solution. if we can't agree the new behavior is the one we wish to simulate we should really just stick to status quo or if the new behavior is truly what we want can someone with any bit of power on approving these kinds of things say sim recognizing priority changes when burning sleep turns is the way we are choosing to handle this? both the status quo and new behavior can pretty much just be bunched into the mods we do for psywave/counter already even if it's technically speaking not the same type of desync, but both cases are the sim choosing to ignore desyncs so its fair to make any official call on this technically just another change under desync clause mod.

which also makes me wonder, who actually has the authority to approve changing the simulator from one mod to another? i dont understand why this change happened if the status quo was already effectively a sim mod to ignore this desync, even if unintentionally. i think someone coming and saying the sim will do xyz in this cases regardless of the direction we go just to actually have this discussion have a conclusion would be great and we can just move on from there instead of being apathetic we just randomly decided the original status quo mod is worse than the new mod. the change itself isn't egregious i just want someone who has the authority on this to say the new behavior will be how it is handled going forward if we're going to be keeping this.
 
Last edited:
Thanks for the post Mel. This is kinda getting at the questions/thought I was trying to start with this thread.
Idt the current behavior was an intentional change (no one ever went in to make sure the sim acts according to lowered priority player); it just happened as a result of implementing the fight button. I don't know why the sim defaulted to one perspective vs the other, but Hydrametr0nice could maybe speak to that?
But this is why I felt that doing nothing wasn't a viable option in the original post in this thread; doing nothing is actually an active decision that allows a change from one inaccurate behavior to another (as you described).

However, it seemed the strongest consensus here in this thread was to handle desyncs as described in hydra's post here.
This gets around desyncs by just treating things how they should work from the perspective of the player using the move (ie counter). in this solution, things would play out as they are currently with the counter-sleep priority thing.

All in all, I'd think rby council should just make a call to either officially greenlight this or push for another solution (or hold a poll or whatever ppl do according to policy). We just need a decision made and then learn to adapt to the new situation.

​

 
treating things how they should work from the perspective of the player using the move (ie counter)
id be a bit cautious about accepting this without a second thought considering this would also change counter desyncs from move failure to move success (which is how it worked before we discovered the desync and added desync clause mod). its a valid choice but it's not one where we neatly just slide this one interaction under the rug and move on which i think the community probably wants. not exactly opposed to it but we should really be cautious and think before we implement solutions that indirectly impact other parts of the game such as how counter desyncs are treated. no one is forcing the solution to involve redefining desync clause mod if we want to just patch this one thing and change nothing else.
 
Last edited:
I've spent too much fucking time writing this god damn, sorry if it is too much rumbling

Melbelle Acetylaldehyde Sorry for the late response. When I say "you", I'm talking to the people in this thread and the RBY community in general.

To be honest, Smogon moves so slowly that I'm already a bit rusty on the exact sequence of events and all the mechanics that were discovered. Many of them weren't actually new discoveries. They were already scattered across YouTube videos and wiki pages. The difference is that nobody had dug as deeply into them as I did to accurately simulate them on PS!. So whenever I say that I "discovered" something, I often don't mean that I was the first person to find or report it.

I appreciate that you didn't frame this as the developers being responsible for the issue, but one thing you got wrong is the idea that we unilaterally implemented things simply because they were cartridge accurate and then moved on.
i think the community is way more apathetic about the indirect changes it had than they should be and there may be a bit of a communication gap between devs and players.
This is completely not true. With my first changes, I made this post on purpose:
and when new things started to emerge, I messaged Dhelmise and he asked me to discuss the findings with the Gen 1 TLs. I explained all of the relevant interactions to them: some that had already been implemented but we only noticed later and others that I knew about but hadn't implemented yet.

I've been literally hanging around in your own RBY bug report thread because you don't open regular bug reports. In that thread, I explained all the fixes that I was doing throughout those implementations.
I mean, how much closer do you want me to be? I literally made a post just to notify you that the changes were about to hit the live server.

Merely by unfortunate circumstance, a new desync was discovered that had never been reported before. I literally cannot find any information about this priority desync anywhere online. No one could have predicted it existed when the other bug fixes were made.

I didn't decide which player would have priority, as I only discovered the interaction after all the previous implementations were made. It was just how it turned out to be. I communicated the priority desync to the Gen 1 TLs before this thread was created. We also talked about these bugs extensively in the very public Smogon Development Discord, where policy people like Dhelmise and goldmason are.

Moreover about communcation between devs and players, I actually suggested that it would be useful to have a thread in the Smogon's PS! forum where developers could announce mechanical changes and bug fixes with moderate to major impact. It could even be a thread in Policy Review whose sole purpose would be communication by devs rather than discussion by the community.

This is not directed at Melbelle, but to the people that have complained about the new implementations in general. And don't interpret these comments as hostility. Communicating online has taught me that anything can sound rude when written.

The Gen 1 simulator is more cartridge-accurate than it has ever been. I mean EXTREMELY accurate. A lot of "bugs" were reported and I later discovered the interaction was intended. The implementation was not just good, everything fitted perfectly to fix all the bugs described below. You can't throw all of that away because of one mildly annoying policy issue around a new desync interaction. Here are all the bugs fixed in the 3 relevant code changes:
  • Fixed incorrect Counter desyncs that already had substantial outcry on the RBY forums. Counter desync behavior is now 100% cartridge-accurate.
  • Implemented the thawing desync:
  • Fixed incorrect PP-slot deduction when Mimic copies a move the user already knows.
  • Fixed Disable targeting the wrong moveslot when a Pokémon had duplicate moves because of Mimic.
  • If Haze removes sleep or freeze during a multi-turn move, the affected Pokémon becomes soft-locked and cannot finish the move or switch out. This also affects Hyper Beam's recharge turn. Bide remains incomplete as well, although the Pokémon can still switch out.
  • If Metronome or Mirror Move calls a partial-trapping move, the trapping effect persists for its duration.
  • If the target switches and the partial-trapping move was called by Metronome, the Pokémon uses Metronome. The cartridge handles this gracefully by updating the last move used to "Metronome".
  • If the target switches and the move was called by Mirror Move, desync clause activates and the trapping effect ends. Unlike Metronome, Mirror Move lacks the graceful correction, resulting in the "Partial-Trapping Mirror Move Glitch":
  • https://glitchcity.wiki/wiki/Partial_trapping_move_Mirror_Move_link_battle_glitch
  • If a transformed Pokémon uses Metronome or Mirror Move, 1 PP is restored to the original move slot.
  • Mimicked moves keep the original slot's PP synchronized even if Mimic was called by Metronome or Mirror Move.
After looking at the number of bugs that were fixed because of the moveslot logic, if the RBY community cannot resolve this small policy question, I don't know what to tell you. I've submitted other changes with great competitive impact (some still awaiting review):
  • Gen 3-4 Pursuit activation not being affected by paralysis.
  • Gen 4 spread damage not being reduced if the first target faints (yup, that's a thing, still pending review).
  • Gen 3-4 switch-order mechanics.
These are just some of the major changes from the innumerous mechanics and bug fixes that we implement across all gens every single week. You are just not comfortable with this particular change versus all the others (which is fine) and you are not comfortable with the reality that this is how the game that you have played until now actually works (which is also fine).

What happens next to RBY?
Personally, I don't care that much. The community is kinda free (in a controlled way :worrywhirl:) to modify its formats however it sees fit. I've given a possible solution. I'm literally just waiting for you to decide.

Edit: Melbelle oh, and the status quo was not correct from either POV. When the desync happens, its owner sees it with the same priority as the last move selected by their team, while the opponent sees it with the priority of the first move in its moveset. We are currently using the "last move selected" POV (I think, sorry, I'm rusty). The previous implementation was incorrect from both POV.
 
Last edited:
fun fact, because Option 4 from this Policy Review Thread got chosen over Option 5, you can Counter moves like Ice Beam.

here's a replay demonstrating this in action (Desync Clause failing to activate):
https://replay.pokemonshowdown.com/gen1ou-2200507324

and here's a replay showing that thing not happening due to another move getting clicked on the Full Para (Desync Clause properly activating):
https://replay.pokemonshowdown.com/gen1ou-2201233806

needless to say this thing is normally 100% impossible and should be fixed. it's normal behaviour.
 
Last edited:
fun fact, because Option 4 from this Policy Review Thread got chosen over Option 5, you can Counter moves like Ice Beam.

here's a replay demonstrating this in action (Desync Clause failing to activate):
https://replay.pokemonshowdown.com/gen1ou-2200507324

and here's a replay showing that thing not happening due to another move getting clicked on the Full Para (Desync Clause properly activating):
https://replay.pokemonshowdown.com/gen1ou-2201233806

needless to say this thing is normally 100% impossible and should be fixed.
I'm sorry, but I won't comment on replays that predate my implementation.
 
This is expected behavior. I just reproduced it on cartridge: Ice Beam did 76 damage and Counter did 152.
Lvl 99 Chansey Ice Beam vs. Chansey: 66-78 (9.3 - 11%) -- possibly the worst move ever
This happens because, in RBY, the variable that stores damage and is used by Counter (called wDamage) is shared by both sides instead of having one variable per side. In this situation, if Chansey clicks Seismic Toss, because both the last selected move and the last used move are counterable, there is no desync. However, since the last recorded damage was actually the Ice Beam damage, that is the value used by Counter.
Either way, if a moderator wants to delete this back-and-forth between F-00 and me, feel free. It has nothing to do with the thread and we are kind of clogging it up.
But this is the perfect example of something that should go into a bug report. It takes just as much time as posting anywhere else, it is seen by multiple devs and researchers, and the potential bug ends up in a place where it will not be lost in the middle of a random thread. And if, in the end, it's not a bug, we will close it with the corresponding explanation.
 
Last edited:
This is expected behavior. I just reproduced it on cartridge: Ice Beam did 76 damage and Counter did 152.
Lvl 99 Chansey Ice Beam vs. Chansey: 66-78 (9.3 - 11%) -- possibly the worst move ever
This happens because, in RBY, the variable that stores damage and is used by Counter (called wDamage) is shared by both sides instead of having one variable per side. In this situation, if Chansey clicks Seismic Toss, because both the last selected move and the last used move are counterable, there is no desync. However, since the last recorded damage was actually the Ice Beam damage, that is the value used by Counter.
Either way, if a moderator wants to delete this back-and-forth between F-00 and me, feel free. It has nothing to do with the thread and we are kind of clogging it up.
But this is the perfect example of something that should go into a bug report. It takes just as much time as posting anywhere else, it is seen by multiple devs and researchers, and the potential bug ends up in a place where it will not be lost in the middle of a random thread. And if, in the end, it's not a bug, we will close it with the corresponding explanation.
except there is a desync on cartidge, it's not a bug in the simulator because that's how they decided to implement it, but it's a wrong implementation, as you mentioned, this thread is not about desyncs in general, so i will go ahead and open a policy review thread since the bug report will be closed as that's how it was implemented.
 
Last edited:
except there is a desync on cartidge, it's not a bug in the simulator because that's how they decided to implement it, but it's a wrong implementation, as you mentioned, this thread is not about desyncs in general, so i will go ahead and open a policy review thread since the bug report will be closed as that's how it was implemented.
How could there be a desync? I literally just tested it on cartridge. And if a desync clause activation is missing, that would be a PS! bug, so you should open a bug report and we can continue this conversation there.
 
Last edited:
How could there be a desync? I literally just tested it on cartridge. And if a desync clause activation is missing, that would be a PS! bug, so you should open a bug report and we can continue this conversation there.
my apologies, upon further testing, it looks like i messed up the process of testing it on cartidge, there is indeed no desync.
 
Following the discussion in this thread, looking at the playerbase's sentiments regarding the different possibilities of handling desyncs in the future, and discussions among the RBY OU Council, we've decided to follow an "online acting player's point of view" approach to handling desync behaviors. In short, any move that would've previously triggered Desync Clause will now be simulated from the POV of the acting player in a link battle. This is also the behavior seen in Pokémon Stadium battling. This approach is described in more detail by Hydrametr0nice in the following posts: (1) (2)

As a player, here are the most notable impacts to this change in behavior (thank you Hydra for this write-up):
  • Psywave would never roll a 0.
  • Bide's accumulated damage is not reset if the opponent faints.
  • Thawing before acting makes the thawed Pokémon use the last move selected by its team, even if that Pokémon does not have that move. If that team hasn't selected a move yet, the Pokémon will use a corrupted move with Fissure's animation, 102 base power, ??? type, Special category, and around 31.6% accuracy.
  • The priority of a sleeping/frozen Pokémon would always be the same as the last move used by its team. For example, if a Jynx gets put to sleep while using Counter, its priority will remain -1 for the duration of its sleep or until another move is used by its team. The same happens with Quick Attack, but with higher priority.
  • If Mirror Move copies a trapping move and the opponent switches out, the player would reuse the trapping move from turn zero. Metronome would still fall back to using Metronome.
  • Counter has 2 parts:
    • Counter reacts based on the last move used by the opponent's team. A move counts as used as soon as the message "<Pokémon> used <move>!" appears, even if it fails. So if a Pokémon gets full paralyzed, it doesn't count. For example, if a Chansey gets Ice Beamed by a paralyzed Snorlax, then the next turn it clicks Counter as the Snorlax clicks Body Slam and gets full para'd, Counter will fail.
    • Counter fails if the opponent switches to a sleeping Pokemon that spends a turn sleeping and has Counter as its first move. For example—assume a Jynx is in the back is asleep and has Counter as its first move—if Chansey uses Counter as Snorlax switches into Jynx, Counter might not fail. But if Snorlax switches into Jynx, and in the following turn, Chansey clicks Counter as Jynx spends a turn sleeping, Counter will always fail. Since there are potentially advantageous situations for different Counter moveslot positions, the player building the team will be responsible for choosing and being aware of the Counter moveslot.
This change will be live in a few hours to a few days from now. I'll edit this post once the change has been added to the simulator. For those interested, here's the PR.

The RBY OU council reached this decision after weighing the feasibility of various approaches as well as the desires of the community that was voiced in this thread. Ultimately, the council was in unanimous agreement that this was the best solution to satisfy concerns of cart accuracy and consistent desync treatment, without overhauling the metagame we've come to appreciate for over a decade. This seemed to also be the most widely liked approach according to the playerbase, which adds to why we feel confident in this decision.

I'd like to give special thanks to Hydrametr0nice for their great work and clear communication with the council and the community, and Acetylaldehyde for encouraging discussion among the playerbase.

This thread will stay open for a while longer so people can ask for the necessary clarifications.
 
Last edited:
RBY desyncs and Desync Clause Mod: technical explanation!
Disclaimer: the variables' names are taken from https://github.com/pret/pokeyellow.

The Desync Clause Mod (DCM) aims to resolve specific interactions that produce different outcomes in each player's game. In the past, whenever a desync occurred, DCM simply aborted the move being used. As new desyncs were discovered, this solution proved insufficient, so we switched to resolving them based on the acting player's point of view in a linked battle.

There are two types of desyncs:

Offline desyncs
These desyncs occur because the game's code is not perfectly mirrored between the player's and the opponent's sides.

1. Psywave
The player's Psywave rolls a number between 1 and level × 1.5. The opponent's Psywave rolls a number between 0 and level × 1.5.
Video footage
Desync Clause Mod never rolls a zero.

2. Bide
The player's accumulated Bide damage is not reset if the opponent faints. The opponent's accumulated Bide damage is reset if the player's Pokémon faints.
Video footage
Desync Clause Mod never resets accumulated Bide damage.

Online desyncs
These desyncs occur because of the way each game sends its selected action to the opponent's game. They never occur when playing against an NPC.
Each player has four variables:
  • wPlayerMoveListIndex: Holds a number between 0 and 3 corresponding to the index of the selected move. In the original game, this value is updated whenever the cursor hovers over a move in the selection menu. For simplicity, Pokémon Showdown (PS) updates this value only when a move is selected. This variable is also reset to 0 when the player switches and is used for PP deduction. It is sent to the opponent at the beginning of a turn so that the opponent's game knows which move the opposing Pokémon is about to use.
  • wPlayerSelectedMove: Holds the global number/identifier of the selected move. This is the variable checked for most operations, with the exception of PP deduction.
  • wEnemyMoveListIndex: The same as wPlayerMoveListIndex, but for the opponent. This variable is updated only when the opponent submits a move, sending their own wPlayerMoveListIndex, including a locked action submitted by clicking the Fight button.
  • wEnemySelectedMove: The same as wPlayerSelectedMove, but for the opponent. When wEnemyMoveListIndex is updated, this variable is set to the move stored in the corresponding opponent's slot.
A few important notes before continuing:
  • At the beginning of the battle, both wPlayerSelectedMove and wEnemySelectedMove are set to NO_MOVE, and both wPlayerMoveListIndex and wEnemyMoveListIndex are set to 0.
  • When a Pokémon is asleep or frozen, or is locked into a move, such as Outrage, Solar Beam, or Wrap, none of the variables on that Pokémon's side are updated, but its game still sends wPlayerMoveListIndex to the opponent.
  • When a Pokémon is bound/partially trapped, its game sends that information to the opponent. Both wPlayerSelectedMove and wEnemySelectedMove are updated to CANNOT_MOVE, but wPlayerMoveListIndex and wEnemyMoveListIndex remain unchanged.
  • When a Pokémon uses Struggle, its game sends that information to the opponent. Both wPlayerSelectedMove and wEnemySelectedMove are updated to STRUGGLE, but wPlayerMoveListIndex and wEnemyMoveListIndex remain unchanged.
The following desyncs always occur because wPlayerMoveListIndex points to a slot that does not match the move stored in wPlayerSelectedMove, but still sends it to the opponent. As a result, wEnemySelectedMove is updated to a move that does not match wPlayerSelectedMove, causing each player to see the Pokémon execute a different move.

Desync Clause Mod resolves all of these desyncs by using wPlayerSelectedMove from the acting Pokémon's point of view.

3. Thawing after a switch
When a player switches to a Pokémon, wPlayerMoveListIndex is reset to 0. On the following turn, if the new Pokemon is frozen, wPlayerMoveListIndex is sent to the opponent, causing wEnemySelectedMove to become the frozen Pokémon's first-slot move.

However, wPlayerSelectedMove still contains the last move used by that Pokémon's team. If the frozen Pokémon is hit by a Fire-type move and can still act during that turn, it will execute the last move used by its team.

Example:
  • P1's Cloyster uses Toxic.
  • P1 switches Cloyster out for a frozen Poliwrath.
  • P2's Arcanine hits Poliwrath with a Fire-type move and Poliwrath thaws.
  • If in the same turn Poliwrath can still act, P1 sees it use Cloyster's Toxic, while P2 sees it use whichever move Poliwrath has in its first slot.
Video footage (the video description is technically accurate)
In this case, Desync Clause Mod would make Poliwrath use Toxic.

If Poliwrath's team has not selected a move yet, Poliwrath will use NO_MOVE. Since wPlayerSelectedMove is 0, the game fetches a supposed move at index 0xff (255) in the Moves table, which lands outside the table. Immediately after Moves in the ROM data is the BaseStats table, and the lookup lands in the middle of Raticate's base stats, loading data from there:
  • wPlayerMoveNum: Raticate catch rate = 0x5A = Fissure
  • wPlayerMoveEffect: Raticate base EXP = 0x74 = invalid effect index
  • wPlayerMovePower: Raticate pic size = 0x66 = 102 base power
  • wPlayerMoveType: RaticatePicFront low = 0x31 = invalid type (Special category)
  • wPlayerMoveAccuracy: RaticatePicFront high = 0x51 = 81/256 accuracy (about 31.6%)
  • wPlayerMoveMaxPP: RaticatePicBack low = 0x0A = 10 max PP
4. Priority of a sleeping or frozen Pokémon
Using the same setup as in the previous desync, P1 sees Poliwrath act with the priority of the last move used by Cloyster, while P2 sees Poliwrath act with the priority of the move in Poliwrath's first slot.
Desync Clause Mod always uses the priority of the last move used by that Pokémon's team.

5. "Partial trapping move Mirror Move glitch" or "Fire Spin glitch"
When Mirror Move copies a binding move, the binding effects are applied to both the attacking and defending Pokémon as normal. When Mirror Move executes the binding move, the game manually updates both wPlayerSelectedMove and wEnemySelectedMove to that move. When the opponent switches out, the attacker's binding condition ends. Because P1 still has the binding move stored in wPlayerSelectedMove, the Pokémon will use that move again, restarting the binding effect from the beginning. However, wPlayerMoveListIndex still points to Mirror Move's slot and sends that information to the opponent at the beginning of the turn. As a result, the opponent sees the Pokémon use Mirror Move, causing a desync. This execution of Mirror Move always fails because switches clear the variable it uses to check the last move.

This does not happen with Metronome because the game contains a hardcoded instruction that resets wPlayerSelectedMove to Metronome when the Pokémon is in the middle of a binding move and the opponent switches, resulting in Metronome being used on both views.
Article (not super clear; the replication is a bit overcomplicated)

Desync Clause Mod makes the Pokemon reuse the binding move.

6. Counter
Counter is affected by both online desyncs and offline disparities.

Counter also uses a different set of variables:
  • wPlayerMoveType
  • wPlayerMovePower
  • wEnemyMoveType
  • wEnemyMovePower
These variables are set whenever a move's usage message appears, so they are not updated if the Pokémon is fully paralyzed or flinches. However, on the player's side, these variables are also set as soon as the player selects a move. This does not happen when an NPC selects a move, which is why Counter is also affected by an offline disparity. For PS, however, we focus solely on the online case.

Counter executes successfully if all the following are true:
  • Is wEnemySelectedMove different from Counter?
  • Is wEnemyMovePower nonzero?
  • Is wEnemyMoveType either Normal or Fighting?
  • Is wDamage nonzero?
Two desyncs can occur:

6.1. Counter + paralysis
The first desync involves wPlayerMovePower and wPlayerMoveType. When P2 selects a move, its variables are immediately updated to that move. However, if P2 fails to act because of full paralysis, P1 does not update wEnemyMovePower or wEnemyMoveType. Those variables therefore continue to hold the values of the last move P2 used.

For example, suppose P2 previously used Tackle and then becomes fully paralyzed while attempting to use Fire Blast. From P2's perspective, Counter fails because wPlayerMoveType contains the Fire type. From P1's perspective, however, wEnemyMoveType still contains the Normal type, so Counter succeeds.
Video footage

In this case, Counter also succeeds on PS because P1 is the acting Pokémon using Counter.

6.2. Counter + sleep
Using the same setup from desyncs 3 and 4, if P1 uses Counter while P2's Pokémon is asleep/frozen, P1 performs the Counter check using P2's first-slot move, while P2 performs it using the last move used by its team.

Because PS uses the acting Pokémon's point of view—in this case, P1's—Counter will fail if P2's first move is Counter. This would not happen on the turn the P2's Pokémon switches in, but only on the following turn, when the Pokémon is asleep or frozen and tries to act, sending its wPlayerMoveListIndex, with a value of 0, to the opponent.
 
Last edited:
If my understanding of counter is correct, it's optimal to keep a counterable move out of slot 1 to avoid proccing counter while burning sleep. I feel like this is not dissimilar to ADV beat up nicknames, where people would be forced to nickname their pokemon "1 2 3 4 5 6" to avoid revealing information. If we assume everyone was to order their moves optimally, removing this would basically just be an aesthetic change rather than a mechanical one, and so I think we should just assume that "slot one" is an uncounterable move even if it technically isn't. I guess there's a niche scenario in which a pokemon with only counterable moves would procc counter while sleeping though, and I don't know how difficult that would be to implement, but overall I think removing this would mechanically change almost nothing while allowing me to avoid running heinous move orders like this:
Screenshot 2026-08-27 at 9.07.52 AM.png

I will also add that these sleeping counter interactions are not completely insignificant. Imagine I get a kill with tauros, chansey comes in, I go to the sleeping pokemon to absorb the twave. If my move order is suboptimal, my opponent can click counter freely and get a kill even if I predicted wave > counter correctly.
 
Back
Top