PSP Tetris Engine

Thread in 'Discussion' started by Ferrero, 22 Aug 2007.

  1. Ferrero

    Ferrero Unregistered

    Hello everybody,


    I'm writing a Tetris Engine for the PSP and TetrisConcept is really a good knowledge base.


    For the fisrt mode of this Engine, I'm trying to replicate the TGM1, but there is something I'don't understand about the scoring.


    In the wiki I've found this about TGM1 :


    So by this formula you only score point when at least a line is cleared, am I correct ?
    And the second point I don't understand is about Combo : Combo = Combo - 1 + (2 x Lines - 1)

    What the initial value of combo in this formula ?
    The wiki says "You receive a combo bonus for clearing lines with consecutive pieces." but I can't see that in this formula.

    Another thing that touble me, is the leveling.

    On the wiki I see this :
    [/quote]


    So between 0 and 199 I've made this formula to compute the gravity :


    Gravity : (138/199) * Level + 4, I store the gravity like in TGM 2 (It's 256/Gravity frames per rows).

    This function is linear, is it correct to do a linear interpolation ?


    Thanks for your great Job
     
  2. From wiki:
    * Combo returns to 1 by default every time a piece does not clear lines.

    So the initial value is 1.


    Say you clear 2 lines.

    The combo is 1 - 1 + (2 x 2 - 1) = 3 (Or 2 if you don't follow mathematics convention. I'm not sure which)


    That means if you clear lines with the consecutive piece, the score for those cleared lines will be multiplied by 3 (or 2). It'll also increase the combo further.
     
  3. Ferrero

    Ferrero Unregistered

    Thanks a lot, I've understand the combo now.


    But about the leveling, is it correct to do a linear interpolation between each limit (0->199, 200->299, ...) ?
     
  4. Yes you only score points with lines. As for how combos work, you need to re-read this particular line:


    "Combo returns to 1 by default every time a piece does not clear lines."


    So if you score a double, then use the combo formula:


    Combo = Combo - 1 + (2 x Lines - 1)

    Combo = 1 - 1 + (2 x 2 - 1)

    Combo = 3


    And for the next piece, the combo value is 3 instead of 1.



    As for your question about gravity, linear interpolation would be incorrect. This is how it works in TAP, I think it's the same in TGM1:


    Code:
    G-Speed for Level 000: 1/64.0 (dw: 0x400)
    ...
    G-Speed for Level 029: 1/64.0 (dw: 0x400)
    G-Speed for Level 030: 1/42.7 (dw: 0x600)
    ...
    G-Speed for Level 034: 1/42.7 (dw: 0x600)
    G-Speed for Level 035: 1/32.0 (dw: 0x800)
    ...
    G-Speed for Level 039: 1/32.0 (dw: 0x800)
    G-Speed for Level 040: 1/25.6 (dw: 0xA00)
    ...
    G-Speed for Level 049: 1/25.6 (dw: 0xA00)
    G-Speed for Level 050: 1/21.3 (dw: 0xC00)
    ...
    G-Speed for Level 059: 1/21.3 (dw: 0xC00)
    G-Speed for Level 060: 1/16.0 (dw: 0x1000)
    ...
    G-Speed for Level 069: 1/16.0 (dw: 0x1000)
    G-Speed for Level 070: 1/8.0 (dw: 0x2000)
    ...
    G-Speed for Level 079: 1/8.0 (dw: 0x2000)
    G-Speed for Level 080: 1/5.3 (dw: 0x3000)
    ...
    G-Speed for Level 089: 1/5.3 (dw: 0x3000)
    G-Speed for Level 090: 1/4.0 (dw: 0x4000)
    ...
    G-Speed for Level 099: 1/4.0 (dw: 0x4000)
    G-Speed for Level 100: 1/3.2 (dw: 0x5000)
    ...
    G-Speed for Level 119: 1/3.2 (dw: 0x5000)
    G-Speed for Level 120: 1/2.7 (dw: 0x6000)
    ...
    G-Speed for Level 139: 1/2.7 (dw: 0x6000)
    G-Speed for Level 140: 1/2.3 (dw: 0x7000)
    ...
    G-Speed for Level 159: 1/2.3 (dw: 0x7000)
    G-Speed for Level 160: 1/2.0 (dw: 0x8000)
    ...
    G-Speed for Level 169: 1/2.0 (dw: 0x8000)
    G-Speed for Level 170: 1/1.8 (dw: 0x9000)
    ...
    G-Speed for Level 199: 1/1.8 (dw: 0x9000)
    G-Speed for Level 200: 1/64.0 (dw: 0x400)
    ...
    G-Speed for Level 219: 1/64.0 (dw: 0x400)
    G-Speed for Level 220: 1/8.0 (dw: 0x2000)
    ...
    G-Speed for Level 229: 1/8.0 (dw: 0x2000)
    G-Speed for Level 230: 1/4.0 (dw: 0x4000)
    ...
    G-Speed for Level 232: 1/4.0 (dw: 0x4000)
    G-Speed for Level 233: 1/2.7 (dw: 0x6000)
    ...
    G-Speed for Level 235: 1/2.7 (dw: 0x6000)
    G-Speed for Level 236: 1/2.0 (dw: 0x8000)
    ...
    G-Speed for Level 238: 1/2.0 (dw: 0x8000)
    G-Speed for Level 239: 1/1.6 (dw: 0xA000)
    ...
    G-Speed for Level 242: 1/1.6 (dw: 0xA000)
    G-Speed for Level 243: 1/1.3 (dw: 0xC000)
    ...
    G-Speed for Level 246: 1/1.3 (dw: 0xC000)
    G-Speed for Level 247: 1/1.1 (dw: 0xE000)
    ...
    G-Speed for Level 250: 1/1.1 (dw: 0xE000)
    G-Speed for Level 251: 1.0 (dw: 0x10000)
    ...
    G-Speed for Level 299: 1.0 (dw: 0x10000)
    G-Speed for Level 300: 2.0 (dw: 0x20000)
    ...
    G-Speed for Level 329: 2.0 (dw: 0x20000)
    G-Speed for Level 330: 3.0 (dw: 0x30000)
    ...
    G-Speed for Level 359: 3.0 (dw: 0x30000)
    G-Speed for Level 360: 4.0 (dw: 0x40000)
    ...
    G-Speed for Level 399: 4.0 (dw: 0x40000)
    G-Speed for Level 400: 5.0 (dw: 0x50000)
    ...
    G-Speed for Level 419: 5.0 (dw: 0x50000)
    G-Speed for Level 420: 4.0 (dw: 0x40000)
    ...
    G-Speed for Level 449: 4.0 (dw: 0x40000)
    G-Speed for Level 450: 3.0 (dw: 0x30000)
    ...
    G-Speed for Level 499: 3.0 (dw: 0x30000)
    
    There's a reason it's not completely written out in the wiki. Blech.


    EDIT: lol Rosti did the exact same example
     
  5. Ferrero

    Ferrero Unregistered

    Thanks a lot color_thief (your gravity table is not the same as the one on the Wiki page for TAP), but I've applied the gravity table you said.


    I've another question,

    During the a Line Clear, can the player move the Next Piece like in A.R.E (so in the case, the A.R.E time is expended by 40 frames) or is it just a "wait time"


    PS : I've taken the Line Clear Delay of TAP for TGM1 Game Mode
     
  6. tepples

    tepples Lockjaw developer

    The player cannot move the tetromino during ARE. (Lumines has a separate "fall delay" phase between ARE and gravity phases in which the player can move and freely rotate the tetromino, which TGM does not.) But the player can charge DAS during ARE and line clear, and holding down a rotation or hold button will apply the rotation or hold (but not DAS) on the tetromino's first active frame.
     
  7. I think that's all he means, tepples. And yes, line clears essentially increase ARE time. So IRS will work as well.
     
  8. tepples

    tepples Lockjaw developer

    In the formula ((Level + Lines)/4 + Drop) x Lines x Combo x Bravo, does Level refer to the level displayed while the piece was falling, 1 more, Lines more, or Lines + 1 more?
     
  9. Displayed level...
     
  10. K

    K

Share This Page