my profile | search | faq | forum home
 » The Azure Heights Forum   » Main Campus   » Research Lab   » Damage Tests of the NEW Damage Formula

Author Topic: Damage Tests of the NEW Damage Formula
 Porcupine Farting Nudist Member # 46 Member Rated: posted 05-02-2000 09:54 PM                     I've done some preliminary tests on the new BDF, from TeamPA. Please check my results if anyone has time. I'm quite sure formula works PERFECTLY for reasonable damages, and I tested it in the extreme cases where the attacks would do 1 - 4 damage because the attacking pokemon is pitifully weak. In all my tests, I used an attacking pokemon with 1 Attack and 1 Special, and a defending pokemon with 500 Defense and 500 Special. All pokemon are L100.1) Charizard using Bubble to hit Charizard - SUCCESS!!!Each time, the attack does EXACTLY 3 damage. I proceeded to hit with Bubble again and again, and on my 26th Bubble, it did 4 damage instead of 3. Then it did 3 damage again for some more Bubbles. This correlates EXACTLY with the new BDF...it illustrates that weird quirk I mention in the other BDF topic. According to new BDF, the damage should be:((0 + 2) x 2) x Z / 255, where 217<=Z<=255, and the answer truncates the decimalsThe 0 is there because the attacking pokemon is so pathetically weak he does 0 damage in that part of the formula. This formula gives 4 damage when Z = 255, and 3 damage otherwise. Meaning that 97.4% of the time you get 3 damage, but the rest of the time you get 4 damage.2) Parasect using Flamethrower to hit Charizard - FAILURE (the only failure of this formula I know of)Each time, the attack did 1 damage. I did this attack about 10 times and it always did 1 damage. I do not know if doing this attack a hundred times would occasionally give 2 damage (how the BDF works), I didn't test.However, the new BDF says the damage should be ZERO most of the time, and 1 on that really rare occasion.((0 + 2) x 0.5) x Z / 255This gives 1 damage when Z = 255, and 0 damage otherwise.3) Parasect using Vine Whip to hit Charizard - SUCCESSThe BDF says it should do 0 damage no matter what, even if Z = 255. I didn't do this enough times to make sure it never equals to 1 on that very rare occasion, but in about 20 Vine Whips it always did 0 damage. Note: when an attack does 0 damage in Pokemon it will say "The Attack Missed..." instead of showing it hit.Probably the new BDF needs some very minor correction or reinterpretation/refinement for this extreme case. I'll figure it out later.------------------ From: Honolulu, HI, USA | Registered: Feb 2000  |  IP: Logged
 Meowth346 Farting Nudist Member # 166 posted 05-03-2000 10:20 AM                    It would be strange to see a mistake in TeamPA's work. Like me, they get their formaulas straight from NO\$GMB. It prints right out (in a sort' computer talk) "Add this, subtract that, divide by the variable to RAM location ****, convert to binary, etc, etc, etc". Of course, those are just random example, not parts of the battle formulas ^_^--Meowth346------------------PokéResearcher in charge of Pokémon Foreverfound via http://anime.at/pokefor Registered: Mar 2000  |  IP: Logged
 Mr. K Racist Member # 2 Member Rated: posted 05-03-2000 12:33 PM                        It seems reasonable that, even if you're ripping the ROM code directly, you can miss a step that isn't clumped in with all the rest of the steps, or that you can miss a condition you hadn't thought to test, so you don't see the code branching that way.I dunno if that's the case, but my point is that just having access to the code doesn't solve all problems. If I gave the source code to Windows (or even this forum) to even a great programmer, he could easily misinterpret some steps.Not saying that's what's going on here, but I just thought I'd point it out.By the way, Wintermute's working on an updated BDF page and the first draft looks great.------------------KOFFING!Azure Heights Pokémon Laboratory From: Cinnabar Island | Registered: Feb 2000  |  IP: Logged
 Porcupine Farting Nudist Member # 46 Member Rated: posted 05-03-2000 09:42 PM                     I have done much more low-damage testing on the new BDF. Here are the updated data and new data:2) Parasect using Flamethrower to hit Charizard - FAILURE (the only one so far)Same result as before, it always does 1 damage. In addition, I did this test 66 times, and it always did 1 damage. So POSSIBLY it will never do 2 or 0 damage, and thus is exempt from the "max damage quirk."3) Parasect using Vine Whip to hit Charizard - SUCCESSStill does 0 damage. In addition I did this test 55 times and it always did 0 damage. The BDF does say that for this one case, there should be no "max damage quirk."4) Lickitung using Scratch to hit Charizard - SUCCESSI did this attack about 10 times. 9 times I got 2 damage, and 1 time I got 3 damage. This agrees with the new BDF. I got lucky to see the RARE 3 damage so early.5) Charizard using Scratch to hit Charizard - SUCCESSEach time, the attack did 1 damage. This agrees with the new BDF. The BDF also says that 1/39th of the time I should get 2 damage from the "max damage quirk." After 73 scratches, I finally saw it do 2 damage once.------------------I can think of two ways to easily fix the BDF to show that one FAILURE.One, possibly how "Not Very Effective..." works in the formula is where the modifications need to be made. We could test for this by testing for the EXACT range of damages, for any attack of any damage, where the "Not Very Effective..." actually happens. No one tests for this stuff naturally.Two (the explanation I currently favor), there is a special case that occurs when determining Z (the randomness variable). Let's call the damage we calculate from the new BDF before doing the Z multiplication, MaxPossibleDamage. To determine Z, the game does, in pseudocode:if (MaxPossibleDamage > 1) then Z = random number between 217 and 255otherwise Z = 255Dunno why they would do this. If MaxPossibleDamage comes out to be 0 (my test case 3) whether you use this new code or just generate a random number anyway, makes no difference, you'll just get 0 always.------------------ From: Honolulu, HI, USA | Registered: Feb 2000  |  IP: Logged
 RagingTauros Orangutan Spouse Member # 340 Rate Member posted 05-03-2000 09:47 PM                     So, What is the actual formula? From: Belle Mead, NJ, USA | Registered: Apr 2000  |  IP: Logged
 NeoSyrex Farting Nudist Member # 52 Member Rated: posted 05-03-2000 10:47 PM                        ((2L/5+2)*A*P/D)/50)+2)*T)*M)*R/255L = levelA = attack or specialP = ability's powerD = defense or specialT = type match (1, 1.5)M = type mods (0, 0.25, 0.5, 1, 2, 4)R = a random number between 217 and 255------------------NeoSyrex™ [ NeoSyrex@hotmail.com ] From: New Jersey, USA | Registered: Feb 2000  |  IP: Logged
 Dan and the Kirbys Farting Nudist Member # 221 Member Rated: posted 05-04-2000 07:57 PM                    quote:Originally posted by NeoSyrex:((2L/5+2)*A*P/D)/50)+2)*T)*M)*R/255L = levelA = attack or specialP = ability's powerD = defense or specialT = type match (1, 1.5)M = type mods (0, 0.25, 0.5, 1, 2, 4)R = a random number between 217 and 255Where does a critical hit modifier come in here? Is there one at all? Is the CH damage instead figured after the formula is used? So many questions...-----------------------------------------/('.')\ Beware the Kirbys... Registered: Apr 2000  |  IP: Logged
 NeoSyrex Farting Nudist Member # 52 Member Rated: posted 05-04-2000 08:50 PM                        The critical hit modifier is part of the Attack/Special variable. Just multiply the pokémon's base Attack/Special by 2, and use it as the "A" variable.------------------NeoSyrex™ [ NeoSyrex@hotmail.com ] From: New Jersey, USA | Registered: Feb 2000  |  IP: Logged
 Gyarados Scotty Orangutan Spouse Member # 367 Rate Member posted 05-04-2000 08:57 PM                    Brain...Hurting...------------------Behold the Sig of Gyarados Scotty, witty comment extraordinaire!!! From: Canada eh! | Registered: May 2000  |  IP: Logged
 NeoSyrex Farting Nudist Member # 52 Member Rated: posted 05-04-2000 10:56 PM                        Here's something a little fishy: http://pojo.com/Features/0500/50400BattleFormula.html It seems a little odd to me that they just happened to find the code in the ROM a week after we found the formula. Heh, but we aren't ones to talk, as we got the crucial parts from TeamPA's site . But at least I gave credit to them, instead of trying to pass it off as my own findings.------------------NeoSyrex™ [ NeoSyrex@hotmail.com ] From: New Jersey, USA | Registered: Feb 2000  |  IP: Logged
 White Cat Nobody knows why I'm an admin. Member # 42 Member Rated: posted 05-05-2000 01:48 AM                     Is there a message board on Pojo.com where we can point out this "coincidence?" >: From: Calgary | Registered: Feb 2000  |  IP: Logged
 NeoSyrex Farting Nudist Member # 52 Member Rated: posted 05-05-2000 03:18 PM                        Doesn't look like it, unfortunately. I seriously doubt the webmasters would care, and since the guy didn't leave an e-mail addy we can't "inform" him of this "coincidence" .------------------NeoSyrex™ [ NeoSyrex@hotmail.com ] From: New Jersey, USA | Registered: Feb 2000  |  IP: Logged
 Porcupine Farting Nudist Member # 46 Member Rated: posted 05-05-2000 07:40 PM                     Personally I would rarely care if someone "stole" any findings I might make. I can see why it would matter to some people, and in some cases, though.NeoSyrex, a critical hit multiplies L by 2, not A. Same goes for Light Screen and Reflect (divides L by 2). Some of the damage tests I did show this. It rarely matters though, and at most makes a few points of HP difference.------------------ From: Honolulu, HI, USA | Registered: Feb 2000  |  IP: Logged
 MewtwoSama Asshole Member # 12 Member Rated: posted 05-10-2000 04:22 PM                        quote:((2L/5+2)*A*P/D)/50)+2)*T)*M)*R/255L = levelA = attack or specialP = ability's powerD = defense or specialT = type match (1, 1.5)M = type mods (0, 0.25, 0.5, 1, 2, 4)R = a random number between 217 and 255How is A*M kept under 999Exapmle: Mewtwo's use of only 2 AmensiaHow does the new BDF accomidate a full powered Mewtwo?------------------AIM: MewtwoSamaIt's cold, glowing eyes strike fear into it's enemies.Chicken Mcnugget Tuesdays From: Abyss of Evil | Registered: Feb 2000  |  IP: Logged
 Porcupine Farting Nudist Member # 46 Member Rated: posted 05-10-2000 05:00 PM                     M is for Super Effective, Not Very Effective.It is not for Amnesia, Barrier, etc.------------------ From: Honolulu, HI, USA | Registered: Feb 2000  |  IP: Logged
 MewtwoSama Asshole Member # 12 Member Rated: posted 05-10-2000 05:29 PM                        Hmmm,((2L/5+2)*A*P/D)/50)+2)*T)*M)*R/255I guess stat modifiers directly modify A and DIf offense multipler was called GIf defense multipler was called H((2L/5+2)*G*A*P/(D*H))/50)+2)*T)*M)*R/255Maybe if I run "If A > 1000 Then" argument... From: Abyss of Evil | Registered: Feb 2000  |  IP: Logged
 Gandalf Farting Nudist Member # 77 Member Rated: posted 05-11-2000 01:55 PM                        So just to make sure I've got this straight,stat modifiers (amnesia etc.) directly modify as in 2,3,4*special, and in the 'between 217 and 255', does that INCLUDE 217 and 255?Thanks.---------------------Gandalf--- Registered: Feb 2000  |  IP: Logged
 katsura Orangutan Spouse Member # 163 Rate Member posted 05-11-2000 03:56 PM                     I'm a little uninformed. What about the OLD base damage formula? It was innacurate?I'm reffering to:(ATTACK*POWER*LEVEL*CHIT(MODIFIERS IN HERE)*WEAKNESS)\(128*DEFENSE-1)That is wrong? Also, what is PA?------------------Mew VS Mewtwo:Mewtwo amnesia'sMew thunderwavesMew (now faster) horn drills, one HIT ko!!! Registered: Mar 2000  |  IP: Logged
 Porcupine Farting Nudist Member # 46 Member Rated: posted 05-11-2000 04:48 PM                     Gandalf exactly right. Also, all the divisons are integer divisions so you throw away the remainder. If you think about it, that means you'll only get the max possible damage of an attack when R = 255, which is a weird thing but I determined to be true experimentally.PA refers to a Japanese WWW site by someone (a group?) called TeamPA.katsura I wonder that question too. I think the answer is that the OLD formula WAS inaccurate. The New and Old formulas always agree with each other roughly (a few HP or so difference) but don't quite match up. In addition, the two formulas are totally incompatible. If one is right the other has to be wrong, and not even in a similar mathematical form.So, the strange thing that really bothers me is, why is the Old damage formula so much simpler and elegant looking than the New one, matches up with the New one to within a few HP, yet the programmers decided to use the New formula instead?------------------ From: Honolulu, HI, USA | Registered: Feb 2000  |  IP: Logged
 White Cat Nobody knows why I'm an admin. Member # 42 Member Rated: posted 05-12-2000 06:00 AM                     So, the strange thing that really bothers me is, why is the Old damage formula so much simpler and elegant looking than the New one, matches up with the New one to within a few HP, yet the programmers decided to use the New formula instead?You have to remember that the programmers didn't start out with the old formula and then switch. They built the "new" one from the start. The one we've been using is just a close approximation Azure got through guess-and-test before we found out the real one. From: Calgary | Registered: Feb 2000  |  IP: Logged
 Porcupine Farting Nudist Member # 46 Member Rated: posted 05-12-2000 09:28 PM                     That could be, White Cat. After all, through guessing we would be more likely to think up simple, elegant formulas, right?But, the fact that the old simple formula is SO close (to within 2 HP almost always), and even uses computerish numbers (128), is what bothers me. It's not even a close approximation, it's a SUPER close approximation. And wasn't that formula supposedly given out by Nintendo employees? (true or false, can anyone confirm this)Maybe what happened was, in the game design phase, they wrote down a simple formula which WAS the old damage formula. Then, as they were actually programming Pokemon, some (possibly foolish) programmers did it a slightly different way, which became the new damage formula. There's no reason I can see for the formula to be as complex as the new BDF...the old one would actually be faster, better, and simpler to program in I think.------------------ From: Honolulu, HI, USA | Registered: Feb 2000  |  IP: Logged
 J. Thaddeus Toad Citrus Fondler Member # 3 Member Rated: posted 05-12-2000 09:38 PM                        quote:Originally posted by Porcupine:And wasn't that formula supposedly given out by Nintendo employees? (true or false, can anyone confirm this)The formula we have up now (awaiting updating) was hashed out by Wintermute. Nintendo employees don't know diddly.------------------JT ToadSemper Absurda From: Toad Hall | Registered: Feb 2000  |  IP: Logged
 Givera Farting Nudist Member # 234 Member Rated: posted 05-13-2000 05:53 PM                    quote:Originally posted by Porcupine:NeoSyrex, a critical hit multiplies L by 2, not A. Same goes for Light Screen and Reflect (divides L by 2). Some of the damage tests I did show this. It rarely matters though, and at most makes a few points of HP difference.So when stat modifiers come into play (E.G. Amnesia, Growth, Acid Armor, etc) Do they affect L before it's plugged into the formula or does it affect A and D?? I would think L to follow suit w/ Critical Hits but then nothing stops stats from going over 999... and if CH's are adjusted at L and stat modifiers at A/D then 1 Swords Dance or Amnesia could be better/worse than Focus Energy...-GiveraP.S. - If we know where Z is stored why don't you just use Game Shark and hack it to 255 for one attack and 217 for another??------------------"My staff is complaining about the rats in the kitchen; I want to hire a new staff" -Lunchlady Doris on how to spend the School's oil money"If any punk-a** Charmander tries to mount my Koffing, I'll have Wiggly crack his spine and Lee will throw him in a vat of Psyduck Surf!" -Mr. K on different species ability to breed"Heh.....ditto is a G** D*** pimp in g/s....he gets all the a**.." -Argo on Ditto's ability to breed with anything/one"My Mewtwo's slower than yours because he just had his way with that cute eevee over there, and now he's tired" -CFalcon making a pun on how sex (gender) affects stats[This message has been edited by Givera (edited 05-13-2000).][This message has been edited by Givera (edited 05-13-2000).] From: Plano, Tx | Registered: Apr 2000  |  IP: Logged
 Givera Farting Nudist Member # 234 Member Rated: posted 05-18-2000 06:40 PM                    quote:Originally posted by Porcupine:That could be, White Cat. After all, through guessing we would be more likely to think up simple, elegant formulas, right?But, the fact that the old simple formula is SO close (to within 2 HP almost always), and even uses computerish numbers (128), is what bothers me. It's not even a close approximation, it's a SUPER close approximation. . . .If you really look at the two formulas they are almost identical... Here's the old one (BTW - I'm only comparing the CORE of the two formulas at the moment):[(ABLF/D128E) + 1]A = attacker's Attack stat (or Special)B = base damage for the moveL = attacker's LevelF = offensive stat modifierD = defender's Defense stat (or Special)E = defensive stat modifierNow let's simplify A*F and D*E into Atk and Def (Respectively) because we now it's plugged in prior to the calculation (I'm also going to rename L to Lvl and B to Pwr)... here's the "New" OLD formula:[((Atk * Pwr * Lvl)/(128*Def)) + 1]Atk = attacker's Attack stat (or Special) * offensive stat modifierPwr = base damage for the moveLvl = attacker's LevelDef = defender's Defense stat (or SpecialFinally let's multiply by 1.09 so that it's at the max to match the NEW formula (The NEW formula is already at the max) here it is (I rounded everything down...):[((Atk * Pwr * Lvl)/(117*Def)) + 1]Now doesn't that look familiar? Let's look at the NEW formula...(((2L/5+2)*A*P/D)/50)+2L = levelA = attack or specialP = ability's powerD = defense or specialNow I was simpifying the formula after I finished my exam today and it started to look VERY similar to the "New" OLD formula...((Pwr * Atk * (Lvl + 5))/(125 * Def))+2Now if we compare that to the "New" OLD formula the only differences are you add 5 to the Level before multiplying, 117 instead of 125 and you add 2 not 1 to the end... VERY CLOSE! (The differences SORT OF cancel out...)Now both formulas BASICLY use the same STAB and Effectiveness formulas (Except the NEW one truncates every operation where as the OLD one truncates only at the end...)Finally is the matter of a random variance to the damage... the OLD formula says to multiply by 1.09 for the max and divide by 1.09 for the min while the NEW is already at the max and you just multiply by 217/255 to get the min... let's TRY to compare these... now we've (Well I have at least ) decided the two simplified formulas are very similar so ... (How do I explain this?? :confused since they're both at the max we don't need to compare that but we DO need to compare the minimums... Since the OLD formula was multiplied by 1.09 we need to divide by that then divide by 1.09 AGAIN to get the minimum which is 84.16% (1/1.1881) while 217/255 is 85.09% (217/255) again VERY similar...So we (Again at least *I*) can understand why they match up so well... WHEW I'm glad that post is done... (WOW! AOL didn't crash once the whole time!! )-Givera------------------"My staff is complaining about the rats in the kitchen; I want to hire a new staff" -Lunchlady Doris on how to spend the School's oil money"If any punk-a** Charmander tries to mount my Koffing, I'll have Wiggly crack his spine and Lee will throw him in a vat of Psyduck Surf!" -Mr. K on different species ability to breed"Heh.....ditto is a G** D*** pimp in g/s....he gets all the a**.." -Argo on Ditto's ability to breed with anything/one"My Mewtwo's slower than yours because he just had his way with that cute eevee over there, and now he's tired" -CFalcon making a pun on how sex (gender) affects stats[This message has been edited by Givera (edited 05-18-2000).][This message has been edited by Givera (edited 05-18-2000).][This message has been edited by Givera (edited 05-19-2000).] From: Plano, Tx | Registered: Apr 2000  |  IP: Logged
 Porcupine Farting Nudist Member # 46 Member Rated: posted 05-19-2000 04:42 PM                     Hey, a nice simplification of the new Damage Formula there, Givera. I verified for myself that it is correct. It does look a little more like the old damage formula, but I dunno if it looks like it enough to satisfy me. I'll think about it some more a bit later.What you wrote about CH's modifying L and statmodifiers modifying Attack and Defense is correct. The effect of a Critical Hit is not as good as the effect of a Swords Dance, although the difference is very minor. You can see this in the damage tests I did on Slash vs Sky Attack a while back...it's not the same thing but it's very similar (actually it is the same thing if you believe the new damage formula).------------------ From: Honolulu, HI, USA | Registered: Feb 2000  |  IP: Logged
 Givera Farting Nudist Member # 234 Member Rated: posted 05-19-2000 07:12 PM                    Well I looked into my simplified NEW battle damage formula... and it's (As far as I can see) 100% accurate as long as the level is divisible by 5 (Or theoretically by 2.5 - But you cann't have a level divisible by 2.5...) If it isn't then it's *usually* off by 1 or 2 points... Porcupine - What are you talking about? Slash vs. Sky Attack?? (Maybe I was just asleep when I read the post... ) BTW - I wasn't comparing the two formulas to show that they're the same - Just that they're very similar and that's why they almost always have similar results...-Givera------------------"My staff is complaining about the rats in the kitchen; I want to hire a new staff" -Lunchlady Doris on how to spend the School's oil money"If any punk-a** Charmander tries to mount my Koffing, I'll have Wiggly crack his spine and Lee will throw him in a vat of Psyduck Surf!" -Mr. K on different species ability to breed"Heh.....ditto is a G** D*** pimp in g/s....he gets all the a**.." -Argo on Ditto's ability to breed with anything/one"My Mewtwo's slower than yours because he just had his way with that cute eevee over there, and now he's tired" -CFalcon making a pun on how sex (gender) affects stats From: Plano, Tx | Registered: Apr 2000  |  IP: Logged
 Mr. K Racist Member # 2 Member Rated: posted 05-19-2000 10:10 PM                        ...an important thing to remember is that the new formula was hacked straight out of the ROM, whereas the old formula was derived simply by observing results.Ever try to reverse-engineer anything that complex without any help from the original designer?In other words, Wintermute friggin rules.------------------KOFFING!Azure Heights Pokémon Laboratory From: Cinnabar Island | Registered: Feb 2000  |  IP: Logged
 GolemKong Farting Nudist Member # 16 Member Rated: posted 05-21-2000 02:22 PM                        quote:Originally posted by Mr. K:In other words, Wintermute friggin rules.Couldn't have put it better myself. From: Ontario! | Registered: Feb 2000  |  IP: Logged
 Porcupine Farting Nudist Member # 46 Member Rated: posted 05-23-2000 04:05 PM                     Givera, in a post a while back I posted the damage ranges for Sky Attack and Slash, and noticed that they were different by 4 points of damage. Since Sky Attack does 140 damage and Slash does 70 damage, Sky Attack should be the exact same as a Sword Dance'd normal Slash. But the damage ranges for Sky Attack and Slash (with Critical Hit) were different by 4 points. So that would indirectly illustrate experimentally the minor damage differences between a Critical Hit and a Sword Dance. Hey, what does this mean anyway? Also it is different from the one in my heading's post. What is it? ------------------ From: Honolulu, HI, USA | Registered: Feb 2000  |  IP: Logged

 All times are ET (US)
 Printer-friendly view of this topic Hop To: Select a Forum: Category: Welcome Center -------------------- Information Booth Complaints Dept. Category: Main Campus -------------------- Research Lab Muk Center Auditorium Oddish Memorial Lecture Hall Omanyte Historical Foundation Sakaki Tower Kabuto Archaeological Society Category: Onix Annex -------------------- Azure Arena Arbok's Internet Cafe Azure Pokemon Center Category: The Courtyard -------------------- Karp Park