The Reffing Calculator

1. The Reffing Calculator

This is a major issue and it needs to be solved.

As you know, it is possible for the reffing calc to show HP equal to 1 HP less than the % indicates. Many people have the wrong impression of how this works. Let's take Staraptor's Close Combat on Tyranitar.

Staraptor using 120 BP Fighting Physical on Tyranitar.

On URPG Reffing Calculator it shows 0 HP and 0.25%.

On URPG Reffing Calculator it shows 1 HP and 0.25%.

Now let's take Excadrill. It is Ground/Steel type and has 424 HP. As you probably know, Steel types are immune to Poison type moves. So if you use a Poison move on it it's health should remain unchanged, right? Put it at 423 HP and have Gengar repeatedly Sludge Bomb it (90 Poison Special). You'll find it takes damage until it reaches 87.5%.

This is a very important issue that can sometimes change the outcome of a battle.

I want to hear your thoughts on the matter, and possible solutions.

And no Mav, this is not the place to just say "I don't care, I'm the ref" as you have several times before.

@~Near @Alaskapigeon @AmericanTreeFrog @Ataro @august13th @Bumblebee @Buzzer @Captain Dude @ChainReaction01 @derian @DrStubbsberg @Ebail @Eeveedude @Fierce Deity @FlammenWarfare @Fossil Fusion @gmandiddy @husnain @iReign @MaverickKaiser @Monbrey @Mubz @Neonsands @Nitro @Roulette @Scourge of Nemo @SiberianTiger @Synthesis @The Crimson Rose @Team Evolution @TheEvilDookie @The Jr. Trainer @The pokemaster @Toxophilite @Volcanflame @We Taste Pies... @WebMaster @WinterVines @Xali @Zeferin

I mentioned all the refs I could think of that were active (I'm not sure if there's actually an up to date list of refs anywhere). If you think of someone else please show them this thread somehow.

Damnit Pidge, why do you have a name that you can't do anything with? :|

2. Re: The Reffing Calculator

If you even try to calc damage for a poison move on a steel Pokemon you shouldn't be a ref.

Other than that, Monbrey has to change the formula on one of them to make them do the same damage amount. And if it is that big of a deal you can take the % left on the Pokemon and multiply it by the max HP of the Pokemon to see how much raw HP it should have left.

3. Re: The Reffing Calculator

Originally Posted by The Jr. Trainer
If you even try to calc damage for a poison move on a steel Pokemon you shouldn't be a ref.

Other than that, Monbrey has to change the formula on one of them to make them do the same damage amount. And if it is that big of a deal you can take the % left on the Pokemon and multiply it by the max HP of the Pokemon to see how much raw HP it should have left.

In this case 404 x 0.25% = 1.01

round down = 1hp left = ALIVE

Edit:

To give another example.

An x Pokemon with 384hp (eg Abomasnow) is left to show with 0.25% left. Although two calcs (A and B) show 1hp and 0hp respectively. If you do the calculation 384hp x 0.25% = 0.96. Always round down to the nearest whole number = 0 HP = DEAD

Edit2:
I̶ ̶w̶o̶n̶'̶t̶ ̶e̶v̶e̶n̶ ̶a̶d̶d̶r̶e̶s̶s̶ ̶t̶h̶e̶ ̶S̶t̶e̶e̶l̶ ̶v̶ ̶P̶o̶i̶s̶o̶n̶ ̶"̶p̶r̶o̶b̶l̶e̶m̶"̶ ̶.̶_̶.̶

Edit3:
If the damage formula's damage is 0 and the foe is not immune to the move used, the damage dealt will be 1 instead. This will happen if, say, a Level 2 Bidoof uses Tackle against a Level 100 Aggron. To paraphrase, unless the move does not affect the foe, the minimum amount of damage done is 1.
@ Steel v Poison. The calc is probably set with Steel being not immune to Poison.

4. Re: The Reffing Calculator

This issue has been brought up before, and no definitive solution was found. I was aware of the issue when I originally rewrote the calc, but found no reason for it to be doing it in the formula. The raw damage and raw HP remaining don't line up, and so the percentage therefore can't match both. Last time this came up Pidge put forward a new formula which meant the percentage did match the HP... but then the damage displayed was wrong instead. Either way, there was a 1 point inconsistency, and it doesn't seem to be in the damage equation, it's elsewhere. I'll look into it when I have the time. For now, Pidge should just make a decision towards what we go by, the HP or the percentage, so all refs can at least be consistent and thus avoid "BUT THE HP/PERCETNAGE ISNT AT 0 YET!" arguments.

As for the Poison vs Steel thing, although I completely agree that any ref should know better, the calc should know better too. Ground doesn't effect Flying types, and the same should be true here. I'll fix that tomorrow.

5. Re: The Reffing Calculator

If you don't like the way it is, use the real reffing formula, it's found somewhere in the ref encyclopedia or some other site iirc. It should usually be right.

6. Re: The Reffing Calculator

I dont know much about the damage formula n such, but wouldnt the damage be rounded rather than the actual hp left?

7. Re: The Reffing Calculator

Originally Posted by Sir Piggy Longshaft
If you don't like the way it is, use the real reffing formula, it's found somewhere in the ref encyclopedia or some other site iirc. It should usually be right.
The formula itself was removed from the 'pedia for some reason, and everywhere else that documents it has the random number variable that the games use that we don't. Last I checked (though I could've gotten it wrong), the input for the random variable we use here isn't any of the extremes, and I'm not trying to find what it is anymore, so until someone finds out/reveals it, we can't exactly use it.

8. Re: The Reffing Calculator

The calculator doesn't have a minimum damage iirc, if you put in Charmander Att-6 using Scratch on Aggron Def+6 Ref @ Chilan Berry it does 0 damage, both according to HP and %. At least, if Aggron starts from full health. If Aggron starts injured by 1 the HP goes down by 1 and the % remains unchanged. The same is true for the Excadrill example. As far as I can tell, the % seems correct but the HP is wrong. Because the calculator deals damage in terms of HP, after the first attack it uses the incorrect HP and deals 1 extra damage according to % and 2 according to HP, and so on. For some reason there are some HP amounts that stop this glitch, at least when doing 0%/1HP. There was a post on this a while ago, the link to which is in my sig.

9. Re: The Reffing Calculator

Like Si said, the damage formula doesn't work for what we use because of the random number generated. When you take both minimum and maximum damage from the formula and take the average of both values, it isn't even the damage that we get with ours, being off by a few HP. I used the Weavile Vs. Tyranitar with Low Kick calc, getting 403 damage with our calculator but only getting 402 with the formula version.

Also, when looking at the damage formula, it says on the info page that rounding is necessary to do at every stage in order for it to work correctly (rounding off to the closest non-decimal number at each stage, iirc). It's unfortunate that we can't even use the formula to work around this issue. I do like Jr and Keta's fixing response, if you didn't want to just check the HP value from the damage box and subtract that instead of just using the percents.

10. Re: The Reffing Calculator

There's actually two problems about the reffing calc. The damage in the test calc and the full-featured calc are BOTH off. The other problem is that in the full featured calc, the result damage box and the box displaying the Pokemon's remaining HP don't add up (literally). Let's take a look at the damage formula, as according to Smogon:

The Complete Damage Formula for Diamond &#38; Pearl (D/P) - Smogon University

"Damage Formula = (((((((Level × 2 ÷ 5) + 2) × BasePower × [Sp]Atk ÷ 50) ÷ [Sp]Def) × Mod1) + 2) × CH × Mod2 × R ÷ 100) × STAB × Type1 × Type2 × Mod3)"

"It should be immediately mentioned that after successfully performing an operator (an operator being +, -, × or ÷), you need to "round down" the number to the nearest whole number before performing the next one. In simple terms, this means to remove all the numbers to the right of the decimal point every time the answer is a decimal before proceeding with the next arithmetic operation."

So basically you round down to the nearest whole number after each operation.

The URPG follows that formula to the dot, except one part, which is the R value. This is the random number that can give you varying damage in Pokemon. In URPG, we use the value 92.5 for R, since it is the median of the numbers R can be, 85-100. R only being 85-100 is a relatively new discovery: Smogon Community, but I don't think it really accounts for the errors we see, although the new calc I'll post later does use this new information. Let's manually calculate the damage Staraptor does to Tyranitar with Close Combat, and no other modifiers.

(((((((100 × 2 ÷ 5) + 2) × 120 × 339 ÷ 50) ÷ 319) × 1) + 2) × 1 × 1 × 92.5 ÷ 100) × 1 × 2 × 2 × 1) = 400

REMEMBER TO REMOVE ANY DECIMALS (ROUND DOWN TO NEAREST WHOLE NUMBER) AFTER YOU CALCULATE EACH OPERATOR.

Tyranitar starts with 404 HP.
On URPG Reffing Calculator the damage is -403 and leaves Tyranitar with 0 HP.
On URPG Reffing Calculator the damage is -403 and leaves Tyranitar with 1 HP.

We can try another example. Let's do Togekiss using Flamethrower on Metagross.

(((((((100 × 2 ÷ 5) + 2) × 95 × 339 ÷ 50) ÷ 279) × 1) + 2) × 1 × 1 × 92.5 ÷ 100) × 1 × 2 × 1 × 1) = 180

Metagross starts with 364 HP.
On URPG Reffing Calculator the damage is -181 and leaves Tyranitar with 182 HP.
On URPG Reffing Calculator the damage is -181 and leaves Metagross with 183.

If you are following closely, you notice that the damage the calc finds is not equal to the damage we get manually using the formula. Furthermore, on the new calculator, the damage that a Pokemon is left with does not match the damage that it says its done. These are the two problems I mentioned at the begining of this post, I'm just proving it to you now.

So how do we fix it? Well Espeon (you probably don't know him) and I looked at the source code of the the 99k calc and found the part with the damage formula. There was probably some rounding errors due to slightly incorrectly written code, and the slight change with the new R value may have affected it, I really didn't want to go through the math to find out. Instead of finding what was wrong with it exactly, I just replaced the whole formula, making sure it was written exactly like the one I just showed. I tried it out, and the result damage was correct! However, the second problem, about the result damage not matching with the Pokemon's remaining HP still remained. After Espeon looked at the code for a while, he got it! and explained:

So here is the modified version of the calc, don't worry about the buttons. When Monbrey hosts this version, he can fix the button images.

fixcalc - URPG Stuff

Please test it out to make sure everything works correctly.

Oh yeah, and if a Pokemon has 0 HP in the HP remaining box, it's KOd, even if the % says something like 0.24%. This has what it has been like for a while.

11. Re: The Reffing Calculator

tl;dr

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•