Difference between revisions of "User:Nightmareci"

From TetrisWiki
Jump to navigation Jump to search
Line 39: Line 39:
|bgcolor="#C4E8E8"|200||4||bgcolor="#C4E8E8"|500||5120 (20G)
|bgcolor="#C4E8E8"|200||4||bgcolor="#C4E8E8"|500||5120 (20G)
|}
|}
In the following, Gcount is the current Gravity Count; Gspeed is the Gravity Speed, and is equal to one of the Internal Gravity entries in the above table. All values can be represented with unsigned integers, as no negative values ever appear. All division has the fractional part truncated, as in ISO C (60/256 = 0, 252/256 = 0, 260/256 = 1).
This is also based on a timings table in [[Tetris The Grand Master]], but is modified to better fit observations I've made:
{| border="2" cellpadding="2" cellspacing="0" style="margin-top:1em; margin-bottom:1em; background:#f9f9f9; border:3px #999999 solid; border-collapse:collapse;"
|+'''Delays'''
! |Level
! |[[DAS]]<br>(frames)
! |[[Lock delay|Lock]]<br>(frames)
! |Lock flash<br>(frames)
! |[[Line clear]]<br>(frames)
! |[[ARE]]<br>(frames)
|- align = center
| |000 - 999 || |14 || |30 || |4 || |41 || |27
|}
The different ordering is chosen such that it somewhat represents the order in which each delay happens, left being first, right being last, although DAS charging can occur during ARE.


On the first frame of piece display, a soft drop input is simply ignored, so, for example, some variable representing whether soft drop "is pressed" or "not pressed" would be set to "not pressed" on the first frame. The second frame and later can have a soft drop input set, for example, as "is pressed"; this processing of input occurs outside this description.
In the following, "gravity_count" is the current Gravity Count; "gravity" is the current Gravity Speed, and is equal to one of the Internal Gravity entries in the above table; das_counter is the current count of DAS charge frames. A % is used to represent a "remainder of division" operator (commonly known as "modulo", i.e. 13 % 5 = 3). All division has the fractional part truncated, as in ISO C (60/256 == 0, 252/256 == 0, 260/256 == 1).
 
On the first frame of piece display, all inputs are ignored, and read as "not pressed", even if in reality input is being sent on that frame.
 
At the start of a game, there is a single "READY, GO" sequence; it is a special case, in this description:
# Begin "READY, GO" sequence:
#* 170 frames of uninteractive display until the first pieces' first frame TODO: Expand this after more observations (how long "READY" displays, etc.)
 
After the "READY, GO" sequence, every frame the following is processed from top to bottom, until the game ends:
# Interactive gameplay (piece is in field and in control):
#* If this is the first frame of this piece:
#** If a rotation input is read:
#*** TGM Rotation
#* Else:
#** If left/right shift is read this frame:
#*** If das_counter == 0 or das_counter > 14:
#**** Shift left/right 1 column
#*** Else if das_counter <= 14:
#***** Increment das_counter by 1
#** Else:
#*** das_counter = 0
 
 
# Uninteractive delays (lock flash, line clear, ARE):
#* TODO: Fill this up (have enough data currently, just sort it out)
 
 
Ignore the following (it'll be shoved into the above sooner or later):
# Preparation for the pieces' first displayed frame (such as during ARE):
# Preparation for the pieces' first displayed frame (such as during ARE):
#* If Gspeed > 256:
#* If Gspeed > 256:

Revision as of 06:50, 21 February 2009

Definitions

In this page, the very top row is row number 0, the row below the top row is row number 1, and so on, until 20 (TGM1 has 20 visible rows + 1 vanish zone row).

Tetris The Grand Master

Some of the following information may not be consistent with other wiki pages; where this applies, simply ignore the information elsewhere in the wiki. Corrections to this information by others are only accepted if supported by examples. Information here is still work in progress.

Gravity

Directly from Tetris The Grand Master, here is the gravity curve:

Internal Gravity[1]
Level Interal Gravity
(1/256 G)
Level Internal Gravity
(1/256 G)
0 4 220 32
30 6 230 64
35 8 233 96
40 10 236 128
50 12 239 160
60 16 243 192
70 32 247 224
80 48 251 256 (1G)
90 64 300 512 (2G)
100 80 330 768 (3G)
120 96 360 1024 (4G)
140 112 400 1280 (5G)
160 128 420 1024 (4G)
170 144 450 768 (3G)
200 4 500 5120 (20G)

This is also based on a timings table in Tetris The Grand Master, but is modified to better fit observations I've made:

Delays
Level DAS
(frames)
Lock
(frames)
Lock flash
(frames)
Line clear
(frames)
ARE
(frames)
000 - 999 14 30 4 41 27

The different ordering is chosen such that it somewhat represents the order in which each delay happens, left being first, right being last, although DAS charging can occur during ARE.

In the following, "gravity_count" is the current Gravity Count; "gravity" is the current Gravity Speed, and is equal to one of the Internal Gravity entries in the above table; das_counter is the current count of DAS charge frames. A % is used to represent a "remainder of division" operator (commonly known as "modulo", i.e. 13 % 5 = 3). All division has the fractional part truncated, as in ISO C (60/256 == 0, 252/256 == 0, 260/256 == 1).

On the first frame of piece display, all inputs are ignored, and read as "not pressed", even if in reality input is being sent on that frame.

At the start of a game, there is a single "READY, GO" sequence; it is a special case, in this description:

  1. Begin "READY, GO" sequence:
    • 170 frames of uninteractive display until the first pieces' first frame TODO: Expand this after more observations (how long "READY" displays, etc.)

After the "READY, GO" sequence, every frame the following is processed from top to bottom, until the game ends:

  1. Interactive gameplay (piece is in field and in control):
    • If this is the first frame of this piece:
      • If a rotation input is read:
        • TGM Rotation
    • Else:
      • If left/right shift is read this frame:
        • If das_counter == 0 or das_counter > 14:
          • Shift left/right 1 column
        • Else if das_counter <= 14:
            • Increment das_counter by 1
      • Else:
        • das_counter = 0


  1. Uninteractive delays (lock flash, line clear, ARE):
    • TODO: Fill this up (have enough data currently, just sort it out)


Ignore the following (it'll be shoved into the above sooner or later):

  1. Preparation for the pieces' first displayed frame (such as during ARE):
    • If Gspeed > 256:
      • Gcount = Gspeed % 256
    • Else:
      • Gcount = 0
    • Gspeed is set to the appropriate value for the current level
    • Attempt to place the piece in row number 1 + Gspeed / 256, higher if necessary
  2. Every frame this piece is displayed:
    • If soft drop is pressed:
      • If Gspeed < 256:
        • Attempt to drop one line
      • If the piece has blocks beneath it now:
        • Lock the piece
      • Go to 3.
    • If there are blocks below this piece:
      • Set Gcount to Gspeed
    • If Gcount is greater than or equal to 256:
      • Attempt to drop Gcount / 256 lines
      • Gcount %= 256
    • Increase Gcount by Gspeed
    • Go to 3.
  3. Further processing after gravity (processing will come back to 2. if the piece hasn't locked)

In the above, the first If...Else sequence may appear curious, as all Internal Gravity values in the TGM series are either <256 or an even multiple of 256, but it's purpose is to properly support gravity speeds such as 4.5G; none of the TGM games have gravity like this, but this makes this description more general. If your implementation is only conforming to actual TGM gravity, the sequence can be replaced with "Gcount = 0".