Skip to content

Fixes for low FPS on slower systems during battles#3580

Open
VannevarXbox wants to merge 3 commits into
EasyRPG:masterfrom
VannevarXbox:battle-fps-fixes
Open

Fixes for low FPS on slower systems during battles#3580
VannevarXbox wants to merge 3 commits into
EasyRPG:masterfrom
VannevarXbox:battle-fps-fixes

Conversation

@VannevarXbox

@VannevarXbox VannevarXbox commented Jun 20, 2026

Copy link
Copy Markdown

Window_BattleStatus::Refresh was being called for every frame during a battle, triggering a full re-draw of the battle status window. This was causing very low framerate at some points on slower systems:

#3494
#3497

These changes improve battle framerate to a playable level on original Xbox. I've tested them with RM2k, custom test games for battle types A, B, and C (both large and small windows), the Maniac test game, and the game Ara Fell which was mentioned in the source.

It's my first pull request, so hopefully I didn't do anything too dumb! I'd be happy to answer any questions or make any needed changes.

  • Refactored Window_BattleStatus::Refresh and Window::BattleStatus.RefreshGauge to update incrementally, or at least to skip redrawing content when not needed.
  • The battle status window is no longer always cleared by a call to Refresh(), it only clears and redraws completely if the party actors change.
  • In order to accomplish the incremental updates, Window_BattleStatus keeps a cache of the displayed values for each item, updating the graphics if those values change.
  • The UIs for RM2k3 battle type B (alternative) and C (gauge) both have overlapping content, meaning multiple items need to be redrawn if one of the overlapping items is redrawn in the UI, so further optimization would be possible there.
  • The function DrawGauge, which draws the gauges for battle types A (traditional) and B (alternative), has been moved from Window_Base into Window_BattleStatus, as that seems to be the only code that uses it.

…eshGauge to update incrementally, or at least to skip redrawing content when not needed. The battle status window is no longer cleared by a call to Refresh(), but full-clear-and-redraw functionality would be very easy to add if needed. In order to accomplish the incremental updates, Window_BattleStatus keeps a cache of the displayed values for each item, updating the graphics if those values change. The UIs for RM2k3 battle type B (alternative) and C (gauge) both have overlapping content, meaning multiple items need to be redrawn if one of the overlapping items is redrawn in the UI, so further optimization would be possible there. The function DrawGauge, which draws the gauges for battle types A (traditional) and B (alternative), has been moved from Window_Base into Window_BattleStatus, as that seems to be the only code that uses it.
@VannevarXbox VannevarXbox changed the title Fixes for low FPS on Fixes for low FPS on slower systems during battle Jun 20, 2026
@VannevarXbox VannevarXbox changed the title Fixes for low FPS on slower systems during battle Fixes for low FPS on slower systems during battles Jun 20, 2026
…ged, since it appears that at least in BattleType_alternative/B with a small window, the gauges can overlap into the row below. This makes sure the window gets redrawn properly, and this situation should be rare enough that this doesn't impact performance too much. Also, when re-drawing content in BattleType_gauge/C, clear the whole item/actor area in case of any face changes.
…ctor face if face redraw is needed, fixed a couple frames for clearing content, removed function ClearItemGraphics which is now unused
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant