HP Bar animations and their effect on HP precision

obi

formerly david stone
is a Site Content Manager Alumnusis a Programmer Alumnusis a Senior Staff Member Alumnusis a Smogon Discord Contributor Alumnusis a Researcher Alumnusis a Top Contributor Alumnusis a Battle Simulator Moderator Alumnus
There have been several discussions in the past about HP precision. To briefly summarize those threads, older Pokemon games (not sure what happens in 6, 7, and 8) have an HP bar that is 48 pixels wide. The number of pixels in this bar is the only information you get about how much HP a Pokemon has and how much HP has changed.

I was playing through Pokemon Crystal a few days ago, and it reminded me of something I had forgotten about with regards to HP bar animation -- the more HP a Pokemon has, the longer it takes to animate them losing that HP. This is the case in generations 2, 3, and 4. It does not appear to happen in generation 1, 5, 6, 7, or 8. If a Pokemon has 48 or fewer HP, it animates per pixel (and thus you cannot tell any information beyond what 48ths give you). If a Pokemon has 49 or greater HP, it animates per HP point lost, at a rate of approximately 5 ms per HP. This means that losing 100 HP would take 5.02 seconds, but losing 101 HP would take 5.07 seconds.

Humans probably cannot determine this number down to exact HP precision in most cases, but might be able to distinguish 100 HP vs. 105 HP, for example. The exact point where it becomes distinguishable depends on the person and how they are feeling at that moment in time. In general, though, a person could also point a camera at their screen that will tell them exactly how much HP was lost. Furthermore, if I were to port Technical Machine to the real world, it would do exactly that.

This means that it is possible, at least in theory, for a player to determine exactly how much HP a Pokemon has lost or gained for any high-level Pokemon. They are also told at exactly which HP values the bar changes to 47, 46, etc. out of 48 (because the HP bar is animated). I suspect this means that any Pokemon that has lost at least 4-8% or so its health can have its exact maximum HP determined. This can give away information like whether Raikou has Hidden Power Grass, Hidden Power Water, or Hidden Power Ice / no Hidden Power in Generation 2, because those change its HP DV by a fairly large amount.

Normally I would just post this as a regular bug report, but given the history of the issue, I figured I should post it here instead.

Note that Pokemon Showdown currently sends all HP values as a value out of 100 for opponent Pokemon for these older generations (at least for most formats? Some of the old threads claim there are other formats that give you "/48" HP).

Given the history of discussing this issue, I figured I should also make one important point. There are two components to HP precision. The first component is the policy issue: what information should the server send to the client? The second component is the UI issue: how should the client display this information to the user?

The client can choose to do whatever it wants, and there is no policy decision we can make to affect that. If we decide to send exact HP changes and all values that correspond to a new "/48" value, the client can choose to ignore all of that information and still report HP % (just that certain % values will never be reported). I, as the author of a different client, can choose to use that information in a different way, because "my users" may have goals that are not the same as the default values for the default client. The client could also have a setting that defaults to display % (as calculated from the underlying available information), but users can change it to give them more information, displayed in some user-friendly way as determined by the front-end developers. Or the server can continue to send "/100" HP values, and the client can display it as a %. In that case, the client could even be really silly and display it as "/48" if it wanted. My point is that the way we display the information is entirely a question of what people want to see, but the information we send is a bit more far reaching.
 

Bughouse

Like ships in the night, you're passing me by
is a Site Content Manageris a Forum Moderator Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
Anything that’s going to result in a user needing to wait 25 seconds for blissey to die to close combat gets a no from me. Sure we can apparently measure out this time accurately but everything else involved in the battle is not accurately timed out and then you also have the possibility of players disabling animations and saving all of this time anyway. Why should this one thing be set on a specific timer?
 

MAMP

MAMP!
Anything that’s going to result in a user needing to wait 25 seconds for blissey to die to close combat gets a no from me. Sure we can apparently measure out this time accurately but everything else involved in the battle is not accurately timed out and then you also have the possibility of players disabling animations and saving all of this time anyway. Why should this one thing be set on a specific timer?
this isn't about having accurate hp bar animations on showdown, it's about the fact that the speed at which the hp bar depletes in earlier generations actually gives information about hp investment, which is something that isn't accurately reflected on showdown currently.
 
Last edited:

obi

formerly david stone
is a Site Content Manager Alumnusis a Programmer Alumnusis a Senior Staff Member Alumnusis a Smogon Discord Contributor Alumnusis a Researcher Alumnusis a Top Contributor Alumnusis a Battle Simulator Moderator Alumnus
That is a decision for the client for how best to present the information. That would obviously be a bad way for the client to do so. My point is that the game gives away the exact amount of HP that a Pokemon changes during a match in generations 2, 3, and 4, but the Pokemon Showdown server does not give me that information.
 

Bughouse

Like ships in the night, you're passing me by
is a Site Content Manageris a Forum Moderator Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
OK and how are you going to do that without actually basing it on time? Like what do you actually want the UI to do? I've read your post about 6 times and it's not remotely clear to me.

Moreover, I assure you that not only can a human not tell the difference between 5.02 seconds and 5.07 seconds, they most likely can just barely tell the difference between 5.02 seconds and 5.52 seconds. The concept in psychology is known as the "just-noticeable difference", i.e. if you are given two objects with slightly different weights, can you actually tell that more than half the time (better than chance)? I don't know off the top of my head what the JND is for duration of time, but for things like brightness, volume, and weight they're usually around 5-10%.
 

obi

formerly david stone
is a Site Content Manager Alumnusis a Programmer Alumnusis a Senior Staff Member Alumnusis a Smogon Discord Contributor Alumnusis a Researcher Alumnusis a Top Contributor Alumnusis a Battle Simulator Moderator Alumnus
What we do in the UI depends on how much information we want to show by default. The most straightforward solution would be to say the Pokemon lost N HP, and is now at X% HP (as calculated from the "/48" value).

Someone also alerted me via private message that "/48" is not always the correct value. In some later generations, the HP bar gets increasingly precise, but I believe it is 48 pixels in generations 2, 3, and 4.
 

Nix_Hex

Uangaana kasuttortunga!
is a Site Content Manager Alumnusis a Forum Moderator Alumnusis a Researcher Alumnusis a Top Contributor Alumnusis a Battle Simulator Moderator Alumnus
Could the client not just say "HP depletion duration: 5.delta sec" and make the delta an arbitrary value, equal to a median statistical JND value (if there have been any thorough studies done on the topic)? This prevents the client from becoming a superman simulator while conveying similar information as the cart would. The HP bar in PS wouldn't even have to be reanimated, so no need for a 25 second Blissey OHKO.

Also confirmation that Bughouse is the whitest person on earth, because anyone who can't decipher a time delta of 0.5 seconds couldn't keep a beat to save their lives.
 

pre

pkmn.cc
First off, cool research! I don't know that anyone has looked into HP bar depletion animation speed before as a method for determining exact HP! :)

Someone also alerted me via private message that "/48" is not always the correct value.
This was me. I'm not a researcher so I might be either misunderstanding what I've been told or not up to date on the latest information here, but at least by SM the number of pixels changed from being 48 to 99, which was later inexplicably changed in USUM to 86. I don't know whether the number of pixels was ever changed from the 48 present in RBY in the intervening years. I've seen some research from ih8ih8sn0w that suggests that in Generation 8 there is actually 267 400 pixels present. Coupling this with your HP bar depletion animation speed research, IIUC it seems that cartridge HP information can be inferred with more accuracy than Pokémon Showdown's HP Percentage Mod's /100 in Generation 2, 3, 4, and 8, and possibly to exact HP values in Generation 2, 3, and 4 (and 8 in certain formats where max HP <= 267 400).

I think there probably needs to be a little more research/independent verification of this (like exactly what the scenarios are the HP bar animation speed is sufficient to reveal exact HP information in Generation 2, 3, and 4 - i.e. formalizing "I suspect this means that any Pokemon that has lost at least 4-8%"), but I believe Pokémon Showdown would support implementing cartridge inferrable HP mechanics as part of its goal of accurately implementing cartridge mechanics. However, whether or not Smogon formats adopt this more accurate HP information as opposed to the existing HP Percentage Mod is very much a question for the community (so I'm glad you thought to post this this as a Policy Review thread as opposed to a bug report). This is not a question of simulator accuracy - Pokémon Showdown does not accurately implement HP information and would readily accept fixes there, but whether or not the wider community wishes to play with the increased HP bar accuracy in formats where it is present is the only thing thing up for debate. To my knowledge, Pokémon Showdown has not invested heavily in cartridge-accurate HP bar information because the formats the playerbase prefers are all using HP Percentage Mod and there are currently higher impact features and fixes to work on.

The client can choose to do whatever it wants, and there is no policy decision we can make to affect that. If we decide to send exact HP changes and all values that correspond to a new "/48" value, the client can choose to ignore all of that information and still report HP % (just that certain % values will never be reported).
And here is why I'm actually replying: while I agree that sending more accurate HP information as opposed to percentage values does not force the official Pokémon Showdown client's UI to change in any way (e.g. to change the speed PS currently uses to animate its HP bar or the whether it decides to show the HP information as a percentage /100 or not), including the information in the protocol at all (for alternative clients or for use in AIs etc) necessarily means the information is available to everyone - even if the PS client chooses to display the data with less accuracy, the data would be accessible on the client and easily surfaced via option togges/browser extensions/the developer console etc. Competitive players would be forced to make use of this additional information so as not to be at a disadvantage, meaning the "UI issue" here is moot.

I can only comment with any authority on the technical side of this proposal, I just want to make it clear to the players (who seem potentially to be distracted by other elements of the OP) that AFAICT your proposal amounts to "Remove the HP Percentage Mod in formats where the cartridge would provide more information in favor of cartridge accurate HP display mechanics" (please correct me if I am mischaracterizing your proposal).

My personal belief is that the HP Percentage Mod is desirable because:
  • historical precedent/change inertia
  • /100 is more intuitive to most users than the alternatives
  • it 'feels' more accurate to 'spirit' of cartridge play than exact HP values because even if a machine (or savant) could determine more accurate HP information via counting pixels/judging HP bar depletion animation speed, it isn't something players actually regularly do, and having some uncertainty around what an opponent's current HP is feels more realistic
  • having a single mod consistent across formats seems simpler than varying the amount of HP information available per format
Perhaps I'm completely wrong and players in the community who actually play these formats will leap at the opportunity to eliminate some uncertainty in the game (because of course, Pokémon has more than enough of that already). I don't think my own opinion deserves much weight here given I am not an active player in these formats (which is why I used a hide tag for this last bit) - I am interested in how the playerbase feels.
 
Last edited:

Zarel

Not a Yuyuko fan
is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Pokemon Researcheris an Administrator
Creator of PS
It's true, the HP bar is a bit over 80ish pixels in I think SuMo? And then they trolled us by making it 99 pixels in USUM, I think?

Anyway, I haven't updated this because it's really awkward: the main thing we want to preserve is that if you're playing in-game, you know approximately but not exactly what someone's HP is, and that's extremely awkward to represent by a sim sending exact numbers that anyone who knows how to right-click can get access to.

So yes, right now, our compromise is that we just send less information that you can theoretically figure out from the games. I'm not sure if I have a good solution here. I'd be open to sending a rough estimate of someone's max HP if you take out a big chunk of someone's HP, I suppose.
 

Bughouse

Like ships in the night, you're passing me by
is a Site Content Manageris a Forum Moderator Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
A lit review (lol) turned up this:
https://pdfs.semanticscholar.org/b8...36.1079977262.1594716518-827451718.1594716518
Something in the 5% range seems reasonable based on a number of studies that have measured things vaguely related to tempo. Certain measurements have been found that are more precise. Others are less precise. Using music-based studies seems appropriate since the game does have sound, so some amount of metrical counting would be available for counting the length of time that HP falls for in game. So 5% seems like a reasonable ballpark, and it benchmarks well to other known JNDs. Humans just aren't usually any more precise at measuring things than +/- 5%.

Given that, I would pretty vehemently be opposed to anything that gives a precise HP lost even if that is physically possible to calculate based on the exact number of 48ths lost and the exact amount of time it took the HP bar to animate. Humans just can't estimate that time accurately, and perhaps can't even count the 48ths accurately all the time (probably a better question for people who played VGC years ago when the HP bar was still in 48ths), since that requires a ~2% JND.

While PS does provide quality of life things that humans would otherwise have to track like weather turns, hazards, etc. we've never presented something to people that's just not humanly possible to calculate. The closest we've come is with HP percentage mod, which mostly comes down to people being comfortable with it. And we've explicitly never gotten any more precise than we currently give because we didn't want to give opponents too much information. The current implementation of how much information is available is the happy medium people have agreed to.

I guess there's nothing really "wrong" with adding to the mix some sort of max HP estimate like Zarel proposed, since that's theoretically possible to determine. I'd just give it appropriately wide error bars based on the fact that you both might not be able to count the 48ths accurately and that you might not be able to count the time accurately. And at that point, I'm not sure how useful it is.
If I were going to make any other arguments against adding this sort of max HP estimate, it would be that if it's not instantly knowable and you have to sit down with pen and paper and take a minute to calculate what something is (i.e. not just keep a tally of turn count since Trick Room went up, but like actually do math), that's not something that needs to be done by PS for users for quality of life.
 

Jorgen

World's Strongest Fairy
is a Forum Moderator Alumnusis a Community Contributor Alumnusis a Contributor Alumnusis a Past SPL Champion
Anything that’s going to result in a user needing to wait 25 seconds for blissey to die to close combat gets a no from me. Sure we can apparently measure out this time accurately but everything else involved in the battle is not accurately timed out and then you also have the possibility of players disabling animations and saving all of this time anyway. Why should this one thing be set on a specific timer?
Perhaps this is the most realistic solution of all, though, provided it's compatible with the battle timer. Make "HP depletion animation" an option, turn it off by default, and let the super-competitive folks who want *every* edge on gameday turn it on if they want. It seems clear that trying to get PS! to estimate that HP loss for you seems to be going above and beyond what's realistically needed for quality of life, and likely to give *too much* information in practice.

I will add that methods based on human psychophysics need to account for a lot of complexities in how people perceive time. It's not just JNDs, it's magnitude estimation power laws, biases imposed by recent history, and animation-dependent uncertainty in when to start counting. I can safely say that if you manage to do the data collection and modeling needed to implement this accurately, you have yourself a legit academic paper on your hands. I'd read it, anyway.

EDIT: Understood, you can't trivially implement an HP scroll without the information you're trying to mask becoming available to the users anyway. Not to mention that even if there were some way developed to encrypt that info so that only the routine that needed it could actually use it, people could probably just build a simple app that watches the HP bar until it stops scrolling.
 
Last edited:

pre

pkmn.cc
Perhaps this is the most realistic solution of all, though, provided it's compatible with the battle timer. Make "HP depletion animation" an option, turn it off by default, and let the super-competitive folks who want *every* edge on gameday turn it on if they want.
including the information in the protocol at all (for alternative clients or for use in AIs etc) necessarily means the information is available to everyone - even if the PS client chooses to display the data with less accuracy, the data would be accessible on the client and easily surfaced via option togges/browser extensions/the developer console etc.
To reiterate my point - as long as the data is in the protocol it will trivially be surfaced. This means the data is not only going to be available in the form useful to "super-competitive folks who want to time the HP bar depletion to get an edge", programmers such as myself with take any extra information you would need to add to convey this extra accuracy and turn it into something trivial to understand. Your proposal unfortunately is not possible given the technical realities here.
 

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

Top