User:Nightmareci

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: This is also based on a timings table in Tetris The Grand Master, but is modified to better fit observations I've made: 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).

When I say uninteractive, I mean that any input the player sends results in no observable behavioral changes with the game. ARE is technically an interactive period of the game, as you can charge DAS. IRS is not processed in ARE, but on the very first frame of piece display.

TGM1 only accepts 1 rotation input per frame; if multiple rotation inputs are pressed down on the same frame, then no rotation input is registered. The only way to send a rotation input with no empty frames between inputs is to alternate between separate rotation buttons, be it A/B or A/C.

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:
 * 2) * 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) If this is in-field play:


 * 1) If this is the first frame of this piece:
 * 2) If a single rotation input is pressed down this frame:
 * 3) Basic Rotation (Sega Rotation, essentially)
 * 4) If the piece is not intersecting the stack rotated:
 * 5) Play IRS sound
 * 6) Else:
 * 7) Switch back to initial spawn orientation
 * 8) Place the piece in row number 1
 * 9) If the piece is not intersecting the stack:
 * 10) While the piece is in a row number < (gravity % 256 + 1):
 * 11) If placing the piece 1 row down would cause stack intersection:
 * 12) Break out of this loop
 * 13) Else:
 * 14) Place the piece in the next row
 * 15) Else:
 * 16) Game over


 * 1) Else:


 * 1) If a single rotation input is pressed down this frame:
 * 2) TGM Rotation


 * 1) If left/right shift is read and matches last frame's or last frame was no left/right:
 * 2) If das_counter == 0 or das_counter == 14 + 1:
 * 3) Shift left/right 1 column
 * 4) If das_counter <= 14:
 * 5) Increment das_counter by 1
 * 6) Else:
 * 7) das_counter = 0


 * 1) Else:


 * 1) ARE TODO: Fill this out, sufficient data right now


 * 1) Render frame

VERY BIG TODO: Create a ton of examples showing specific points of behavior, i.e. interaction of gravity/soft drop.