jojobear13 / shinpokered

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

Bug: Taking Mt Moon fossil breaks trainer sight #270

Closed Mord5 closed 12 months ago

Mord5 commented 1 year ago

What emulator and/or hardware are you are using? bgb 1.5.9.w64

What version of this project are you using? built from source master_dev commit https://github.com/jojobear13/shinpokered/commit/ec22e28db46496b31319ddad2fef564430756451

What is the problem you encountered? In Mt Moon B2F, taking one of the fossils causes unfought trainers' sight ranges to become 0.

Is it possible to reproduce the problem? Leave an optional Rocket unfought, beat the Super Nerd and take a fossil, then go back and stand in the Rocket's view range.

For reasons I can't fathom, MtMoon3Script_49d91 prevents jp to CheckFightingMapTrainers after one of the fossils has been taken.

Vortyne commented 1 year ago

I think it's supposed to be that it considers you to have "finished" the area if you picked up the fossil, similar to how you cannot fight other trainers in a gym after having defeated the leader

Mord5 commented 1 year ago

You can still fight them if you talk to them, though, without needing to go through the rematch prompt.

Vortyne commented 1 year ago

May have been a half-baked version of what they actually wanted it to do (this is in the original game)

jojobear13 commented 1 year ago

I don't think this was a matter of trying to deactivate Mt. Moon akin to how gyms are done. If it were, when why deactivate only the third floor? Also, it would be much simpler to deactivate all of Mt. Moon by setting all the trainer event constants via script like how its actually done in gyms.

No, I think this has to do with the Fossil Supernerd trainer. He's kinda unique in that he's a regular trainer that also has a movement script that he does later. I suspect the programmer had some issues with doing his movement without also triggering a battle with him or something else that messes things up. There's two pieces of evidence.

These spaces are rigged so that they do not trigger battles. There is no reason for this at all unless you want to prevent sight-based battles and wild battles after beating the Supernerd. Dev builds of red and green had map trainers reset on every load. If the Supernerd was originally a sight-based trainer, this would prevent fighting him again in one of these earlier builds. This looks like an attempt that was abandoned. image

Then, as Mord5 said, MtMoon3Script_49d91 prevents jp to CheckFightingMapTrainers after one of the fossils has been taken. This would prevent a sight-based trainer battle while the Supernerd is moving around to take his own fossil. It looks like an alternate attempt.

Both of these attempts makes sense if the player is allowed to move around while the Supernerd is also moving and also if the Supernerd is a sight trainer that resets. I speculate that this is what was going at one point in development, and it was more or less causing problems.

The final solution that Gamefreak picked (and the right way to do it) was to treat the Supernerd as a fully-scripted trainer like the Rival and also where the player has no control during the Supernerd's movement.

These two old leftover attempts can probably be safely removed.

jojobear13 commented 1 year ago

Fixed in commit 37eb776d9146f1d38beb7b6b120afe1fb79bb01d