Site Tools


battle_timers

Battle Timers

All battle participants (characters and monsters) have a variety of timers that determine when events occur in a battle. In order of priority, they are:

Stop, Action, Sap, Poison, Stone, Wall, Count

On each tick, every active timer counts down by one1), and any timers that reach zero are flagged as expired. Only one expired timer for one participant can be handled in a given ATB tick, and they are checked in order. If none of that participant's timers are expired, the next participant is checked. If no participants have any expired timers, no events occur during that tick.

For more details on how ATB ticks work, see: ATB System.

Timer Details

Stop: If this is active, all other timers for that participant are frozen until after it expires.
Action: This is the primary timer, used to determine when participants are ready to queue and execute actions. See the section below.
Sap: Determines when the HP leak effect expires.
Poison: Determines when Poison status will deal damage.
Stone: Determines when Gradual Petrification will advance.
Wall: Determines when Wall will expire.
Count: The visible time for Count. Only counts down every second tick.

Reference Chart

Timer Effect while active Effect on expiration Used by Duration
Stop Stop status; other timers are frozen Stop status is removed Stop, HrGlass1/2/3 Spell's power * 3 2)
Sap HP leak (2 HP per tick) HP leak effect is removed Virus, Big Bang, etc. Either 30 ticks or a random number of ticks
Poison Poison status Damage (1/8 max HP) Venom, Poison Gas, etc. Vitality + 203)
Stone Gradual Petrification status Petrification advances Ray, Petrify Vitality + 204)
Wall Wall (Reflect) status Wall status is removed Wall, StarVeil, MoonVeil Spell's power + 30 5)
Count Count status Death Count (Plague, FatalEye) Spell's power (10 Count ticks, which is 20 ATB ticks)

The Speed Modifier affects the initial value set for all timers except for Count.6). Changing the Speed Modifier does not affect existing timer values.

Each time the Poison and Stone timers take effect, they are reset to their initial value. Changes to the Speed Modifier do not affect this.

The Action Timer

All actions must be queued before they can be executed. The Action Timer is used to determine when both of these steps can happen.

At the start of battle7), and after executing an action, a participant's Action Timer is set to their Modified Relative Agility. When this timer is handled after expiration:

  • If this is a character, they enter the Menu Queue.
  • If this is a monster, the next step of their script is handled. This queues a command (though that command may be “Do Nothing”), and may have other effects as well, such as modifying stats or setting condition flags.

After a command is entered, the Action Timer is set to a value that depends on the command.

  • For monsters, the base value is always 1.
  • For many commands like Fight, Parry, Change, Item, Hide, Sing, Twin, Bluff and Sneak, the base value is 0.
  • For spells, the base value is set to the spell's cast time.
  • For Jump, the base value is 4 ticks.
  • For TwinCast, Kick and Dark, the base value is RA / 2, rounded down (with a minimum value of 1).
  • For Aim and Dart, the base value is RA / 4, rounded down.
  • For Recall, the base value is equal to RA.

The Speed Modifier is then applied to the base value, and the Action Timer is set to the resulting value. When the timer is handled after expiration, the action is executed.

Sleep and Paralyze

The Sleep and Paralyze status effects both work by setting the Action Timer to a high number, preventing the target from acting until after it expires.

The formula is: ( (300 - (4 * target's WIL) ) * Speed Modifier) / 6, with WIL being replaced by the $2F stat if the target is a monster. If the result would be negative when the Speed Modifier is applied, it is set to 1 first.

Chains

When a monster starts a Chain, all other battle participants' timers are paused until the Chain ends.

Timer Flags

This section is highly technical, and probably only useful in the context of physical attack status procs, certain spells that cause Paralyze or Sleep, and possibly the mimic glitch.

Each timer includes a byte for storing flags:

  • EXPIRED: Set when a timer reaches zero. Cleared when the timer is handled.
  • COMMAND: Set on the Action Timer when a command is queued. If the timer expires with this flag set, the current queued command will be issued and this flag will be cleared.
  • STATUS: Set when the timer is tied to a status effect (e.g., the Poison Timer, or with Sleep/Paralyze for the Action Timer)
  • READY: Mostly used in the same way as the EXPIRED flag, but for characters it isn't cleared until a command is queued. Seems to be used to track when a character is Stopped while at the command menu or in the Menu Queue. When Stop expires, their Action Timer will be set back to 1.

For the purposes of status procs and the relevant spells that cause Paralyze and Sleep, the effect will fail if any flags are set on the target's Action Timer. It should only pass this test if the target has no command queued, is not asleep or paralyzed, and their Action Timer is non-zero.

Interactions

Hide/Jump

The handlers for expired Poison, Stone, and Count timers do nothing if the character is currently Hiding or Jumping. The Poison damage/Petrification increase/Count death will not occur, and the timer will continue to be marked as expired.

Wall and Sap timers are handled normally, though the character will not take damage from Sap.

1)
With the exception of Count, which decrements every second tick
2)
This results in 30 ticks for Stop, and 150, 300 and 600 ticks, respectively, for HrGlasses 1, 2 and 3
3) , 4)
For monsters, the $2F stat is used instead of Vitality
5)
This results in 30 ticks for Wall, 50 for StarVeil, and 70 for MoonVeil
6)
A fully slowed actor will have these timers doubled. A maximally fast character will have these timers multiplied by 3/4, then rounded down
7)
Exception: Strike First, Surprise, and Back Attacks. See: ATB System for how they modify starting timers
battle_timers.txt · Last modified: 2024/04/13 20:41 by wylem