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

Add B_LEVEL_UP_NOTIFICATION to improve player QoL when performing multiple level ups #4901

Open
wants to merge 19 commits into
base: upcoming
Choose a base branch
from

Conversation

pkmnsnfrn
Copy link
Collaborator

@pkmnsnfrn pkmnsnfrn commented Jul 2, 2024

Description

Gif of Pikipek getting enough experience to jump from level 1 to 20

This PR adds B_LEVEL_UP_NOTIFICATION to include/config/battle.h. When set to GEN_9 or later, when Pokemon receive enough EXP in battle to progress through multiple levels, the level up message is only shown once.

Details

Usage

In include/config/battle.h, developers must define which generation B_LEVEL_UP_NOTIFICATION should use.

=> GEN_9

When a Pokemon receives enough experience to grow multiple levels, the following changes occur:

  • The message "MON grew to LEVEL X" only shows once.
  • All moves to be learn are attempted to be taught after the level up Notification.
  • If the mon is currently participating in battle, the EXP bar only animates once.
  • After battle, if the Pokemon is eligible, it will try to evolve.

< GEN_9

Any value lower than GEN_9 will handle leveling up the same as vanilla.

Testing

Clean Branch

You can recreate this branch by applying a patch or pulling the repo. From a clean version of expansion's upcoming, you can either:

Patch

wget https://files.catbox.moe/1uugqs.patch ; git apply 1uugqs.patch ; rm 1uugqs.patch

Repo

git remote add psf-expansion https://github.com/PokemonSanFran/pokeemerald-expansion/ ; git pull psf-expansion levelUpNotification

Manual Tests

After replicating the branch, to recreate my testing environment, you can either directly download the debug script, or manually create the changes.

Download

Manual Testing

  • Compile the game
  • Start a new save
  • Run Script 1
  • Run Script 2
  • Switch to Tyranitar
  • Observe functionality

Verified Scenarios

Both videos show:

  • Player starts a battle with a wild Level 100 Shedinja versus their Level 1 Pikipek
  • Player switches to a Tyranitar
  • Shedinja faints from sandstorm damage and Pikipek grows to level 20
  • Pikipek learns Growl, Echoed Voice, Rock Smash.
  • Pikipek is prompted to, but does not learn Supersonic, Pluck, and Roost.
  • Pikipek evolves into Trumbeak.
  • Player starts a battle with a wild Level 100 Shedinja versus their Level 20 Trumbeak
  • Player uses debug menu to give Trumbreak 9044 ATK and 9038 SPEED
  • Shedinja faints from Trumbeak's Peck and Trumbeak grows to Level 23
  • Trumbeak is prompted to, but does not learn Roost.

B_LEVEL_UP_NOTIFICATION == GEN_LATEST

on.mp4

B_LEVEL_UP_NOTIFICATION == GEN_8

off.mp4

People who collaborated with me in this PR

@DizzyEggg wrote all of this.

Features this PR does NOT handle:

  • This PR DOES NOT handle EXP gained outside of battle.

Discord Contact Info

I am pkmnsnfrn on Discord.

@AlexOn1ine
Copy link
Collaborator

what's the bug here?

@pkmnsnfrn
Copy link
Collaborator Author

pkmnsnfrn commented Aug 15, 2024

on.mp4
off.mp4

In the video where the skip messages feature is turned on (first vid), Trumbeak doesn't attempt to learn Roost when it is the active participant and reaches Level 21. In the video where it is turned off, Trumbeak tries to learn roost in the same scenario.

@AlexOn1ine
Copy link
Collaborator

on.mp4
off.mp4

In the video where the skip messages feature is turned on (first vid), Trumbeak doesn't attempt to learn Roost when it is the active participant and reaches Level 21. In the video where it is turned off, Trumbeak tries to learn roost in the same scenario.

so if I understand it correctly. When it levels up in party it learns all moves but if it is in battle it does not?

@pkmnsnfrn
Copy link
Collaborator Author

Correct!

@AlexOn1ine
Copy link
Collaborator

Correct!

I'll see if I can fix it

@AsparagusEduardo AsparagusEduardo added category: battle-mechanic Pertains to battle mechanics new-feature Adds a feature labels Sep 10, 2024
@pkmnsnfrn pkmnsnfrn marked this pull request as ready for review December 2, 2024 14:59
@pkmnsnfrn
Copy link
Collaborator Author

@AlexOn1ine
Copy link
Collaborator

Blocked by CI for unknown reasons: https://discord.com/channels/419213663107416084/1077009799293710357/1313324036394061924

Did you run the test in isolation or all together? Also can you try running all tests with 4 cores?

@pkmnsnfrn
Copy link
Collaborator Author

Blocked by CI for unknown reasons: discord.com/channels/419213663107416084/1077009799293710357/1313324036394061924

Did you run the test in isolation or all together? Also can you try running all tests with 4 cores?

On my machine, it passes in isolation and all together. I haven't had a chance to run with 4 cores.

@AlexOn1ine
Copy link
Collaborator

Could you merge in upcoming to see if CI would pass this time? I've ran it with 4 threads and had no failing tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: battle-mechanic Pertains to battle mechanics new-feature Adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants