Tetris DX: Difference between revisions

From Hard Drop Tetris Wiki

Jump to: navigation, search
No edit summary
m (Updated formulas to use math expressions)
 
(21 intermediate revisions by 15 users not shown)
Line 1: Line 1:
reltacnataba
{{Infobox/Game
{{Infobox |title = Tetris DX
|title = Tetris DX
|developer = Nintendo  
|image = Tetris_DX_Boxart.jpg‎
|publisher = Nintendo  
|developer = Nintendo  
|released = 21, Oct 1998 (Japan)<br />31, Oct 1998 (USA)<br />1, Jul 1999 (Europe)
|publisher = Nintendo  
|platform = Game Boy Color
|releasedate = 21, Oct 1998 (Japan)<br />31, Oct 1998 (USA)<br />1, Jul 1999 (Europe)
|platform = [[:Category:Game Boy games|Game Boy Color]]
|preview = 1
|preview = 1
|playfield = 10x18
|playfield = 10x18
|system = Bounding box, wall kick, SRS predecessor
|hold = No
|hold = No
|hard = No
|hard = No
|SRS = Bounding box, wall kick, SRS predecessor
|title-scrn=Tetris_DX_title.png
|ingame-scrn=Tetris_DX_play.png
}}
}}
''Not to be confused with [[Tetris Deluxe]], a game released for western mobile phones.''
''Not to be confused with [[Tetris DS]], a game released for the Nintendo DS.''


'''Tetris DX''' was a Game Boy Color game as an enhancement of Nintendo's original [[Tetris (Game Boy)|Game Boy Tetris]], with two added gameplay modes (Ultra, lasting 3 minutes; and Vs. CPU, a match against the computer), a profile/save feature, and color graphics on [[Game Boy Color]] and above. In addition, the game's [[rotation system]] had a glitch which lets a player move any [[tetromino]] except ''O'' upward by holding the direction against a wall while rotating in the opposite direction.
'''Tetris DX''' is a Game Boy Color game that is an enhancement of Nintendo's original [[Tetris (Game Boy)|Game Boy Tetris]], with two added gameplay modes (Ultra, lasting 3 minutes; and Vs. CPU, a match against the computer), a profile/save feature, and color graphics on [[Game Boy Color]] and above. In addition, the game's [[rotation system]] had a feature which lets a player move any [[tetromino]] except ''O'' upward by holding the direction against a wall while rotating in the opposite direction.


== Modes ==
== Modes ==
* Marathon (score maxes at 9,999,999)
* Marathon (score maxes at 9,999,999)
* Ultra
* True 40 lines mode (not 40 "points" like in ''Tetris Worlds'')
* True 40 lines mode (not 40 "points" like in ''Tetris Worlds'')
* Vs. CPU opponent
* Vs. CPU opponent
Line 24: Line 24:
<br clear="all">
<br clear="all">
== Rotation system ==
== Rotation system ==
[[Image:TDX-pieces.png|thumb|All rotation states of all seven tetrominoes in TDX. From top to bottom: I, J, L, O, S, T, Z. The circle doesn't appear in the game; it helps to illustrate the axis on which each tetromino rotates.]]
[[File:TDX-pieces.png|thumb|All rotation states of all seven tetrominoes in TDX. From top to bottom: I, J, L, O, S, T, Z. The circle doesn't appear in the game; it helps to illustrate the axis on which each tetromino rotates.]]
The rotation system is an early version of what would become [[SRS]].
The rotation system is an early version of what would become [[SRS]].
Like in SRS, tetrominoes of width 3 rotate as if in a bounding square; unlike in SRS, L, J, and T start flat side up.
Very interestingly, L, J, T spawn pointing down, while I, S, Z spawn pointing up.
TDX first tries rotation about the center of the box (the blue circle).
TDX first tries rotation about the center of the box (the blue circle).
If this fails, it tries rotation about an alternate center displaced by one cell (the gray circle).
If this fails, it tries rotation about an alternate center displaced by one cell (the gray circle).
Line 68: Line 68:
Rotate right about<br>alternate center
Rotate right about<br>alternate center
|}
|}
This particular exploit was fixed in SRS.
This particular exploit was fixed in SRS, because it uses a different rotation system.


=== Infinity ===
=== Infinity ===
Line 92: Line 92:
|}
|}
<br clear="all">
<br clear="all">
== Randomizer ==
Like in the original [[Tetris_(Game_Boy)#Randomizer|GameBoy version]], some piece shapes show up more frequently than others - for different reasons though. A test involving around 10,000 pieces resulted in the following piece distributions:
{| class="wikitable" style="text-align:center;"
|-
! Shape
! Chances
! Piece ID
|-
| '''I''' || 12.2 % || 0
|-
| '''T''' || 24.4 % || 1
|-
| '''Z''' || 14.1 % || 2
|-
| '''S''' || 11.9 %  || 3
|-
| '''J''' || 12.8 % || 4
|-
| '''L''' || 12.5 % || 5
|-
| '''O''' || 12.1 % || 6
|}
Almost every fourth dealt piece is T-shaped. According to [https://tetrisconcept.net/threads/randomizer-theory.512/page-12#post-65121 people] trying to read the assembly code, the algorithm works roughly like this:
<pre>
currentPiece = nextPiece
pieceCount = (pieceCount + 1) % 7
// generate the piece
a = randInt(0..7)
if a == 7 {
    a = pieceCount
}
if a != lastPiece {
    // stick to choice
    lastPiece = a
    rerollCount = 0
} else {
    // change choice
    rerollCount += 1
    a = rerollCount
    if rerollCount >= 5 {
        rerollCount = 0
        go back to the "generate the piece" comment
    }
}
nextPiece = a
</pre>
The final choice is noted by the variable '''a''' in this pseudo code. Each shape is represented by an integer number between 0 and 6, as listed in the table above (piece ID). At first, the algorithm rolls a random integer number between 0 and 7, and '''a''' becomes that number - except if the random number was 7, then it will chose 0 to 6 according to the total number of dealt pieces. The algorithm will stick to this choice, if '''a''' differs from the last dealt piece.
However, there's also some code with the purpose to reduce the likelihood of receiving the same shape twice in a row, and this part is flawed. There's a variable called rerollCount and it basically counts how often the algorithm will change its choice in a row. The chance to change the choice is slightly below 1/7 = 14.3 %, and rerollCount is almost [https://en.wikipedia.org/wiki/Geometric_distribution geometrically distributed] according to this chance. rerollCount is most likely 1 in this branch of the code; 2 is the second most common; and 5 is already so unlikely that this if statement can be ignored.
Anyway, if the algorithm changes its choice, then it will reroll the piece exactly once. And in case of the reroll it doesn't set '''a''' to a random integer number - it sets '''a''' to rerollCount instead. And as explained above, rerollCount is most likely 1 which corresponds to the T shape. And if it's not 1, then it's most likely 2 which corresponds to the Z shape. This explains why the T piece shows up almost twice as often as the other shapes, and why the Z piece is the second most common. It seems the S piece doesn't show up as often as it should according to this code - maybe the random number generation has a slight bias, too.
== Power ==
Power is a value saved against each user profile and displayed on the file select screen. It updates after the player completes a Marathon, Ultra, or 40 Lines game (and finishes watching the celebratory cutscene if applicable).
While not a perfect description, power can be roughly described as a recent score-per-line average.
In Marathon and Ultra modes, power for a single game is calculated using this formula:
<math>
P_c = {S - D_1 + D_2 \over L} \times M
</math>
* P<sub>c</sub> = Current Game Power
* S = Score
* D<sub>1</sub> = Soft-drop points % 65,536
* D<sub>2</sub> = Soft-drop points % 16
* L = Lines % 65,536
* M = Line Multiplier
** If L is 0, M is 0
** If L is between 1 and 10, M is 0.25
** If L is between 11 and 15, M is 0.5
** If L is between 16 and 20, M is 0.75
** Else M is 1
This is then combined with your existing power using this formula:
<math>
P_n = {P_c + P_p \times N \over N + 1}
</math>
* P<sub>n</sub> = New Profile Power
* P<sub>p</sub> = Previous Profile Power
* N = Number of games played previously, capped at 5
The score value used in this calculation is an internal 4-byte integer tracked separately from the BCD representation used by the score counter. This internal value will continue increasing even after the counter maxes out, up to 4,294,967,295 before overflowing.
The line value is an internal 2-byte integer, also tracked separately from the line counter. This will overflow at 65,536 lines, though this overflow will not be displayed in the line counter.
== Bugs ==
The line counter is capped at 999,999 lines. However, it has a bug where six-digit values will prevent the highest digit from being displayed. For example, a value of 100,000 lines will be displayed in-game as "00000".
The power value displayed on the file select screen has a similar bug, only displaying the last four digits. However, the only way to achieve a five-digit power value is by overflowing the internal lines value in a single Marathon game.
== Gallery ==
<gallery>
Tetris_DX_title.png
Tetris_DX_play.png
</gallery>
== See also ==
== See also ==
{{Nintendo games}}
{{Nintendo games}}
Line 99: Line 207:
**[http://translate.google.com/translate?u=http%3A%2F%2Fwww.din.or.jp%2F%7Ekoryan%2Ftetris%2Froll-o2.htm&langpair=ja%7Cen&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools English translation using Google Language Tools]
**[http://translate.google.com/translate?u=http%3A%2F%2Fwww.din.or.jp%2F%7Ekoryan%2Ftetris%2Froll-o2.htm&langpair=ja%7Cen&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools English translation using Google Language Tools]


[[Category:Games List]]
{{stub}}
[[Category:Games]]
[[Category:Game Boy games]]

Latest revision as of 17:19, 25 July 2024

Tetris DX
Tetris DX Boxart.jpg
Release Information
Developer Nintendo
Publisher Nintendo
Platform Game Boy Color
Release Date 21, Oct 1998 (Japan)
31, Oct 1998 (USA)
1, Jul 1999 (Europe)
Gameplay Information
Next pieces 1
Playfield dimensions 10x18
Rotation system Bounding box, wall kick, SRS predecessor
Hold piece
Hard drop
Has 180° rotation N/A
Adjustable tuning N/A
Websites

Twitch Speedrun.com StrategyWiki

Not to be confused with Tetris DS, a game released for the Nintendo DS.

Tetris DX is a Game Boy Color game that is an enhancement of Nintendo's original Game Boy Tetris, with two added gameplay modes (Ultra, lasting 3 minutes; and Vs. CPU, a match against the computer), a profile/save feature, and color graphics on Game Boy Color and above. In addition, the game's rotation system had a feature which lets a player move any tetromino except O upward by holding the direction against a wall while rotating in the opposite direction.

Modes

  • Marathon (score maxes at 9,999,999)
  • Ultra
  • True 40 lines mode (not 40 "points" like in Tetris Worlds)
  • Vs. CPU opponent


Rotation system

All rotation states of all seven tetrominoes in TDX. From top to bottom: I, J, L, O, S, T, Z. The circle doesn't appear in the game; it helps to illustrate the axis on which each tetromino rotates.

The rotation system is an early version of what would become SRS. Very interestingly, L, J, T spawn pointing down, while I, S, Z spawn pointing up. TDX first tries rotation about the center of the box (the blue circle). If this fails, it tries rotation about an alternate center displaced by one cell (the gray circle). For I, S, and Z, this center starts out one cell above the ordinary center; for L, J, or T, it starts out one cell below.

Wall climbing

This rotation system is exploitable, especially on low levels:

GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GSSSTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngSTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png

Charge DAS

GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngSTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngCSTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngSTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png

Rotate left

GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GSTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GSSTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GSTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png

Shift left (DAS)

GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GSSSTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngCTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png

Rotate right about
alternate center

This particular exploit was fixed in SRS, because it uses a different rotation system.

Infinity

Ordinarily, Tetris DX lock delay follows step reset behavior: only downward motion under gravity resets the lock delay timer. But rotation about the alternate center does reset the timer used for gravity. This can be exploited by placing a piece in a corner and rotating it back and forth about the alternate center:

GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngCTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GSSSTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GGGGGTet.pngTet.pngTet.pngTet.pngTet.png
GTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GSTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GSCTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GSTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.pngTet.png
GGGGGTet.pngTet.pngTet.pngTet.pngTet.png


Randomizer

Like in the original GameBoy version, some piece shapes show up more frequently than others - for different reasons though. A test involving around 10,000 pieces resulted in the following piece distributions:

Shape Chances Piece ID
I 12.2 % 0
T 24.4 % 1
Z 14.1 % 2
S 11.9 % 3
J 12.8 % 4
L 12.5 % 5
O 12.1 % 6

Almost every fourth dealt piece is T-shaped. According to people trying to read the assembly code, the algorithm works roughly like this:

currentPiece = nextPiece
pieceCount = (pieceCount + 1) % 7

// generate the piece
a = randInt(0..7)
if a == 7 {
    a = pieceCount
}
if a != lastPiece {
    // stick to choice
    lastPiece = a
    rerollCount = 0
} else {
    // change choice
    rerollCount += 1
    a = rerollCount
    if rerollCount >= 5 {
        rerollCount = 0
        go back to the "generate the piece" comment
    }
}
nextPiece = a

The final choice is noted by the variable a in this pseudo code. Each shape is represented by an integer number between 0 and 6, as listed in the table above (piece ID). At first, the algorithm rolls a random integer number between 0 and 7, and a becomes that number - except if the random number was 7, then it will chose 0 to 6 according to the total number of dealt pieces. The algorithm will stick to this choice, if a differs from the last dealt piece.

However, there's also some code with the purpose to reduce the likelihood of receiving the same shape twice in a row, and this part is flawed. There's a variable called rerollCount and it basically counts how often the algorithm will change its choice in a row. The chance to change the choice is slightly below 1/7 = 14.3 %, and rerollCount is almost geometrically distributed according to this chance. rerollCount is most likely 1 in this branch of the code; 2 is the second most common; and 5 is already so unlikely that this if statement can be ignored.

Anyway, if the algorithm changes its choice, then it will reroll the piece exactly once. And in case of the reroll it doesn't set a to a random integer number - it sets a to rerollCount instead. And as explained above, rerollCount is most likely 1 which corresponds to the T shape. And if it's not 1, then it's most likely 2 which corresponds to the Z shape. This explains why the T piece shows up almost twice as often as the other shapes, and why the Z piece is the second most common. It seems the S piece doesn't show up as often as it should according to this code - maybe the random number generation has a slight bias, too.

Power

Power is a value saved against each user profile and displayed on the file select screen. It updates after the player completes a Marathon, Ultra, or 40 Lines game (and finishes watching the celebratory cutscene if applicable).

While not a perfect description, power can be roughly described as a recent score-per-line average.

In Marathon and Ultra modes, power for a single game is calculated using this formula:

  • Pc = Current Game Power
  • S = Score
  • D1 = Soft-drop points % 65,536
  • D2 = Soft-drop points % 16
  • L = Lines % 65,536
  • M = Line Multiplier
    • If L is 0, M is 0
    • If L is between 1 and 10, M is 0.25
    • If L is between 11 and 15, M is 0.5
    • If L is between 16 and 20, M is 0.75
    • Else M is 1

This is then combined with your existing power using this formula:

  • Pn = New Profile Power
  • Pp = Previous Profile Power
  • N = Number of games played previously, capped at 5

The score value used in this calculation is an internal 4-byte integer tracked separately from the BCD representation used by the score counter. This internal value will continue increasing even after the counter maxes out, up to 4,294,967,295 before overflowing.

The line value is an internal 2-byte integer, also tracked separately from the line counter. This will overflow at 65,536 lines, though this overflow will not be displayed in the line counter.

Bugs

The line counter is capped at 999,999 lines. However, it has a bug where six-digit values will prevent the highest digit from being displayed. For example, a value of 100,000 lines will be displayed in-game as "00000".

The power value displayed on the file select screen has a similar bug, only displaying the last four digits. However, the only way to achieve a five-digit power value is by overflowing the internal lines value in a single Marathon game.

Gallery

See also

External links

This article is a Hard Drop Tetris Wiki stub.

You can help Hard Drop Tetris Wiki by expanding it.