Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Battle Console timings in 2k battles #1677

Closed
fmatthew5876 opened this issue Mar 9, 2019 · 14 comments

Comments

@fmatthew5876
Copy link
Contributor

commented Mar 9, 2019

Our timings for the rm2k battle console messages are not frame accurate.

Cherry was nice enough to outline a method for extracting these timings from RPG_RT in #1568

I've done this, and my findings are here:

Startup:
Slime appeared
Wait(4, 4) - Wait before text
Wait(30, 70) - Wait after first line

Slime appeared - first strike
Wait(4, 4) - Wait before text
Wait(30, 70) - Wait after first line
Wait(30, 70) - first strike msg

2 slimes appeared
Wait(4, 4) - Wait before text
Wait(8, 8) - Wait after first line
Wait(30, 70) - Wait after last line

Very long word wrapped lines
Wait(4, 4) - Wait before text
Wait(8, 8) - Wait after first line
Wait(8, 8) - 2nd line
Wait(8, 8) - 3rd line
Wait(30, 70) - Full page
Wait(4, 4) - Empty page
Wait(8, 8) - 1st line
Wait(30, 70) - 2nd line - done

Escape:
Multilines printed immediately
Wait(10,60)

Hero Attack - enemy none
Wait(4,4) - empty
Wait(20,40) - Attacks (text not on screen when wait called)
Wait(4,4) - next action?
Wait(4,4) - next action? (after critical maybe)
Wait(20,40) - Damage
Wait(0, 10) - post dmg
Wait(4, 4) - Enemy none action

Attack critical - enemy none
Wait(4,4) - empty
Wait(20,40) - Attacks (text not on screen when wait called)
Wait(4,4) - next action?
Wait(10,30) - critical
Wait(4,4) - next action?
Wait(20,40) - Damage
Wait(0, 10) - post dmg
Wait(4, 4) - enemy none

Enemy none - attack critical miss
Wait(4, 4) - Enemy nothing action
Wait(4, 4) - pre
Wait(20,40) - Attacks (text not on screen when wait called)
Wait(4,4) - delay
Wait(4,4) - 2nd delay likely intended for critical but still happens with no crit
Wait(20,60) - Dodge

Attack - Double crit
Wait(4, 4)
Wait(20, 40) Attakcs
Wait(4, 4)
Wait(10, 30) crtic
Wait(4, 4)
Wait(20, 40) damage
Wait(0, 10)
Wait(4, 4) Pre - attack msg shown
Wait(10, 30) crtic 2
Wait(4, 4)
Wait(20, 40) damage
Wait(0, 10)
Wait(4, 4) E1 none
Wait(4, 4) E2 none

Attack All
Wait(4, 4) - Pre
Wait(20, 40) - Attack
Wait(4, 4)
Wait(10, 30) - Crit
Wait(4, 4)
Wait(20, 40) - Dmg
Wait(0, 10) - Post dmg
Wait(4, 4)
Wait(10, 30) - Crit 2
Wait(4, 4)
Wait(20, 40) - Dmg
Wait(0, 10) - Post dmg

Enemy none - defend
Wait(4, 4) - Enemy flash
Wait(4, 4)
Wait(20,60) - Defend message
Wait(4,4) - next action?
Wait(4,4) - next action?
Wait(20,60) - Dodge

Defend - enemy none
Wait(4, 4) - Pre
Wait(20, 60) - Defend message
Wait(4, 4) - Enemy nothing action

Defend - enemy none, enemy none
Wait(4, 4) - Pre
Wait(20, 60) - Defend
Wait(4, 4) - e1 none
Wait(4, 4) - e2 none

Enemy attack
Wait(4, 4) - Enemy flash
Wait(20, 40) - Attack
Wait(4, 4)
Wait(10, 30) - criti
Wait(4, 4)
Wait(20, 40) - damage
Wait(0, 10) - post damage
Wait(4, 4)
Wait(20, 60) - Player defend

