Dr. Mario: Difference between revisions

From TetrisWiki
Jump to navigation Jump to search
No edit summary
(Rephrase confusing sentence in virus placement algorithm)
 
(2 intermediate revisions by one other user not shown)
Line 229: Line 229:
# Use the number generated in step 1 as the candidate virus Y coordinate, with 1 on the bottom and 16 the top.
# Use the number generated in step 1 as the candidate virus Y coordinate, with 1 on the bottom and 16 the top.
# Using the number of remaining viruses as the numerator, take the remainder of division by 4.
# Using the number of remaining viruses as the numerator, take the remainder of division by 4.
# Using the remainder calculated in step 5, with 0 = Yellow, 1 = Red, and 2 = Blue, if the remainder was 3, do the following, else use the integer to select the currently selected virus color as specified earlier this sentence:
# Using the remainder calculated in step 5, set the currently selected virus color: Yellow if 0, Red if 1, and Blue if 2. Otherwise,if the remainder was 3, do the following:
## Randomly generate an integer in range [0,15].
## Randomly generate an integer in range [0,15].
## Select from the "PRNG Output" table above the virus color matching the integer generated in step 6.1.
## Select from the "PRNG Output" table above the virus color matching the integer generated in step 6.1.
Line 247: Line 247:


== Gravity ==
== Gravity ==
There is a "speed counter" that increments every 10 capsules; there is a subtle sound effect that plays when it increments. The speed counter's maximum value is 49. There is also a speed base value table, indexed by the currently selected speed:
=== NES Version ===
{| class="wikitable"
 
When the 10th (20th, 30th, and so on) vitamin capsule appears in Dr. Mario's throwing hand, a sound effect plays and the drop speed of the vitamin capsules increases slightly. This speed up can happen up to a maximum of 49 times in a level, meaning there are a total of 50 possible drop speeds for each SPEED setting (LOW, MED, or HI).
 
Here are technical details for the NTSC game <!--(PRG+CHR CRC32 198C2F41)--> and the PAL game<!--(PRG+CHR CRC32 9735D267)-->:
 
* A gravity table begins at memory address A795 in the NTSC game and memory address A79E in the PAL game. It consists of 81 one-byte entries (indexes decimal 0 to 80). The actual values in the memory addresses are zero-based: a value of 0 has an effect of 1 frame per row. The gravity table below shows the one-based "frames per row" values.
 
* A three-byte table of the starting indexes for each SPEED setting exists at memory address A38D in the NTSC game and memory address A396 in the PAL game. The contents are the same in both versions:
:{| class="wikitable"
|-
|-
! Low
! LOW
| 15
| 15
|-
|-
! Medium
! MED
| 25
| 25
|-
|-
! High
! HI
| 31
| 31
|}
|}
The current speed counter is added to the speed base value and that is used to index the gravity table. The gravity table is as follows:


Indexes 0-25: (35 - index) * 2 - 1
* A count of the number of times a speed up has occurred this level exists at memory address 8A (as well as having other copies at addresses A0, 30A, and 320).


Indexes 26-34: 44 - index
* The starting index is added to the number of speed ups, and the result is used as an index into the the gravity table.


Indexes 35 and up to 79 use the following table, with values in the right column being in frames per row:
Here is the gravity table:
 
<div style="overflow: auto;">
{| class="wikitable"
{|class="wikitable" style="margin-bottom:0;"
|-
| 35 || 9
|-
| 36 || 9
|-
| 37 || 8
|-
| 38 || 8
|-
| 39 || 7
|-
| 40 || 7
|-
| 41 || 6
|-
| 42 || 6
|-
| 43 || 5
|-
| 44 || 5
|-
| 45 || 5
|-
| 46 || 5
|-
| 47 || 5
|-
| 48 || 5
|-
| 49 || 5
|-
| 50 || 5
|-
| 51 || 5
|-
| 52 || 5
|-
| 53 || 5
|-
| 54 || 5
|-
| 55 || 4
|-
| 56 || 4
|-
| 57 || 4
|-
| 58 || 4
|-
| 59 || 4
|-
| 60 || 3
|-
| 61 || 3
|-
| 62 || 3
|-
| 63 || 3
|-
| 64 || 3
|-
| 65 || 2
|-
| 66 || 2
|-
| 67 || 2
|-
| 68 || 2
|-
| 69 || 2
|-
| 70 || 1
|-
| 71 || 1
|-
| 72 || 1
|-
| 73 || 1
|-
|-
| 74 || 1
!Index
!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
|-
|-
| 75 || 1
!style="white-space: nowrap;"|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
|-
|-
| 76 || 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
|-
|-
| 77 || 1
!rowspan="3"|Ranges
|colspan="15" style="border:none;"|
|colspan="50" style="background:#DDFFDD;"|LOW: indexes 15 to 64
|-
|-
| 78 || 1
|colspan="25" style="border:none;"|
|colspan="50" style="background:#FFFFDD;"|MED: indexes 25 to 74
|-
|-
| 79 || 1
|colspan="31" style="border:none;"|
|colspan="50" style="background:#FFDDDD;"|HI: indexes 31 to 80
|}
|}
</div>


{{Nintendo games}}
{{Nintendo games}}


[[Category:Non-tetromino games]]
[[Category:Non-tetromino games]]

Latest revision as of 04:45, 23 October 2020

Dr. Mario
Developer(s)Nintendo
Publisher(s)Nintendo
Platform(s)NES, Arcade, Game Boy, Super NES, N64, GameCube (Japan only), GBA, Wii
Release1990 (NES/GB)
Gameplay info
Next pieces1
Playfield size8w x 11–16h
Hold pieceno
Hard dropno
DrMNES-title.png
DrMNES-play.png

Dr. Mario is a non-tetromino puzzle game franchise developed by Nintendo and released on its systems.

The bottle is 8 blocks wide by 11 to 16 blocks high (depending on version) and starts out partially full of "viruses", or fixed blocks of the color red, yellow, or blue.

Pieces in Dr. Mario are vitamin pills with two halves (making them dominoes), with each half colored red, yellow, or blue. The player can move or rotate them as they fall into the bottom. Once a pill locks, if four or more blocks of a color are aligned horizontally or vertically, they are removed, and the pill segments above them (but not viruses) fall in a cascade. In 2-player, cascades cause garbage pill segments to drop into the opponent's playfield. Anything that falls falls slowly, at a rate of 4 rows per second, due to the design of the playfield refresh logic. Modern versions allow players to speed up the fall rate of these cascades in single-player, but not in multiplayer, where the time lost waiting for garbage segments to fall is often more damaging than the segments themselves.

Players who like Dr. Mario may also like Columns, Klax, and Puyo Pop. The game Tetris 2 can be thought of as Dr. Mario with tetrominoes.

Rotation system

Ordinarily, the pills rotate within a 2x2 box whose bottom left corner is always filled. Clockwise rotation looks like this:

G........G
G........G
G...ZJ...G
G........G
G........G
G...Z....G
G...J....G
G........G
G........G
G........G
G...JZ...G
G........G
G........G
G...J....G
G...Z....G
G........G

Wall kicks on Dr. Mario (NES), WarioWare Inc.: Mega Microgame$ (GBA), and Dr. Mario & Puzzle League (GBA) are as follows:

Horizontal to vertical:

G........G
G........G
G...ZJ...G
G........G
G........G
G...Z....G
G...J....G
G........G
G........G
G...G....G
G...ZJ...G
G........G
G........G
G...G....G
G...ZJ...G
G........G

No kick here

Vertical to horizontal:

G........G
G...Z....G
G...J....G
G........G
G........G
G........G
G...ZJ...G
G........G
G........G
G...Z....G
G...JG...G
G........G
G........G
G........G
G..ZJG...G
G........G

Kick left

G........G
G...Z....G
G..GJG...G
G........G
G........G
G...Z....G
G..GJG...G
G........G

No kick here

Tetris & Dr. Mario has some additional wall kicks from horizontal to vertical:

G........G
G...G....G
G...ZJ...G
G........G
G........G
G...GZ...G
G....J...G
G........G

Kick right

G........G
G...GG...G
G...ZJ...G
G........G
G........G
G...GG...G
G...Z....G
G...J....G

Kick down

G........G
G...GG...G
G...ZJ...G
G...G....G
G........G
G...GG...G
G....Z...G
G...GJ...G

Kick down+right

G........G
G...GG...G
G...ZJ...G
G...GG...G
G........G
G...GG...G
G...ZJ...G
G...GG...G

Fail

Capsule Generation

NES Version

A sequence of length 128 is generated before a game starts, with each element of the sequence an integer uniformly distributed in range [0,8], with the integer being used to select from all nine possible color pairs for a capsule. The 128-long sequence loops, so once the 129th capsule is generated, it's the same as the first, and 130th the same as the second, and so on.

Virus Generation

NES Version

Virus Level 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Maximum Row 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 11 11 12 12 13

For virus levels 20 and up, use virus level 19's maximum row value.


PRNG Output 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Virus Type Yellow Red Blue Blue Red Yellow Yellow Red Blue Blue Red Yellow Yellow Red Blue Red


The algorithm described here takes as inputs the current bottle virus contents, selected virus level, and the number of remaining viruses to generate. It's called repeatedly until the remaining viruses to generate returned is zero:

  1. Generate a random number in range [1,16].
  2. If the random number in step 1 is greater than the maximum allowed row (seed the "Virus Level"/"Maximum Row" table above), go back to step 1.
  3. Generate a random number in range [1,8] and use for the candidate virus X coordinate, with 1 on the left and 8 on the right.
  4. Use the number generated in step 1 as the candidate virus Y coordinate, with 1 on the bottom and 16 the top.
  5. Using the number of remaining viruses as the numerator, take the remainder of division by 4.
  6. Using the remainder calculated in step 5, set the currently selected virus color: Yellow if 0, Red if 1, and Blue if 2. Otherwise,if the remainder was 3, do the following:
    1. Randomly generate an integer in range [0,15].
    2. Select from the "PRNG Output" table above the virus color matching the integer generated in step 6.1.
  7. Do repeatedly the following while the current candidate virus position is filled:
    1. Increment the candidate virus X position.
    2. If the candidate virus X position is now 9:
      1. Set the candidate virus X position to 1 and increment the candidate virus Y position
    3. If the candidate virus Y position is now 17:
      1. Return the number of remaining viruses to generate.
  8. Check in all four cardinal directions 2 cells away from the candidate virus position the virus contents of the bottle.
  9. If all three colors are present in the four checked cells, go back to step 7.1 (don't do step 7).
  10. If the four checked cells in step 8 lacks the currently selected virus color, go to step 13.
  11. If the currently selected virus type is yellow, change the currently selected virus color to blue; if the currently selected virus type is red, change the currently selected virus color to yellow; if the currently selected virus color is blue, change the currently selected virus color to red.
  12. Go to step 8.
  13. Set the candidate virus position in the bottle to the currently selected virus color.
  14. Return the number of remaining viruses less one.

Gravity

NES Version

When the 10th (20th, 30th, and so on) vitamin capsule appears in Dr. Mario's throwing hand, a sound effect plays and the drop speed of the vitamin capsules increases slightly. This speed up can happen up to a maximum of 49 times in a level, meaning there are a total of 50 possible drop speeds for each SPEED setting (LOW, MED, or HI).

Here are technical details for the NTSC game and the PAL game:

  • A gravity table begins at memory address A795 in the NTSC game and memory address A79E in the PAL game. It consists of 81 one-byte entries (indexes decimal 0 to 80). The actual values in the memory addresses are zero-based: a value of 0 has an effect of 1 frame per row. The gravity table below shows the one-based "frames per row" values.
  • A three-byte table of the starting indexes for each SPEED setting exists at memory address A38D in the NTSC game and memory address A396 in the PAL game. The contents are the same in both versions:
LOW 15
MED 25
HI 31
  • A count of the number of times a speed up has occurred this level exists at memory address 8A (as well as having other copies at addresses A0, 30A, and 320).
  • The starting index is added to the number of speed ups, and the result is used as an index into the the gravity table.

Here is the gravity table:

Index 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
Ranges LOW: indexes 15 to 64
MED: indexes 25 to 74
HI: indexes 31 to 80