feat: add 2x Battle Speed option#142
Open
aloven wants to merge 1 commit into
Open
Conversation
Owner
|
That's actually incredibly awesome. I hate and despise playing with "Turbo" speed in emulators for many reasons, but having an x2 battle speed to mostly make what "Turbo" mode does without destroying the gaming experience is amazing. I won't be around for a couple days, so I'll leave it open so you can properly test this option. |
Adds an ANIM SPEED setting (1x / 2x) to the Battle Options menu. When set to 2x, battle animations, HP bars, EXP bars, faint sequences, switch-in/out, status effects, and battle transitions all play at double speed. Implementation: double-ticks AnimateSprites, RunTasks, and controller functions each frame in BattleMainCB2. Battle transition (CB2_OverworldBasic) also double-ticked. Guards: - Link battles excluded (desync risk) - Controller double-tick paused during player input (action/move/target selection) - Controller double-tick paused during ball release and cry pending - Capture success reverts to 1x (dedicated flag set at fanfare start) - Cry wait capped at 30 frames at 2x (long cries play in background) - Cry task uses 1-frame delay before clearing waitForCry (prevents cry skip) Does not affect: text print speed, palette fades, AI computation time, evolution scenes. SaveBlock2 field placed at end of struct for existing save compatibility.
0770b54 to
dad81fa
Compare
Contributor
Author
|
Testing good so far - much better than i expected, actually. Made some tuning: Changes since first PR:
Tested and working:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Would love more eyes on this and some testing. I modeled it after other hacks that do a smooth 2x/4x battle speed options.
You may wonder
Description:
Adds a BATTLE SPEED setting (1x / 2x) to the Battle Options menu. When set to 2x, battles play at double speed with the following affected:
Not affected: Text print speed, palette fades, AI thinking time, player input menus.
Implementation:
AnimateSprites(),RunTasks(), andgBattlerControllerFuncsper frame inBattleMainCB2CB2_OverworldBasic) also double-ticked via separate hookSafety guards:
waitForCryflag (prevents cry being skipped due to m4a mixer latency)optionsBattleSpeedplaced at end of SaveBlock2 struct for existing save compatibility (defaults to 0/1x)if battle animations are turned off, we still get acceleration: