Final Fantasy Bouncy Digits
Final Fantasy bouncy digits are easy! Here I will explain them to you. Later I will include fine illustrations and maybe a windows demo or two.
The Final Fantasy bouncy digits can be achieved by means of a table describing the vertical offset of a digit from the y-position where the digit should eventually rest. 0 would be resting, and 16 would be way up in there air. Each digit in a Final Fantasy Bouncy Number is controlled by the same table--they just each start at a different point, offset by three. I should point out that I have the actual numbers used in Final Fantasy 5 and 6. I will now go into more detail!
int DigitTable[64]={
     0,0,0,0,0,0,3,6,9,12,
     14,15,15,16,16,16,15,15,14,12,
     9,6,3,0,2,4,4,5,5,5,
     4,4,2,1,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,
     0,0,0,0};
Above is a table written up in C that includes the data crucial for recreating our beloved Final Fantasy bouncy digit effect. It is padded with zeroes to make my code a little cleaner, to keep later on from having to check if our animation has overrun the basic animation script and avoid special-case code for those cases.
Each of these numbers represents the position of a digit at a point in time. A number is used every frame on a super NES. There are 60 frames per second on a super NES. This means that the Bouncy Number effect lasts somewhere around half a second on a super NES, with a bit of resting time at the end for you to see the damage.
In FF4, the one's digit starts at index 5 (0-based) and moves through the indices for one half-second (30 frames). At the end of this time, the animation is complete, and rests for a moment. The ten's digit starts three indices later into the table. The hundred's digit starts another three in, and so does the thousand's digit.
In FF5, the one's digit starts at index 0 and moves through the indices for 35 frames. Note that this is just enough to make up for the fact that the FF5 Bouncy Number animation starts five indices (and therefore frames) earlier in the table. This means that for all the digits to have settled down, the FF5 animation must move through five more digits than FF4. Yeah, yeah. you've got it figured out by now.
I must also point out that all the code that me and my friends write is based around a 100hz code, and it is difficult to get accurate 60hz and 30hz stuff from a 100hz timer. So I make my bouncy digits effect twice as long, lasting around one second, by considering a frame (and an index increment) as happening once every three ticks. That's 0.9 seconds for the bouncy part.
All I do to implement this in code is render the bouncy digits for 1.5 seconds, starting at index 5 for FF4-emulation and index 0 for ff5-emulation. You start three indices later for each digit up from the one's digit.
//ff4
//for(i=0;i<4;i++)
//     print_digit(digit[i],x+18-i*6,y-DigitTable[5+3*i+time_elapsed/3]);
//ff5
for(i=0;i<4;i++)
     print_digit(digit[i],x+18-i*6,y-DigitTable[3*i+time_elapsed/3]);
x and y are merely the basic x and y position of the number. time_elapsed is the time (in our system ticks) that have elapsed since the crazy Bounciness started.
Note that the latest point in the table we can start is +5 for FF4 and +9 for the thousand's digit, for a total of 14 extra. Since I wanted to run the Bouncy Number effect for 1.5 seconds, I needed 50 ticks room for any possible digit so that the animation could run itself into completion without running out of room in the table. This 50 + 14 = 64 entries in the table. And you thought i just picked 64 because it looked neat.
I wonder if this is what Squaresoft did...?
Enough of this. Have fun pretending you make Final Fantasy games, and enhance your fantasy by using the Final Fantasy Bouncy Digits effect!