0

I'm trying to make a spin on the Active Time Battle mechanic (ATB) most commonly seen in the Final Fantasy series.

ATB is a timing mechanic, whereby units in combat will each have a meter that fills up over time. Once it's full, the unit can then take their turn, once they've done it resets to 0 and gradually fills up again.

I'm not sure how the maths works out in FF specifically, but I'm attempting to make one that has a minimum time for the fastest unit, and all the other units will take their turn based on how fast they are compared to the fastest unit.

Breakdown of the variables:

  • A - The amount of ATB points required to take a turn (constant 100)
  • t - The minimum time for a turn to take (seconds)
  • s - The speed of the unit
  • M - The speed of the fastest unit
  • b - The current ATB value
  • $\Delta$ - The change in time over the frame

My current method is straightforward:

$b = b + s * \Delta$

But the results end up looking like this:

Unit Speed Average wait time before turn (s)
Enemy 1 5 127
Enemy 2 3 212
Player 20 31.5
Companion 10 63

What I'm trying to aim for if the minimum turn time was 10 seconds:

Unit Speed Average wait time before turn (s)
Enemy 1 5 40
Enemy 2 3 66.6...
Player 20 10
Companion 10 20

Using the following to determine the times $$T = \frac{t}{s / M}$$

My maths has suffered quite a bit since leaving university so I can't see what I'm missing, since everything I seem to try is either too slow or too fast. The closest I managed to get was 6 seconds for the fastest unit with the following: $$b = b + s * A * \Delta$$

  • Could you describe how the ATB system is supposed to work? I have something in mind but it's very vague. I know some games from FF series are turn based but I suppose it is not what you want to do here. – Qise Sep 06 '23 at 10:45
  • Apologies, should've added that in just in case in the first place. I've amended the question, second paragraph – Adam Ratcliffe Sep 06 '23 at 10:53
  • I'm not completely sure to understand the choice of each variable. In particular $b$ seems quite mysterious to me. I suppose an easier way (it seems easier to me) would be to replace $b$ by $b_i$, one for each entity $i$. Then, each frame, you update $b_i$ by increasing it by $\frac{\Delta}{t} \times \frac{s}{M}\times A$. You can check it takes exactly $\frac{t}{\Delta}$ frames aka $t$ time for the faster unit to take it's turn. Any other unit will progress at speed multiplied by $\frac{s}{M}$. – Qise Sep 06 '23 at 11:03
  • True, sorry I didn't know there was a way to distinguish entities with subscript. Also thank you so much that revision has worked as expected. If you have time, could you give me a show of how you got to that? – Adam Ratcliffe Sep 06 '23 at 12:26
  • "How much frame for the faster unit to take it's turn?" > \frac{t}{\Delta}. "How much points do I need to give to the fastet unit per frame?" > A * (inverse of number of frames required). "How much points the other units earn?" > $\frac{s}{M}$ times the speed at which the fast unit earns points – Qise Sep 07 '23 at 10:38

0 Answers0