Enemy dbl attack - player defend
Wait(4, 4)
Wait(20, 40) - attack
Wait(4, 4)
Wait(10, 30) - crit
Wait(4, 4)
Wait(20, 40) - dmg
Wait(0, 10) - post dmg
Wait(4, 4)
Wait(10, 30) crit
Wait(4, 4)
Wait(20, 40) -dmg
Wait(0, 10) -post dmg
Wait(4, 4)
Wait(20, 60) - hero defend

Enemy defend - hero defend
Wait(4, 4)
Wait(20, 60)
Wait(4, 4)
Wait(20, 60)

Enemy watch - hero defend
Wait(4, 4)
Wait(20, 60)
Wait(4, 4)
Wait(20, 60)

Enemy charge - hero defend
Wait(4, 4)
Wait(20, 60)
Wait(4, 4)
Wait(20, 60)

Enemy explode -
Wait(4, 4)
Wait(20, 60) - Self destruct msg
Wait(4, 4)
Wait(4, 4)
Wait(20, 40) - dmg
Wait(0, 10) - post dmg

Enemy escape
Wait(4, 4) - flash
Wait(36, 60) - escape msg

Hero attack causes 2 states
Wait(4, 4)
Wait(20, 40)
Wait(4, 4)
Wait(10, 30)
Wait(4, 4)
Wait(20, 40)
Wait(0, 10)
Wait(4, 4)
Wait(20, 60) - state 1 - Multiple states same line
Wait(4, 4)
Wait(20, 60) - state 2

Has state message - enemy
Wait(4, 4) - Flash occurs - is skipped if enemy has no algo
Wait(20, 60)

State healed - enemy
Wait(4, 4)
Wait(20, 60)

Hero attack and kill enemy
Wait(4, 4)
Wait(20, 40) - attack
Wait(4, 4)
Wait(10, 30) - crit
Wait(4, 4)
Wait(20, 40) - dmg
Wait(36, 60) - death
Wait(0, 10) - post dmg

Hero uses healing item
Wait(4, 4)
Wait(20, 60) - use item
Wait(4, 4)
Wait(20, 60) - heal msg

Hero uses healing item
Wait(4, 4)
Wait(20, 60) - use item
Wait(4, 4)
Wait(20, 60) - heal hp
Wait(4, 4)
Wait(20, 60) - heal mp

Hero uses healing item
Wait(4, 4)
Wait(20, 60) - use item
Wait(4, 4)
Wait(20, 60) - ally revived

Hero cures poison
Wait(4, 4)
Wait(20, 60) - hero is poisoned msg
Wait(4, 4)
Wait(20, 60) - use item
Wait(4, 4)
Wait(20, 60) - heal poison

Hero uses revive skill
Wait(4, 4)
Wait(20, 60) - skill msg
Wait(4, 4)
Wait(20, 60) - ally revived

Hero uses revive skill w double msg
Wait(4, 4)
Wait(20, 60) skill msg 1
Wait(20, 60) skill msg 2
Wait(4, 4)
Wait(20, 60) ally revived

Hero uses attack skill
Wait(4, 4)
Wait(20, 60) - skill msg
Wait(4, 4)
Wait(20, 40) - dmg
Wait(0, 10) - post effects

Hero uses skill to raise stat
Wait(4, 4)
Wait(20, 60) - skill msg
Wait(4, 4)
Wait(20, 60) - INT Up

Hero uses attack skill
Wait(4, 4)
Wait(20, 60) - skill msg
Wait(4, 4)
Wait(20, 40) - dmg
Wait(0, 10) - post dmg
Wait(4, 4)
Wait(20, 60) - mp
Wait(4, 4)
Wait(20, 60) - atk
Wait(4, 4)
Wait(20, 60) - def
Wait(4, 4)
Wait(20, 60) - agi
Wait(4, 4)
Wait(20, 60) - int
Wait(4, 4)
Wait(20, 60) - holy down
Wait(4, 4)
Wait(20, 60) - blind

Hero uses attack skill
Wait(4, 4)
Wait(20, 60) - skill msg
Wait(4, 4)
Wait(20, 60) - absorb hp
Wait(0, 10) - post dmg
Wait(4, 4)
Wait(20, 60) - absorb mp

