Skip to content

feat: add 2x Battle Speed option#142

Open
aloven wants to merge 1 commit into
resetes12:masterfrom
aloven:feature/double-battle-speed
Open

feat: add 2x Battle Speed option#142
aloven wants to merge 1 commit into
resetes12:masterfrom
aloven:feature/double-battle-speed

Conversation

@aloven

@aloven aloven commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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

  • why do this when emulators can do this?" besides respecting OG hardware, those emulators also speed up the audio, which usually sounds awful. Also, lower power emulator handhelds can't speedup the game much more than 1.3-1.4x, but the game can easily speed this up.
  • we can turn off battle animations? yes - another great grinding option to combine, even. this allows you to enjoy the full animation sequence with increased speed and normal audio.

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:

  • HP bar drain/fill
  • EXP bar gain
  • Battle move animations
  • Faint/KO animations
  • Switch-in / switch-out animations
  • Status effect animations (poison, sleep, etc.)
  • Weather/buff animations
  • Stat change animations
  • Battle transition (overworld → battle screen wipe)
  • Script pauses and delays

Not affected: Text print speed, palette fades, AI thinking time, player input menus.

Implementation:

  • Double-ticks AnimateSprites(), RunTasks(), and gBattlerControllerFuncs per frame in BattleMainCB2
  • Battle transition (CB2_OverworldBasic) also double-ticked via separate hook

Safety guards:

  • Link battles excluded entirely (desync risk)
  • Controller double-tick paused during player action/move/target selection (prevents input doubling)
  • Controller double-tick paused while ball animations are active or cry is pending
  • Cry task uses 1-frame delay before clearing waitForCry flag (prevents cry being skipped due to m4a mixer latency)
  • optionsBattleSpeed placed at end of SaveBlock2 struct for existing save compatibility (defaults to 0/1x)

if battle animations are turned off, we still get acceleration:

  • HP bars drain at 2x
  • EXP bars fill at 2x
  • Faint slide animations at 2x
  • Switch-in/out (pokeball throw, mon appearing) at 2x
  • Stat change animations at 2x (these still play with anims off)
  • Weather continuing animations at 2x (these also still play)
  • Script pauses/delays at 2x
  • Battle transition at 2x

@resetes12

Copy link
Copy Markdown
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.
@aloven aloven force-pushed the feature/double-battle-speed branch from 0770b54 to dad81fa Compare July 9, 2026 16:05
@aloven

aloven commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Testing good so far - much better than i expected, actually. Made some tuning:

Changes since first PR:

  • Renamed option from "BATTLE SPEED" → "ANIM SPEED" (more accurate label)
  • Cry handling: Added 30-frame max wait at 2x. Short cries finish naturally; long cries (Metagross, etc.) are capped and play in background. Consistent pacing regardless of cry length.
  • Capture success: Ball shakes run at 2x, but once capture succeeds (click + fanfare), reverts to 1x so audio and visuals stay synced. Uses dedicated gBattleCaptureSuccessActive flag.
  • Partner controller: Applied cry skip at 2x to battle_controller_player_partner.c for Steven/partner battles.

Tested and working:

  • Singles/doubles (wild + trainer)
  • Battle Frontier (Tower, Arena)
  • Evolution after battle
  • Capture sequence (shakes fast, fanfare synced)
  • Recorded battles
  • Surf encounters (cries play correctly)
  • Both 1x and 2x toggle without regression
  • Combined with Normal/Fast battles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants