The current URL is datacrystal.tcrf.net.
Mother 3/Sound battle timing windows
This is a sub-page of Mother 3.
Rhythm battle timing window table | |
Game | Mother 3 |
Start Address | 0xEC578 |
End Address | 0xEC92F |
# of Entries | 119 (0x77) |
Entry Length | 8 bytes (0x8) |
Total Length | 952 bytes (0x3B8) |
Back to the ROM map |
Overview
This table contains information about how soon before or after the beat a player is allowed to press A to use a rhythm combo during battles. Each background music option for battles has different "timing windows" or "judgment windows."
Format
Each entry in the table is 8 bytes.
- 00-01 (02) = ID for the table entry
- 02-03 (02) = Song number
- 04-04 (01) = "Great" window length, in 60 FPS frames
- 05-05 (01) = "OK" window length, in 60 FPS frames
- 06-07 (02) = Likely padding.
Every battle theme should have an entry in this table with the "song number" set to its ID. If a theme is missing, the first entry in the table (for song 0, offering ~1 frame and ~3 frames of leniency forwards and backwards for hitting Great and OK notes, respectively) will be used instead. As of writing, it is unknown how Great and OK note hits differ, if at all. If this distinction is found, they should probably be renamed to reflect it.
Building complicated rhythms
The Mother 3 rhythm battle system only supports rhythms where you have to press A once every 24 ticks of the sequence data. Typically, 24 ticks is always used as the length of a "quarter note" (also known as a "crotchet" in British English) in most compositions, and the tempo BPM setting reflects the number of quarter notes (beats) in one minute. If Mother 3 music used this convention, however, it would only have very simple, evenly spaced rhythm combos. Instead, Mother 3 adjusts the tempo so that 24 ticks of sequence data occur between every time a "beat" of the song occurs. This results in terribly ugly conversions of the sequences to MIDI, but it probably minimizes the amount of integration work that the developers had to do with the sound engine, which is a common GBA sound engine straight from Nintendo, used as-is.
As an example, consider the theme "Dry Guys" (song 1960). In a normal MIDI file or sequence data for normal GBA music, its sequence data would have a constant tempo of ♩ = 144 BPM, and the notes would change length only when they sound longer. In Mother 3, the tempo instead flips back and forth between 96 BPM for 48 (2 * 24) ticks and 144 BPM for 72 (3 * 24) ticks, over and over. The 2:3 ratio between the two tempos results in a perceived rhythm of waiting 3 eighth notes after the first two rhythm notes, then only 2 eighth notes for the next three rhythm notes.
Timing window lengths
Window lengths in the table are measured in frames -- that is, the smallest amount of time that the LCD screen of the GBA can display a single still image, not anything directly based on the sound system or music speed. If a note begins playing on frame 100 of the song and the "Great" window length is set to 1, then the intention seems to be that you should be able to hit the beat and get a "Great" judgment by pressing A on frames 99, 100, or 101 (but not any earlier or later). Upping this window length to 2 means frames 98 and 102 would also work.
Accuracy of timing windows
In practice, Nintendo did not provide developers with an easy way to introspect into the engine data structures enough to know when the next beat will occur in a given piece. (The exact number of frames for each beat can change, due to notes being quantized to begin and end on frame boundaries, so it can't be assumed constant, especially in a rhythm game.) As a result, the Mother 3 developers instead do their own bookkeeping to determine how many frames the last full beat took; this duration is used as part of a conversion factor from ticks to frames for the current position in the song. Care was taken not to discard fractional parts of the duration during this conversion and comparison with the timing window length.
Unfortunately, even ignoring off-by-one errors from one beat to the next caused by quantization, this frame estimate will be less accurate immediately after a tempo change, which the Mother 3 battle music is full of! If the tempo suddenly doubles at the beginning of a beat, the timing window will have half of its nominal length after the note, until a full beat completes; if the tempo suddenly halves, the timing window will be twice as long after the note. Songs like Accelerando with tempo changes in the middle of a beat require more work to calculate the exact difference.
Unknown parts of rhythm battle gameplay
As of writing, we don't know the following:
- Whether/how the game checks if you've already hit the current note (to prevent you from getting two or more note hits within the same window)
- Why the game apparently refuses to allow 16-hit combos against the first battle with the Mole Cricket
- What effect the distinction between "Great" and "OK" judgments has
Code for everything else discussed above can be found at $807498C and $80748C8 in the ROM.