jojobear13 / shinpokered

Mostly-vanilla hack of Pokémon Red/Blue focused on bugfixes and trainer ai
209 stars 42 forks source link

Game can't make up its mind reporting if a move is super effective or not very effective #245

Closed DiabloStorm closed 12 months ago

DiabloStorm commented 1 year ago

Click

I found this while I was actually testing something else. For pokemon like Jolteon with focus energy there actually seems to be a very small chance that attacks do not critically hit. What's the explanation there? crit rate is effectively 101.5625% but it's not functioning that way.

jojobear13 commented 1 year ago

I found the problem. The damage effectiveness multiplier only resets at the start of executing a move. This is fine if you plan to do the same damage only once like in vanilla Gen 1. But when I made it so that multiple-hitting attacks can crit and do variable damage with each attack, the multiplier never resets. In fact, it keeps adding to itself and eventually overflows back not not-very-effective.

What's weird is that it is more efficient and blatantly obvious to reset the damage multiplier in the function that actually calculates it. Makes me wonder why Morimoto didn't catch that.

jojobear13 commented 1 year ago

As for not hitting 100% crit rate, there is a line of code in RBY battle engine that caps the critical hit rate at 255 out of 256. I thought it was a bug until I noticed that the same thing was done in the readjusted code for Stadium.

DiabloStorm commented 1 year ago

As for not hitting 100% crit rate, there is a line of code in RBY battle engine that caps the critical hit rate at 255 out of 256. I thought it was a bug until I noticed that the same thing was done in the readjusted code for Stadium.

So are you intending to keep or fix this limitation similar to how DV limitations were fixed? (reworked?)

jojobear13 commented 1 year ago

Fixed in ca13d321a8bbfd582658fe476a32ae13c6aa63a9

So are you intending to keep or fix this limitation similar to how DV limitations were fixed? (reworked?)

Unsure. This will go under a different internal discussion about whether or not to align the hack's crit-rate mechanics to follow Stadium-1. It's algebra is a little different and results in the lowest speed tiers getting a buff and the highest speed tiers getting a nerf.

DiabloStorm commented 1 year ago

I'm actually playing stadium for the first time, can you explain the difference? It seems like other things are different as well, like mimic not letting me choose the move.

Also, if anything the 255/256 "100%" crit chance sounds an awful lot like the 1/256 chance of missing (which was resolved here) You made that one whole, seems fitting to fix the 100% to be 100% here, too.

jojobear13 commented 1 year ago

In vanilla:

In Stadium:

It's not like HAL Laboratory made arbitrary decisions either. Stadium-Japan and Stadium-1 are given a lot of weight when determining intent because they were made for tournament play (particularly based on the rules for Nintendo Cup '97 and '98). That said, they are not treated as dogma. This hack does deviate from them intentionally for certain things. The big one that comes to mind is Hyper Beam requiring recharge on a miss; literally everyone said that it "fucking sucked" even though that's truly how it was intended to work in gen 1.

Me personally? I'm indifferent either way. 1/256 is only an extra 0.4% to crit.