Perfect Clear Study - Phase 1

Started by Shuey, December 15, 2011, 01:33:16 PM

Previous topic - Next topic

Shuey

Ever since seeing players build perfect clears, and seemingly with such ease, I've been fascinated with it.  Since my strongest Tetris attribute is "pattern building", and since building perfect clears is essentially a 4x10 pattern, it wasn't long before I HAD to dedicate time to studying this skill in more detail.

When I first attempted to build a standard 4x10 perfect clear from a clean matrix, I was amazed at how difficult it was.  I've cleared the playing field many times, but rarely when purposely setting out to build a 4x10 perfect clear from a clean matrix.  I spent some time looking around in the forums and found some posts that talked about common methods and patterns to look for, and I also spent time watching videos of people building them on YouTube (this is something I'd actually like to add to this post soon)

Just before to diving into this study, I had discovered the "playing forever" pattern a few weeks prior.  The playing forever pattern was such a surprise to me because I never knew that the pieces spawned in a way that was a lot less random than most people are aware of.  Knowing this led me to wonder if something similar could be discovered with regards to building perfect clears.

In order to start this study, I needed data.  Since, at the time, I had just completed a game where I built two back-to-back playing forever patterns, I collected my piece sequences from there.  I wanted to use a sequence that I knew had been used in an actual guideline game.

After a couple weeks or so of collecting and organizing the data, and with the help of several great people in the community, I am ready to "publish" part 1 of the study.  I welcome anyone who is interested to please take the time to check it out, and post comments/feedback here.  I'm hoping that this will be the beginning of something great!

Tetris Perfect Clear Study - Phase 1

*update 01 - 2011-12-16*
I updated the documentation with some info from Kitaru about the origins of perfect clears and which games rewarded players for completing them.  Kitaru also said something that I hope will get other people excited as well:  "I'm just starting to read your write-up, but I got to say this is probably one of the more important studies on Tetris in modern times, and I'm really excited to see if we can devise a way to 'solve' Tetris other than Playing Forever".

Paul676

#1
Another interesting thing would be to ask whether PCs can be done infinitely without any twists, spins or slides given bag+10 previews+hold. Likewise without hold. Where does it break down and why?

Also, there's something about the imbalancing effect of zs and ss which necessitate Ls, Js or Ts to fix them to make a PC in 4 lines. I don't know exactly what mathematically does it, but it's something to do with the fact that they can't stack to form any shape which doesn't have a base where on one side, it is 1 block higher than the other, and the same goes for the top of that stack. Call it right and left if you stack the pieces horizontally.
               Tetris Belts!

Barneey

Hey Shuey, I like what you're doing, it looks very interesting!
Let me know if there is anything I can do to help, I have too much spare time.

Shuey

Something I forgot to mention previously, but I have since included it in the Preface:  One of the most amazing things about this study is that we collectively completed 60+ perfect clears in a row using genuine piece sequences!  The most I had seen prior to this was 20 by Noogy.  Another amazing thing about this accomplishment is that we did it without using any 180 degree rotations.

It'll be awhile before I post the start of Phase 2, but I'm very anxious to keep pursuing this study!  And I'm especially excited to have as many people as possible all participating

Shuey

I had a chat this morning with Kitaru and I'm hoping that our conversation will help spawn more interest in this topic.  I'd be lying if I said I'm not a little bummed out that barely anyone has replied yet .  Below are all of Kitaru's initial thoughts, and my responses:

Kitaru:
I wonder if there is a nice way we can crowd source some of the work once we have a better idea about parts of it?  Like a website where people can get assigned patterns and then input answers, and get points for finding solutions.  Especially if the solutions improve upon an old one -- no hold solutions, no kick solutions, etc.  Store all that stuff in a db and who knows... I think having a website to store a lot of this stuff would be big and then we need to think a bit about how to consolidate piece sequence info so we can minimize repeated effort.  Like, where are we coming into this sequence from, has this PC been charted already?  But yeah if it's just a game you play and you get credit for your unique PCs that'd be super fun.  I think it'd be cool if there were a leaderboard and you'd get points for different things.  Like, if previously there was a SRS twist only or 180 only or something solution and you improve upon it with a general one, you'd get more points than the restrictive solution.  Solutions that require splits or trickiness might also be worth more for the leaderboards.  Some day down the line I think it'd be sick if we had enough info to make an AI/screensaver that literally can play forever.  Especially if we're clever enough to convert all of these into 20G-able solutions.  I think the nice thing about PCs is it has a lot of vertical partitions.  We might be able to figure out some property of moving these partitions about to double up solutions.  Solutions that are valid for all partitions of the stack (i.e. don't require a left or right wall to execute) would probably be pretty valuable.

