A model of DTET double rotations

Thread in 'Discussion' started by ryanheise, 7 Mar 2009.

  1. ryanheise

    ryanheise Unregistered

    While trying to implement DRS in the tessellate engine, I began to notice some edge cases that were not documented in the wiki. After discussing this with Zaphod and Zircean, Zircean has given us some new observations. For example, the special technique to perform an instantaneous 180 rotation by pressing and holding A then pressing B (where A hasn't enough room to rotate) only works once, and all keys must be released before it will work again. Another observation is that after pressing and holding A (where A hasn't enough room to rotate) and then shifting the piece sideways, DTET will try to still execute the A rotation as soon as the tetromino has moved into a space where it can execute the rotatation.

    These edge cases seem to complicate things, but I have found what I think is quite a simple model that seems to match observations, and I'd like to run it by the community.

    STATES

    There are two rotation buttons. "A" rotates left, and "B" rotates right.

    We can identify three states for each rotation button and transitions between these states:

    [​IMG]

    If any rotation happens, this will cause "all" rotation buttons that are currently in the "pressed and waiting" state to move into the "pressed and processed" state.

    ALGORITHM

    For each frame:

    Case 1: A is pressed and waiting, and B is released (Or B & A resp.)
    - then attempt to rotate left with left kick bias

    Case 2: A is pressed and waiting, and B is pressed and processed (Or B & A resp.)
    - then attempt to rotate right with left kick bias

    Case 3: A and B are both pressed and waiting
    - then attempt to double rotate with left kick bias

    My implementation of this model can be tested here.

    Edit: IRS uses the same rotation as above, so wall kicks apply, and the same key states are used.
     
  2. Interesting, the doublerotate has a left kick bias. I wonder if Heboris models that correctly.
     
  3. It probably does, the fact that the simultaneous 180 is treated as counterclockwise has been known for some time.

    To test the failure compensation, try this:
    Code:
    |     |
    |  LLL |
    |  LXX |
    |  XX |
    |----------|
    
    Hold A, and move the L off the perch. The counterclockwise rotation will at first fail, but as soon as it is clear to rotate it will.
     
  4. In DTET, IRS is actually an extension of the failure compensation rule (i.e., it rotates the piece as soon as possible, which is the first frame it is spawned). The most interesting consequences of this are that you can have a piece wallkick off floor structure in 20G. Try this:
    Code:
    |     |
    | zz  |
    | Xzz  |
    | XXXX  |
    |----------|
    
    where the little z's are where a Z piece would line up. Now IRS with A. It will rotate to its left state, hit the block, and kick left, jumping it completely:
    Code:
    | Z   |
    | ZZ   |
    | ZX   |
    | XXXX  |
    |----------|
    
    This proves that instead of applying IRS at the spawn, it applies it on the piece's first active frame.
     
  5. ryanheise

    ryanheise Unregistered

    After jumping onto DTET, I noticed one more interesting thing. IRS seems not to carry over to the next piece unless you repress the keys during ARE.

    At first I thought this was a special case, but on further inspection, it is actually due to IRS using the normal rotation algorithm (unlike TGM), which means that wall kicks apply during IRS.

    Here are some consequences:

    1. If you press and hold A then B, and it does the double rotation, then no double rotation will happen at the next IRS..
    2. If you press and hold A then B, and it fails to do the double rotation, then this double rotation will be postponed until the next IRS.
     
  6. Wow, that's some strange behavior. I would have thought treating ARE like TGM does would be essential to getting 20G to be playable.
     
  7. 20G in DTET is still playable. It's actually quite a bit more lenient than TGM and eliminates the need for triple rotates and other complicated moves most of the time because of the lax wallkick rules.
     

Share This Page