Hero uses attack skill
Wait(4, 4)
Wait(20, 60) - skill msg
Wait(4, 4)
Wait(20, 60) - absorb hp
Wait(36, 60) - kill enemy
Wait(0, 10) - post dmg

Hero uses attack skill with no msg
Wait(4, 4)
Wait(20, 60) - waits for empty msg
Wait(4, 4)
Wait(20, 40) - dmg
Wait(36, 60) - kill
Wait(0, 10) -post

Hero uses kill skill
Wait(4, 4)
Wait(20, 60) - skill msg
Wait(36, 60) - death msg
Wait(4, 4)
Wait(20, 60) - Nothing??

Hero uses kill + dmg skill - damage was not lethal
Wait(4, 4)
Wait(20, 60) - skill msg
Wait(4, 4)
Wait(20, 40) - dmg
Wait(0, 10) - post dmg
Wait(36, 60) - kill state
Wait(4, 4)
Wait(20, 60) - ???

Hero uses kill + dmg skill - damage was lethal
Wait(4, 4)
Wait(20, 60) skill msg
Wait(4, 4)
Wait(20, 40) dmg
Wait(36, 60) death
Wait(0, 10) post dmg

Hero defends - enemy has no actions and state recovers with no message
Wait(4, 4)
Wait(20, 60) - hero defend
Wait(4, 4) - enemy flashes
Wait(20, 60) - enemy state recovered - no message

Hero defends - enemy has no actions but state with no "is active" message
Wait(4, 4)
Wait(20, 60) - hero defend
NOTE: Enemy never gets a turn and no delays!

Hero defends - enemy has no actions but state with "is active" message
Wait(4, 4)
Wait(20, 60) - hero defend
Wait(4, 4) - enemy flashes
Wait(20, 60) state is active message

Enemy attacks hero - no damage because of high defense
Wait(4, 4)
Wait(20, 40) - attack msg
Wait(4, 4)
Wait(10, 30) - crit
Wait(4, 4)
Wait(20, 40) - no damage message
Wait(0, 10) - post dmg wait

@CherryDT

This comment has been minimized.

Copy link

commented Mar 9, 2019

Just a guess - the "???" may be this: EDIT: It's not.

image

@CherryDT

This comment has been minimized.

Copy link

commented Mar 9, 2019

I wonder what happens if you set these greyed-out values in the LDB file manually.

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

commented Mar 9, 2019

The already inflicted message doesn't wait if it's empty I believe?

I think it's actually "state inflicted". But death has a special case wait(36, 60).

I think it's a bug where all states inflicted have a Wait(20, 60). Death should be excluded since it was already printed.

You'll notice there is no phantom Wait(20, 60) when death is caused by damage.

@CherryDT

This comment has been minimized.

Copy link

commented Mar 9, 2019

Yes you are right. I verified it now and it looks like it's like this:

  • State is actually inflicted (infliction of state 1 always causes HP to drop to 0)
  • If HP are zero (which is true now), the death display is done (which includes its own Wait(36, 60))
  • Wait(4, 4) (unconditionally)
  • If HP are nonzero (which is false now), the state infliction display is done
  • Wait(20, 60) (unconditionally) This should probably be inside the previous if
@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

commented Mar 9, 2019

Cherry, do you know why there is an extra Wait(0,10) after damage message is printed?

It seems to also happen after death if the damage is lethal

If damage not lethal
Wait(20,40) - dmg
Wait(0,10) - post dmg