Shuey:
What would be the best way to go about having a website?  To make it easy for users to contribute... and who and/or how should we manage it?  Also, I like what you're saying there - this also makes me think that, if we see repeated patterns, saving info about that could also be helpful initially - also, with the "credit" concept for players, what could they use their credits for?  There would need to be incentive.  There's so much potential with this study, and I think one of my ultimate dream goals would be that we could eventually discover some kind of consistent, workable pattern, in the same way that someone discovered it with "playing forever".  It's doubtful though that it exists, but if we can at least get to a point where we can recognize what to look for, I think players could have a very high success rate of building PCs, which could also lead to a "who can build the most back-to-back PCs?"  The first challenge could be one where there's low gravity and pauses for thinking time (that's how Noogy did his 20 b2b pc's).  Then eventually we could have a challenge where a player would have to try building as many b2b pc's as they could in a standard TF marathon game.  Regarding an AI, that is one of the goals of this project!  I was looking at Ryan Heise's study on "stacking" and I believe it will be possible for us to build an AI that analyzes pieces and builds PC's infinitely.  This could also be used in the same way that Ryan used his AI: for humans to learn from it!  And yeah, I'd like to get to the point where we can build PCs with more ingenuity where "awkward" placements aren't necessary in order to complete PCs.

Paul676

#5
Should this be an inductive study rather than a deductive one? Because PCs are in effect mathematical entities, I'd think we should look at them deductively to see what is possible, rather than inductively.

e.g. why can't you PC with only S pieces. Why not with only S pieces and Z pieces? Why not with all S and Z pieces, and only one other piece? Why not with any number of S pieces and Z pieces and all O pieces? Then we might be able to obtain a proof of certain possibilities of PCs. If we do it inductively it might take a lot of time to sort out.

e.g. this seems to be the minimum number of other pieces than S and Z to use. [fumen]110@7eK0XI0gB0hB0iB9jBXeBXdBXcBXbBOfBAAA[/fumen]

Using this, we might be able to find a pattern to solve tetris with all PCs given certain conditions, or at least know it's possible.
               Tetris Belts!

Anonymous

My awesome downstacking guide, last updated (Jan 29, 2013): Downstacker's Guide to the Galaxy
Tired of the same old Tetris games? Read my idea for a revamped Tetris game! The Next

Shuey

Paul: Yes, one of the main intentions of this study is to dive into the mathematics of Tetris and use code to analyze all the data.  We're going to find out a lot more by using computers to solve problems and give us more clues to things our mortal minds can't yet see.

I'm hoping to get Pineapple involved because I know this is exactly the kind of thing she likes most about Tetris.

Ravendarksky

Don't stop posting fumens for me to try and solve just because computers can do it faster

Shuey

Hehe, I tell ya what: I think we still have a lot of "alternate" solutions we could come up with from our current data set.  If you decide to come up with more non-180 rotation solutions, please don't hesitate to do so and to reply back so I can add the info into Phase 1's data set .  I was having fun building them too .

Ravendarksky

I'll do it myself then in a new thread =D

myndzi

#11
Quote from: Shuey
The most I had seen prior to this was 20 by Noogy.
Replay of 51 in a row by Question_Mark
This thread also has some good information.

If we say every perfect clear takes 4 lines, that's 10 pieces, but bags come in 7 pieces. 10 and 7 are relatively prime, so after 70 pieces (10 perfect clears) you will have a "new" bag from scratch. (Well, one of the pieces will have been used or be in hold).

Each bag loses three pieces, so your starting bags will be: 7, 4, 1, 5, 2, 6, 3, 7...
If you get a 2-line PC in there, you can shorten the cycle to five perfect clears - but this requires very specific pieces, so I don't think you can count on 5 PCs for an infinite cycle. (Though dealing with it wouldn't be a problem, since it can't give you any bag combination you couldn't already get).

Since it's obvious that this limit CAN be passed, the question you really need to answer is: is there any sequence of pieces that is a valid bag sequence but can NOT be made into a perfect clear?

In response to Paul's comment earlier, the reason S and Z unbalance things is because they force a 1-unit shift between rows/columns. It takes more pieces to make a 4-high block including a Z or an S than any other piece. t is included too, but since T is not balanced, it works better as a "fixer" piece; Z and S have the property that they are balanced AND offset.

Edit: in that vein, let's see somebody solve this one:
  • iosz zsoitj

    brackets are hold, osz is end of current bag, zsot is beginning of next bag. Also, if you can solve it with any other piece in hold, then it's not a solid counterexample; anyone else who feels like proposing fixes to the sequence is welcome

    Edit2: I realized that everybody's been assuming "optimal" perfect clears, but it may be possible to exploit the bag randomizer by stacking *taller* perfect clears. Not as impressive by a long shot, but I kind of doubt that every sequence is solvable. Easiest way to find out is to find an unsolvable sequence

Ravendarksky

Quote from: myndzi
but I kind of doubt that every sequence is solvable. Easiest way to find out is to find an unsolvable sequence

Bring it on!

Paul676

#13
Yes myndzi, I think that's unsolvable, due to the lack of Js, Ls and Ts which are the only 'balancing' pieces to the S and Z. In fact, I think this is the only possible unsolvable sequence-type, where there is only 1 T, L or J in the 10 possible (i.e. 10 upcoming and 1 held). This (I think) means that every single starting sequence is PCable.
               Tetris Belts!

myndzi

#14
There's more to it than just the pieces that are present. I'm fairly certain there are plenty of un-PCable opening bags, but it depends on your available kicks. Anyway, if the point is to determine if it's possible to construct and endless PC loop, then this I think is the simplest way to find out

vvv Nice! You are discovering my present it looks like