recursive blocking --> gravity failing...

Thread in 'Discussion' started by herc, 6 Feb 2007.

  1. while playing fuse-tetris, i just found a BAD thing: a recursivly blocking situatation that effectively kills my gravity algorithm. wow. this one is frustrating. as i have no idea how to solve this.


    [​IMG]

    normally, the blue piece "B" could just fall down one unit. but because i check if it really can slide down by checking the whole playfield for obstacles, it cannot. reason is because of the red piece R that - works as an obstacle.


    R by itself COULD fall, if bevore B would have been fallen one unit.


    --> endlessly recursive blocking. deadlock. argh.

    (luckily, my algo just continues. but still - i have got "hanging in the sky" blocks. dislike that.)
     
  2. tepples

    tepples Lockjaw developer

    R is holding up B, but B is holding up R. I think the algorithm used in LJ solves this.


    First flood-fill each connected region with a unique RegionID number. Each frame, do this:
    1. Flood-fill those regions that have landed (that is, anywhere there is a not-landed block on row 1 or a not-landed block above a landed block) with a special RegionID that means landed.
    2. Move all blocks down that are not in a landed region.
    The red region below regions R and B would be given separate RegionIDs.


    Extending this to the typical Lumines-like situation where the falling piece and gravity can interact with the playfield at the same time is an exercise for the reader.
     
  3. @tepples: thanks! the problem is, that currently i'm handling each piece as an object and i am using the playfield as a lookup table/cache for fast floodfill only. but i think that method with the "floor-connected"/landed region will help me out. finally that may remove these strange rare situations i encountered in my clone where tiles kept hanging in the sky..


    as i never played lumines, that sentence

    "where the falling piece and gravity can interact with the playfield at the same time" makes no sense to me. is there a youtube video or may you please explain? sounds interesting!
     
  4. tepples

    tepples Lockjaw developer

    Lumines was the first Puyo-style game I played that allowed the player to drop falling pieces on top of a chain reaction in progress to extend it. (Klax and Tetris Attack were similar, but they didn't have Tetris-style controls.) In Lumines, chain reactions happen very slowly (one step per two measures of music, or about one every four seconds), and once the game gets fast, the player is expected to build on existing chains to increase the combo meter. You can download Luminesweeper and play game left to see what I mean.
     

Share This Page