User:Nightmareci/SRS: Difference between revisions

From TetrisWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
== True Rotations ==
[[File:SRS-true-rotations.png | thumb | The internal true rotations used in SRS; offsets are applied to these.]]
[http://i161.photobucket.com/albums/t224/nightmareci/SRS-true-rotations.png DeHackEd/Mufunyo!]
[[File:SRS-pieces.png | thumb | The default rotations for SRS. These are actually the true rotations with the first offset pairs applied.]]
== Offsets ==
'''''Super Rotation System''''', or '''''SRS''''' is the current [[Tetris Guideline]] standard for how [[tetromino|tetrominoes]] behave, in a broad sense. SRS represents where and how tetrominoes spawn, how they [[rotate]], and what [[wall kick|wall kicks]] they may perform. SRS traces its routes back to 1991 when [[BPS]] introduced its signature third and fourth [[orientation|orientations]] for the ''S'', ''Z'', and ''I'' tetrominoes in their [[Tetris 2 and Bombliss|Tetris 2+Bombliss]]. Later would come flipped-side-up spawned ''T'', ''L'', and ''J'' tetrominoes and flexible new wall kicks. Probably the most accurate SRS finds itself in BPS's latest games [[Tetris Worlds]] and [[Tetris Deluxe]], which both have identical rotation behavior.
 
== Description ==
How SRS actually works is quite complex in comparison to most other rotations systems; the following is an attempt at describing it, based on analysis of [[Tetris Worlds]].
=== Offsets ===
{| border="1" style="font-family: Monospace;"
{| border="1" style="font-family: Monospace;"
|+ I
|+ I
Line 52: Line 56:
|}
|}


== Explanation of Offsets ==
=== Explanation of Offsets ===
Upon pressing a rotation input, clockwise or counterclockwise, there is orientation-start (the orientation before the rotation input is sent) and orientation-end (the orientation that will possibly be changed to). True rotation is performed from orientation-start to orientation-end, even if intersection occurs. Next, the first offset pair is attempted; given (a, b) as the first offset for orientation-start and (c, d) as the offset for orientation-end, the number of columns the offset attempt goes rightward is a-c when a-c is positive and leftward if a-c is negative, and the number of rows upward is b-d if b-d is positive and downward if b-d is negative. If applying the first pair of offsets results in some intersection with the field or walls, then the next offset pair is tried, and so on, until an offset pair succeeds; if none succeed, then no change in state will have occurred.
Upon pressing a rotation input, clockwise or counterclockwise, there is orientation-start (the orientation before the rotation input is sent) and orientation-end (the orientation that will possibly be changed to). True rotation is performed from orientation-start to orientation-end, even if intersection occurs. Next, the first offset pair is attempted; given (a, b) as the first offset for orientation-start and (c, d) as the offset for orientation-end, the number of columns the offset attempt goes rightward is a-c when a-c is positive and leftward if a-c is negative, and the number of rows upward is b-d if b-d is positive and downward if b-d is negative. If applying the first pair of offsets results in some intersection with the field or walls, then the tetromino is reset to the true rotation before applying offsets, then the next offset pair is tried, if that fails the tetromino is reset to the true rotation, and so on, until an offset pair succeeds; if none succeed, then no change in state will have occurred.


== Examples ==
=== Examples ===
This is an example of I rotating from 0° to 90°, which is one clockwise rotation input in-game, with the true rotation center marked all the way through:
This is an example of I rotating from 0° to 90°, which is one clockwise rotation input in-game, with the true rotation center marked all the way through:
<playfield>
<playfield>
Line 97: Line 101:
</playfield>
</playfield>
End.
End.
<!--
 
This is a rather contrived example, but it shows how the offsets are tried in order until one works:
This is a rather contrived example, but it shows how the offsets are tried in order until one works:
<playfield>
<playfield>
GGGGGG
GICIIG
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GICIIG
GGGGGG
GGGGGG
GGGGGG
GGGGGG
</playfield>
</playfield>
Start.
Start.
<playfield>
<playfield>
GGIGGG
G.C..G
GGIG.G
GGIG.G
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GGIG.G
G.C..G
GGIGGG
GGIGGG
GGGGGG
GGGGGG
</playfield>
</playfield>
<tt>0° -> 90°</tt>, true rotation.
<tt>0° -> 90°</tt>, true rotation.
<playfield>
<playfield>
GGGXGG
G..C.G
GGGX.G
GGGX.G
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GGGX.G
G..C.G
GGGXGG
GGGXGG
GGGGGG
GGGGGG
</playfield>
</playfield>
<tt>(+0, +0) - (-1, +0) =&gt;</tt> Intersection, fail.
<tt>(+0, +0) - (-1, +0) =&gt;</tt> Intersection, fail.
<playfield>
<playfield>
GGIGGG
G.C..G
GGIG.G
GGIG.G
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GGIG.G
G.C..G
GGIGGG
GGIGGG
GGGGGG
GGGGGG
</playfield>
</playfield>
Undo previous offset, change back to true rotation.
Undo previous offset, change back to true rotation.
<playfield>
<playfield>
GXGGGG
GC...G
GXGG.G
GXGG.G
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GXGG.G
GC...G
GXGGGG
GXGGGG
GGGGGG
GGGGGG
</playfield>
</playfield>
<tt>(-1, +0) - (+0, +0) =&gt;</tt> Intersection, fail.
<tt>(-1, +0) - (+0, +0) =&gt;</tt> Intersection, fail.
<playfield>
<playfield>
GGIGGG
G.C..G
GGIG.G
GGIG.G
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GGIG.G
G.C..G
GGIGGG
GGIGGG
GGGGGG
GGGGGG
</playfield>
</playfield>
Undo previous offset, change back to true rotation.
Undo previous offset, change back to true rotation.
<playfield>
<playfield>
GGGGXG
G...CG
GGGGIG
GGGGIG
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GGGGIG
G...CG
GGGGXG
GGGGXG
GGGGGG
GGGGGG
</playfield>
</playfield>
<tt>(+2, +0) - (+0, +0) =&gt;</tt> Intersection, fail.
<tt>(+2, +0) - (+0, +0) =&gt;</tt> Intersection, fail.
<playfield>
<playfield>
GGIGGG
G.C..G
GGIG.G
GGIG.G
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GGIG.G
G.C..G
GGIGGG
GGIGGG
GGGGGG
GGGGGG
</playfield>
</playfield>
Undo previous offset, change back to true rotation.
Undo previous offset, change back to true rotation.
<playfield>
<playfield>
GGGGGG
GGGG.G
GGGG.G
GGGG.G
GI...G
GI...G
GCGG.G
GCGGGG
GXGG.G
GXGGGG
GXGG.G
GXGGGG
GGGG.G
GGGGGG
</playfield>
</playfield>
<tt>(-1, +0) - (+0, +1) =&gt;</tt> Intersection, fail; the true rotation center is intersecting, too.
<tt>(-1, +0) - (+0, +1) =&gt;</tt> Intersection, fail; the true rotation center is intersecting, too.
<playfield>
<playfield>
GGIGGG
G.C..G
GGIG.G
GGIG.G
GGGG.G
GGGG.G
GGGG.G
GGGG.G
GGIG.G
G.C..G
GGIGGG
GGIGGG
GGGGGG
GGGGGG
</playfield>
</playfield>
Undo previous offset, change back to true rotation.
Undo previous offset, change back to true rotation.
<playfield>
<playfield>
GGIGGG
GGGGIG
G.C..G
GGGGCG
GGIG.G
GGGGIG
GGIG.G
G...IG
GGGG.G
GGGGGG
GGGG.G
GGGGGG
GGGGGG
</playfield>
<tt>(+2, +0) - (+0, -2) =&gt;</tt> Success.
<playfield>
GGGGIG
GGGGCG
GGGGIG
G...IG
GGGGGG
GGGGGG
GGGGGG
GGGGGG
</playfield>
</playfield>
<tt>(+2, +0) - (+0, +0) =&gt;</tt> Success.
End.
-->

Latest revision as of 00:02, 5 July 2009

The internal true rotations used in SRS; offsets are applied to these.
The default rotations for SRS. These are actually the true rotations with the first offset pairs applied.

Super Rotation System, or SRS is the current Tetris Guideline standard for how tetrominoes behave, in a broad sense. SRS represents where and how tetrominoes spawn, how they rotate, and what wall kicks they may perform. SRS traces its routes back to 1991 when BPS introduced its signature third and fourth orientations for the S, Z, and I tetrominoes in their Tetris 2+Bombliss. Later would come flipped-side-up spawned T, L, and J tetrominoes and flexible new wall kicks. Probably the most accurate SRS finds itself in BPS's latest games Tetris Worlds and Tetris Deluxe, which both have identical rotation behavior.

Description

How SRS actually works is quite complex in comparison to most other rotations systems; the following is an attempt at describing it, based on analysis of Tetris Worlds.

Offsets

I
(+0, +0) (-1, +0) (+2, +0) (-1, +0) (+2, +0)
90° (-1, +0) (+0, +0) (+0, +0) (+0, +1) (+0, -2)
180° (-1, +1) (+1, +1) (-2, +1) (+1, +0) (-2, +0)
270° (+0, +1) (+0, +1) (+0, +1) (+0, -1) (+0, +2)


J, L, S, T and Z
(+0, +0) (+0, +0) (+0, +0) (+0, +0) (+0, +0)
90° (+0, +0) (+1, +0) (+1, -1) (+0, +2) (+1, +2)
180° (+0, +0) (+0, +0) (+0, +0) (+0, +0) (+0, +0)
270° (+0, +0) (-1, +0) (-1, -1) (+0, +2) (-1, +2)


O
(+0, +0)
90° (+0, -1)
180° (-1, -1)
270° (-1, +0)

Explanation of Offsets

Upon pressing a rotation input, clockwise or counterclockwise, there is orientation-start (the orientation before the rotation input is sent) and orientation-end (the orientation that will possibly be changed to). True rotation is performed from orientation-start to orientation-end, even if intersection occurs. Next, the first offset pair is attempted; given (a, b) as the first offset for orientation-start and (c, d) as the offset for orientation-end, the number of columns the offset attempt goes rightward is a-c when a-c is positive and leftward if a-c is negative, and the number of rows upward is b-d if b-d is positive and downward if b-d is negative. If applying the first pair of offsets results in some intersection with the field or walls, then the tetromino is reset to the true rotation before applying offsets, then the next offset pair is tried, if that fails the tetromino is reset to the true rotation, and so on, until an offset pair succeeds; if none succeed, then no change in state will have occurred.

Examples

This is an example of I rotating from 0° to 90°, which is one clockwise rotation input in-game, with the true rotation center marked all the way through:

.....
.....
.ICII
.....
.....

Start.

.....
..I..
..C..
..I..
..I..

0° -> 90°, true rotation.

.....
...I.
...C.
...I.
...I.
    Subtract
  |----------|----------|
  v          v          v
(+0, +0) - (-1, +0) => +1 horizontal offset, +0 vertical offset. Success.
      ^          ^                            ^
      |----------|----------------------------|
        Subtract
.....
...I.
...C.
...I.
...I.

End.

This is a rather contrived example, but it shows how the offsets are tried in order until one works:

GGGG.G
GGGG.G
GGGG.G
GICIIG
GGGGGG
GGGGGG
GGGGGG

Start.

GGGG.G
GGGG.G
GGIG.G
G.C..G
GGIGGG
GGIGGG
GGGGGG

0° -> 90°, true rotation.

GGGG.G
GGGG.G
GGGX.G
G..C.G
GGGXGG
GGGXGG
GGGGGG

(+0, +0) - (-1, +0) => Intersection, fail.

GGGG.G
GGGG.G
GGIG.G
G.C..G
GGIGGG
GGIGGG
GGGGGG

Undo previous offset, change back to true rotation.

GGGG.G
GGGG.G
GXGG.G
GC...G
GXGGGG
GXGGGG
GGGGGG

(-1, +0) - (+0, +0) => Intersection, fail.

GGGG.G
GGGG.G
GGIG.G
G.C..G
GGIGGG
GGIGGG
GGGGGG

Undo previous offset, change back to true rotation.

GGGG.G
GGGG.G
GGGGIG
G...CG
GGGGXG
GGGGXG
GGGGGG

(+2, +0) - (+0, +0) => Intersection, fail.

GGGG.G
GGGG.G
GGIG.G
G.C..G
GGIGGG
GGIGGG
GGGGGG

Undo previous offset, change back to true rotation.

GGGG.G
GGGG.G
GGGG.G
GI...G
GCGGGG
GXGGGG
GXGGGG

(-1, +0) - (+0, +1) => Intersection, fail; the true rotation center is intersecting, too.

GGGG.G
GGGG.G
GGIG.G
G.C..G
GGIGGG
GGIGGG
GGGGGG

Undo previous offset, change back to true rotation.

GGGGIG
GGGGCG
GGGGIG
G...IG
GGGGGG
GGGGGG
GGGGGG

(+2, +0) - (+0, -2) => Success.

GGGGIG
GGGGCG
GGGGIG
G...IG
GGGGGG
GGGGGG
GGGGGG

End.