Mechanics (NES)

From Dr. Mario
Revision as of 20:58, 15 August 2020 by Dmwit (talk | contribs)
Jump to navigation Jump to search

DAS

Tapping the left or right arrow moves the pill one column; but you can also press and hold an arrow to move the pill multiple columns. The first extra column is delayed a bit, to give the user time to lift their finger off the button and get precise single-column moves easily, but remaining columns of movement happen rapidly.

In detail: in addition to the pill location, the game tracks a hidden DAS counter, and directional arrows affect this counter. If a pill is under player control and a direction transitions from unpressed to pressed, the pill is immediately moved in the selected direction and the DAS counter is set to 0. While the button is held down, the counter increments by one per frame. Whenever it reaches 15, it resets to 10 and the pill moves in the selected direction. If the pill is obstructed by a virus or capsule when it attempts to shift sideways, the DAS counter is set back up to 15, and so attempts to move again next frame, which may work if the pill has dropped a row or rotated from horizontal to vertical. Bumping against the side of the bottle instead of a virus or capsule has no special affect on the DAS counter.

Practically speaking, this means a few things.

  1. The frame delays between shifts if you press and hold a directional arrow are 0, 16, 6, 6, 6, 6, ... under normal circumstances.
  2. You can keep a high DAS counter from one pill to the next by holding down a directional button. You can even switch directions without resetting the DAS counter, so long as you switch while the pill is not under your control (e.g. during clear animations, interpill gravity, or the animation as a pill is "tossed" into the bottle).
  3. If the DAS counter is high because you were bumping into the side of the bottle as the previous pill locked, the frame delay between the next pill coming under your control and it shifting one column could be anywhere from 0-6 frames. If it was bumping into a virus or capsule instead, it will always shift one column on the first frame of control.

Gravity

While pills are under player control, they are slowly forced down the playfield even if the player does not request downward motion. Every ten pills, this speed increases. See also #Fall time for the details about how unsupported board elements are forced to drop.

In detail: the game tracks two variables, coarse speed and fine speed. The coarse speed is user-selected from three options, called LOW, MED, and HI in the game UI. These names correspond to a number:

UI Name LOW MED HI
Coarse speed 15 25 31

The fine speed begins at 0 at level start. Between the 8th and 9th pills, it increases by one, then increases by one every 10 pills after that, until it reaches 49, where it plateaus. The speed at which the pill drops is computed (as a number of frames the game allows you to wait before forcing the pill down one row) by adding the coarse and fine speeds, then using the result to index into the following table:

Combined speed 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
NTSC frames per row 70 68 66 64 62 60 58 56 54 52 50 48 46 44 42 40 38 36 34 32 30 28 26 24 22 20 19 18 17 16 15 14 13 12 11 10 10 9 9 8 8 7 7 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 4 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 1
PAL frames per row 57 55 54 52 50 49 47 45 44 42 40 39 37 35 34 32 30 29 27 25 24 22 20 19 17 16 15 14 13 12 11 10 10 9 8 7 7 6 6 6 5 5 5 5 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1

For example, suppose you have locked 24 pills on a level, and are playing at MED speed. The coarse speed is 25 (for MED); the fine speed is 2 (because it increased after pills 8 and 18); the combined speed is 27 (=25+2); and the frames per row is 18 for NTSC or 14 for PAL.

The rows of the above table are stored in game memory (and so can be modified with judicious use of game genie codes or other memory hacks); see Memory addresses for details on where to look. For technical reasons, the frames per row table is stored with all values one smaller than those shown here. (For example, the NTSC table begins 69, 67, 65, ...; not 70, 68, 66, ....)

Why didn't they make LOW speed have index 0 and just shift the table down? It is a mystery. Probably they experimented with different values for the coarse speed lookup table for a while, and just never cleaned it up once they'd settled on a selection.