Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move animation tests/cleanup + Revival Blessing support #5253

Conversation

AsparagusEduardo
Copy link
Collaborator

@AsparagusEduardo AsparagusEduardo commented Aug 24, 2024

Description

Edit 2024/10/19: PR has been closed in order to split into multiple proper PRs

  • Cleaned up usage of some createsprite commands in move animation scripts.
    • Using constants such as ANIM_TARGET
    • Converted multiple hex values to decimals (including negatives)
    • Added missing commas
  • Converted all hex in delay commands to decimals
  • Fixed Follow Me failing in single battles in Gens 6/7 when they shouldn't Split into Fix Follow Me failing in Single Battles for Gen 6/7 config #5542.
  • Added test support for moves to choose a party member in non-switch contexts Incorporated into Revival Blessing fixes + Using Lunar Blessing's animation #5490 instead.
    • Uncommented and fixed Revival Blessing tests
  • Added move animation tests that execute every move in the following contexts:
    • Single Battles
    • Double Battles
      • Left Player hits Left Opponent
      • Left Player hits Right Opponent
      • Right Player hits Left Opponent
      • Right Player hits Right Opponent

People who collaborated with me in this PR

@hedara90, @AlexOn1ine, @mrgriffin for their help and feedback.

Feature(s) this PR does NOT handle:

The tests are very computationally expensive, so they're commented for now. For reference at 22 threads:
Without the animation tests:

real    3m24.250s
user    55m29.919s
sys     0m34.952s

With animation tests:

real    9m56.651s
user    100m8.142s
sys     0m49.591s

Discord contact info

@AsparagusEduardo
Copy link
Collaborator Author

For some reason, it looks as if party data is not reset from the previous test. Confirmed by changing the species on the first test.

SINGLE_BATTLE_TEST("1Revival Blessing revives a chosen fainted party member for the player")
{
    GIVEN {
        PLAYER(SPECIES_WOBBUFFET);
        PLAYER(SPECIES_WOBBUFFET) { HP(0); }
        PLAYER(SPECIES_WYNAUT) { HP(0); }
        OPPONENT(SPECIES_WOBBUFFET);
    } WHEN {
        TURN { MOVE(player, MOVE_REVIVAL_BLESSING, partyIndex:2); }
    } SCENE {
        MESSAGE("Wobbuffet used Revival Blessing!");
        MESSAGE("Wynaut was revived and is ready to fight again!");
    }
}

SINGLE_BATTLE_TEST("1Revival Blessing fails if no party members are fainted")
{
    GIVEN {
        PLAYER(SPECIES_WOBBUFFET);
        OPPONENT(SPECIES_WOBBUFFET);
    } WHEN {
        TURN { MOVE(player, MOVE_REVIVAL_BLESSING); }
    } SCENE {
        MESSAGE("Wobbuffet used Revival Blessing!");
        MESSAGE("But it failed!");
    }
}

image

@AsparagusEduardo
Copy link
Collaborator Author

Finally figured out how to solve the issue. Ready for review.

@hedara90 hedara90 added type: cleanup category: battle-tests Related to the automated test environment labels Aug 26, 2024
@hedara90
Copy link
Collaborator

It seems that the diff for data/battle_anim_scripts.s is to big for github to open.
How would you like me to give comments on that file?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff.txt

The gDirtPlumeSpriteTemplate hex to dec changes have some incorrect translations, the comments next to it was wrong about the values.
Some other comments, I don't know enough about the intricacies of the graphics to know why they are like they are. I would guess that delay 0 does something considering how often it's used, but shouldn't delay 10 delay 25 be equal to delay 35?

@pkmnsnfrn pkmnsnfrn marked this pull request as draft August 28, 2024 03:01
@hedara90
Copy link
Collaborator

Did you want to split this PR so that the hex to dec conversions in data/battle_anim_scripts.s is it's own PR?
It would probably make it easier for downstream users when merging.

@AsparagusEduardo
Copy link
Collaborator Author

Did you want to split this PR so that the hex to dec conversions in data/battle_anim_scripts.s is it's own PR? It would probably make it easier for downstream users when merging.

Yeah, that makes more sense.

@AsparagusEduardo
Copy link
Collaborator Author

Closing this for now as it's being split into multiple proper PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: battle-tests Related to the automated test environment type: cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants