-
Notifications
You must be signed in to change notification settings - Fork 218
Description
The battle scene code is very difficult to follow, by extension difficult to extend, and nearly impossible to reason about it's correctness. It's also very easy to fix a bug in one battle system and break the other.
A good example is this PR, which is a simple feature addition but exceedingly complex in it's implementation:
#2151
The cause of all this is the shared logic in Scene_Battle and how it interacts with the 2k and 2k3 battle systems. The code is constantly calling back and forth between the child and parent classes, and carefully trying to juggle the needs of both battle systems.
This needs a refactor, Scene_Battle should only be for the very few required shared facilities for setting up the battle stack. I would rather have code duplication in 2k and 2k3 if it means I can reason about and understand the code.
Likely development sequence:
- Separate true battle stack fundamentals into
Scene_Battle, and make aScene_BattleBasewith the rest of the current shared logic. - Copy
Scene_BattleBasestuff into 2k battle system and refactor the 2k battle system state machine. - Rename to
Scene_BattleBase2k3and leave the rest for 2k3 battle system refactor...
Once this is done, it will also make it possible to reconcile the 2k battle system against RPG_RT using RE tools and fix for good wierd interactions like #2153 and #2154