rh-hideout / pokeemerald-expansion

Feature branche for the pokeemerald decompilation. See the wiki for more info.
361 stars 1.09k forks source link

AI switching can cause a Player mon to turn into a bad egg #2672

Closed Land0fChocolate closed 10 months ago

Land0fChocolate commented 1 year ago

A Pokemon in the Player's party may turn into a bad egg and it probably has to do with the AI switching.

I've managed to reproduce the bug with these steps: 1.Fight Cooltrainer Wendy 2.Use Marshtomp to faint her first Pokemon 3.Switch out Marshtomp for Crobat right after she sends out her second Pokemon (turn 2). 4.Look at party menu again. Pokemon in slot 4 is now a bad egg. Pokemon in slot 3 also has bugged HP.

https://user-images.githubusercontent.com/52083703/217938497-e60f5d47-fc58-4ae1-808f-87e7a35fda8f.mp4

This are the details for Trainer Wendy in src/data/trainers.h:

[TRAINER_WENDY] =
    {
        .partyFlags = F_TRAINER_PARTY_CUSTOM_MOVESET,
        .trainerClass = TRAINER_CLASS_COOLTRAINER,
        .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_COOL,
        .trainerPic = TRAINER_PIC_COOLTRAINER_F,
        .trainerName = _("Wendy"),
        .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE},
        .doubleBattle = FALSE,
        .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN,
        .partySize = ARRAY_COUNT(sParty_Wendy),
        .party = {.NoItemCustomMoves = sParty_Wendy},
    },

-If Crobat is moved to other slots except 3, and you switch with Crobat then slot 4 Pokemon turns into a bad egg. If Crobat is moved to slot 3, no bad eggs are made. -If switch with Crobat on first turn, no issues. -If switch to any other Pokemon instead of Crobat, no issues. -Adding 3 more Pokemon to Wendy’s party changes nothing. -Changing up Wendy’s party (so that Roselia is in slot 5) changes nothing. -Changing the Pokemon in front from Marshtomp to something else doesn’t result in a bad egg. The HP bug still happens though.

Reverting this PR https://github.com/rh-hideout/pokeemerald-expansion/pull/2226 seemed to fix the bad egg bug.

DizzyEggg commented 1 year ago

@Land0fChocolate Couldn't reproduce on master. Could you try to reproduce the issue on a clean upcoming or master branch?

Land0fChocolate commented 1 year ago

I can't reproduce this on master either. I cannot be sure that there isn't something incompatible on my end that is causing the bug.

If nobody else is getting bad eggs or ? HP bars then may as well close this.

AaghatIsLive commented 1 year ago

got a similar bug from the battle tent,

Screenshot 2023-04-16 170318

AsparagusEduardo commented 1 year ago

got a similar bug from the battle tent,

What version are you using?

AaghatIsLive commented 1 year ago

What version are you using?

I am on upcoming, my last pull had #2898 as the latest commit.

Jaizu commented 1 year ago

MGBA has an option to rewind, I'm pretty sure some emulators might have this too. Having that enabled might help to record this issue if it happens again in the future. Also, afaik, this couldn't be reproduced on vanilla RHH, so taking this issue with a grant of salt.

AsparagusEduardo commented 1 year ago

Hmm, we need more info, like what Pokémon/Moves the opponent had. This is reminding me of the Beat Up issue we had a bit back.

AaghatIsLive commented 1 year ago

In the battle tent it happens even if you forfeit the match and it doesn't always happen. Now that you mention it could be a specific mon, I'll do some testing...

Bassoonian commented 10 months ago

Is this still reproduceable in 1.7?

AlexOn1ine commented 10 months ago

Is this still reproduceable in 1.7?

Nobody knows xD

It's a very hard issue to reproduce.

DizzyEggg commented 10 months ago

I would close this issue once #3277 is fixed. And then re-open or submit a new if it still happens.

Bassoonian commented 10 months ago

(Presumably) fixed by #3784