If damage was lethal
Wait(20,40) - dmg
Wait(36,60 - death
Wait(0, 10) - post dmg

Is there something special that happens before that last Wait(0, 10) that they had to split it out this way?

@CherryDT

This comment has been minimized.

Copy link

commented Mar 9, 2019

Death (as you already discovered) and hit-induced state recovery are indicated in between.

Both of them have their own wait as well though. I guess it's just to tweak the timings for the cases where the player does or doesn't hold Enter.

@fdelapena fdelapena added the Battle label Mar 10, 2019

@fdelapena fdelapena added this to the 0.6.1 milestone Mar 17, 2019

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

commented Mar 25, 2019

Test Cases 1 - Physical attacks and states

  1. Setup Confuse and Provoke with 100% infliction, 100% healed by damage. Make a weapon that inflicts Poison, Confuse, and Provoke. Make Alex 1 in 1 Critical hit.

Setup a battle event on Turn 0, which inflicts Poison, Confuse, and Provoke on the enemy.

Finally, attack the enemy with Alex

Wait(4,4)
Wait(20,40)

Alex Attacks

Wait(4,4)
Wait(10,30)

Alex Attacks
Alex Inflicted a Critical Hit!

Wait(4,4)
Wait(20,40)

Alex Attacks
Alex Inflicted a Critical Hit!
Slime took 50 damage!

Wait(4,4)
Wait(20,40)

Alex Attacks
Alex Inflicted a Critical Hit!
Slime took 50 damage!
Slime calmed down!

Wait(4,4)

Alex Attacks
Alex Inflicted a Critical Hit!
Slime took 50 damage!

Wait(20,40)

Alex Attacks
Alex Inflicted a Critical Hit!
Slime took 50 damage!
Slime came to their senses!

Wait(0,10)
Wait(4,4)

Alex Attacks
Alex Inflicted a Critical Hit!

Wait(20,60)

Alex Attacks
Alex Inflicted a Critical Hit!
Slime was Provoked!

Wait(4,4)

Alex Attacks
Alex Inflicted a Critical Hit!

Wait(20,60)

Alex Attacks
Alex Inflicted a Critical Hit!
Slime was confused!

Result: Confuse and Provoke are removed and then re-inflicted. Target already has poison, so nothing happens and no "already has state" message is printed.

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

commented Mar 25, 2019

Test Cases 2 - 2 weapons and state infliction rules

Create State X with rating 40, 100% infliction rate
Create State Y with rating 50, 100% infliction rate, with higher id than X
Create State Z with rating 40, 100% infliction rate, with higher id than Y
WeaponX with 100% inflict state X
WeaponY with 100% inflict state Y
WeaponZ with 100% inflict state Z

  1. What happens when we attack slime with these weapons?
Weapon1 Weapon 2 State inflicted message printed?
X Y X, Y
X Z X, Z
Y X Y, X
Y Z Y
Z X X, Z
Z Y Y

Conclusions:

  • For multiple weapons, states are always applied in order of their id.
  • If S1.priority < S2.priority - 10, S1 is still applied and then immediately removed by S2
  • If S1.priority > S2.priority - 10, S1 is applied, and then S2 is ignored since S1 super cedes it.
@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

commented Mar 26, 2019

Test Cases 3 - (2k3) 2 weapons and reverse_state_effect behavior

Create state X, rating 50, 100% infliction rate
Create state Y, rating 40, 100% infliction rate
Set death to 100% infliction rate

WeaponXI with 100% inflict state X
WeaponXH with 100% heal state X
WeaponYI with 100% inflict state Y
WeaponYH with 100% heal state Y
WeaponDI with 100% inflict death
WeaponDH with 100% heal death

  1. What happens when we attack slime with these weapons?
Weapon1 Weapon2 Slime has state?
XI XH
XH XI X
  1. Now add a battle event on turn 0 which inflicts state X on slime
Weapon1 Weapon2 Slime has state?
XI XH
XH XI X
XH YI Y
YI XH
  1. Now change Weapons X and Y to inflict and heal death. Make sure death has 100% infliction rate.
Weapon1 Weapon2 Result?
DI DH Damage, Death, Attacks other enemy Damage
DH DI Damage, Damage, Death

Conclusion:

  • States are applied first by state id and then by weapon slot.
@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

commented Mar 26, 2019

Test Cases 4 - Skills state infliction

Create State X with rating 40, 100% infliction rate
Create State Y with rating 50, 100% infliction rate, with higher id than X
Create State Z with rating 40, 100% infliction rate, with higher id than Y

Create skill XY inflicts X and Y
Create skill XZ inflicts X and Z
Create skill YZ inflicts Y and Z
Create skill XYZ inflicts X, Y, and Z

  1. Use the skill on slime
Skill Printed to console
XY Inflict X, Inflict Y
XZ Inflict X, Inflict Z
YZ Inflict Y
XYZ Inflict X, Inflict Y
  1. Create a turn 0 battle event which inflicts a state on slime. Use the skill on slime.
Turn0 inflicts Skill Printed to console
X XY Already X, Inflict Y
X XZ Already X, Inflict Z
X YZ Inflict Y
X XYZ Already X, Inflict Y
Y XY Already Y
Y XZ
Y YZ Already Y
Y XYZ Already Y
Z XY Inflict X, Inflict Y
Z XZ Inflict X, Already Z
Z YZ Inflict Y
Z XYZ Inflict X, Inflict Y
@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

commented Mar 26, 2019

Test Cases 5 - Physical skills

Create a skill with 10 physical, affect hp, and 100% inflict poison, confuse, and provoke
Create 2 usage messages for the skill

Create a turn 0 event which inflicts poison, confuse, and provoke on slime

  1. Use the skill on slime

Wait(4,4)
Wait(20,60)

Usage1

Wait(20,60)

Usage1
Usage2

Wait(4,4)
Wait(20,40)

Usage1
Usage2
Slime took 100 damage

Wait(4,4)
Wait(20,40)

Usage1
Usage2
Slime took 100 damage
Slime calmed down

Wait(4,4)

Usage1
Usage2
Slime took 100 damage

Wait(20,40)

Usage1
Usage2
Slime took 100 damage
Slime came to their senses

Wait(0,10)
Wait(4,4)

Usage1
Usage2

Wait(20,60)

Usage1
Usage2
Slime is already poisoned

Wait(4,4)

Usage1
Usage2

Wait(20,60)

Usage1
Usage2
Slime was provoked!

Wait(4,4)

Usage1
Usage2

Wait(20,60)

Usage1
Usage2
Slime was confused!
  1. Change the skill to have no usage messages

Wait(4,4)
Wait(20,60)
Wait(4,4)
Wait(20,40)

Slime took 100 damage

Wait(4,4)
Wait(20,40)

Slime took 100 damage
Slime calmed down

Wait(4,4)

Slime took 100 damage

Wait(20,40)

Slime took 100 damage
Slime came to their senses

Wait(0,10)
Wait(4,4)

Wait(20,60)

Slime is already poisoned

Wait(4,4)

Wait(20,60)

Slime was provoked!

Wait(4,4)

Wait(20,60)

Slime was confused!
@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

commented Mar 26, 2019

Test Cases 6 - Enemy state messages + actions

  1. Turn 0 event adds poison, set only action to wait

Wait(4,4)
Wait(20,60)

Slime has Poison!

Wait(4,4)

Wait(20,60)

Slime is watching!
  1. Turn 0 event adds poison, set only action to do nothing

Wait(4,4)
Wait(20,60)

Slime has Poison!

Wait(4,4)

  1. Turn 0 event adds poison, no actions

Wait(4,4)
Wait(20,60)

Slime has Poison!
@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

commented Mar 26, 2019

Test Cases 7 - enemies with no actions

  1. Enemy with no actions

Result: Nothing happens, enemy does not flash and no wait

  1. Enemy with no actions and a state with no message

Result: Nothing happens, enemy does not flash and no wait

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

commented Mar 26, 2019

Test Cases 8 - Self destruct and states

  1. Setup enemy with self destruct
    Add turn 0 event to set confuse and provoke on the party

Wait(4,4)
Wait(20,60)

Monster Fish Exploded!

Wait(4,4)
Wait(4,4)
Wait(20,40)

Monster Fish Exploded!
Alex took 37 damage!

Wait(4,4)
Wait(20,40)

Monster Fish Exploded!
Alex took 37 damage!
Alex calmed down!

Wait(4,4)

Monster Fish Exploded!
Alex took 37 damage!

Wait(20,40)

Monster Fish Exploded!
Alex took 37 damage!
Alex came to their senses!

Wait(0,10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.