Emulate insane event execution order of RPG2k3 Battle Interpreter #488

Closed
Ghabry opened this Issue May 18, 2015 · 1 comment

Projects

None yet

3 participants

@Ghabry
Member
Ghabry commented May 18, 2015

At Turn 0 (when battle begins) the order is like RPG2k battle interpreter, that's fine.

More funny is when anybody does a turn.
Then the order seems to be:

  1. The Turn counter is increased (global battle and actor counter)
  2. Pages with turn-based (doesn't matter if battle or actor-based) event triggers run
  3. The BattleAction is executed
  4. Pages with other event triggers run

This needs more extensive testing to figure out if 4. has more special cases

@Ghabry Ghabry added this to the 0.3.1 milestone May 18, 2015
@fdelapena fdelapena added Interpreter and removed Emulation labels May 19, 2015
@Ghabry Ghabry modified the milestone: 0.3.1, 0.4 Sep 6, 2015
@Ghabry Ghabry modified the milestone: 0.4.1, 0.4 Dec 14, 2015
@Ghabry Ghabry modified the milestone: 0.4.1, 0.5.0 Feb 19, 2016
@carstene1ns carstene1ns added Events and removed Events Interpreter labels Jul 18, 2016
@Ghabry
Member
Ghabry commented Aug 11, 2016 edited

Just to update what we know already: The normal interpreter update rule applies (When a page finishes and an earlier page can run it gets priority over later pages). When a page ran a turn it will not run again that turn.
Following pages are reset, when actor/enemy X does his turn: "X uses command", "X turn". All other pages are always reset, independ of who does the turn.

By doing some investigation the following pages run depending on there start condition. It's enough when one of the start conditions fulfills the criteria, when there is a 2nd one which would normally run later it runs early anyway.

Battle start:

  • Turn elapsed (global & per actor)
  • Switch
  • Variable
  • Party exhaust

After selecting a target but before the action is executed:
Turn counter is incremented, page reset as described above

  • Turn elapsed (global & actor)
  • X uses the fight command

After executing the action:
All remaining

  • Switch
  • Variable
  • Party exhaustions
  • Monster HP is
  • Hero HP is

So there are basicly three different blocks of events that can run depending on where in the battle we are... I made some changes to the battle interpreter logic, so fulfilling this should be easy now :)

Guess this also fixes Pom gets Wifi

@fdelapena fdelapena modified the milestone: 0.5.0, 0.6.0 Aug 11, 2016
@fdelapena fdelapena pushed a commit that closed this issue Aug 13, 2016
@Ghabry Ghabry Battle interpreter changes: Only search for runnable pages when the s…
…cene says that it is a good time to run the interpreter at certain points.

Only reset "X used command" pages when that actor had another turn.

In the old behaviour the interpreter always looked in each update-loop if a page can run. This makes sense for the map but not at all for the battle because the only time when pages run is when the turn starts.
The interpreter behaves now correctly in OFF (uses conditional branch) and in Ara Fell (uses event page condition) for "X used command".
The timing when the page runs is now also correct. RPG2k3 behaviour should be perfectly replecated now.

Fix #488
Fix #983
dc3dfb7
@fdelapena fdelapena closed this in dc3dfb7 Aug 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment