HOME WORLD FORUMS WIKI VIDEOS
8808 members and stacking!
     Welcome guest, please login or sign up

 
Reply to this topicStart new topic
> Did some 4-wide Combo related programming (3 vs 6 residuals, bot playing ComboRace, deadly sequences)
Okey_Dokey
post Mar 9 2018, 11:54 PM
Post #1


Tetris Professional
Group Icon
Posts: 582
Joined: 13-May 15



What is 4-wide?

All modern games since Tetris Worlds (2001) follow a Tetris guideline: hold, bag system (exactly one of each shape every 7 pieces), SRS kicks, at least 3 previews. Some years later, combos were added to that system: To perform a combo, you have to clear at least 1 line with each consecutive piece placement. Large combos send a huge amount of lines in multiplayer and obviously you can reach large combos best by clearing only one line at a time. And there we have the concept of 4-wide: You build a huge stack in most columns; but you leave 4 columns empty apart from a few filled cells at the bottom. If you clear exactly 1 line with each placement, then the amount of filled cells ("residuals") in those 4 columns is invariant. The most popular choices are 3 and 6 residuals (I will abbreviate them with 3res and 6res in the following). You can also categorize 4-wide by where the empty columns are located in the field. Usually, the empty columns are located on one side but you can also choose the 4 center columns. Center 4-wide is harder to stack but has the advantage that you don't top out when the stack on the sides is pushed over the top of the visible area. Here are some popular starts for center 4-wide with 3res and 6res respectively:


The length of a combo is limited by the height of the stack in the non-empty columns (in which you build a huge stack). However, in the following I assume that the matrix is just 4 columns wide, in which case a combo could be infinite long in theory. There's also ComboRace in NullpoMino (under Start -> More... -> Race Modes).

Which fields can occur during a 4-wide?

This question is easy to answer for 3 residuals (e.g. have a look at the Combo Setup wiki article) but for 6 residuals finding all possible fields and how they are connected to each other is too hard to do per hand. So I did the following: Start with an arbitrary field, check all ways how a piece can be placed clearing exactly 1 line (resulting in new fields), do the same for the newly found fields, repeat until all found fields have been checked. However, some of those found fields may not link to any other fields, I call them dead ends. Removing those dead ends may result in other fields becoming dead ends, so repeat removing dead ends until no dead ends are left.

Here are all possible fields and how they are connected for 3 residuals and 6 residuals. It doesn't matter in which field you start, the result will be the same - with different numeration (ID) though. During a successful 4-wide, 28 fields can occur with 3res and 356 fields can occur with 6res. Note that for every field in 3res, there are 4 corresponding fields in 6res which you get by just adding an additional line with 3 filled cells at the bottom. However, there are 244 further fields in 6res and most of them will have only 2 filled cells in the bottom row (but never 1 filled cell). Also, all filled cells are always located in the bottom 4 rows. If you count over all 7 piece shapes, then a field will connect to 5 fields in average in 3res (including itself for horizontal I piece placement), compared to 5.93 fields in 6res.

In the following I will use the terms "state" and "bag" a lot. A state is just a field paired with a piece you've got on hold. And a bag is a 7 piece-long sequence where each shape appears exactly once. There are 7*6*5*4*3*2 = 5040 different bags and 28*7 = 196 different states for 3res and 356*7 = 2492 states for 6res. For each "state" and "each" bag, one can look which states can be reached by starting in "state" and placing "bag" (with the use of hold). I repeated that for every state and bag and saved the result in what I call "continuation matrix" (where each entry is a set of states).

Is it possible to make an infinitely long 4-wide combo?

No, it's not possible for 3 residuals or 6 residuals - assuming the generated piece sequence is truly random. There are sequences which top out the player, no matter of the starting state and no matter of which decisions are made. I will call those sequences "deadly" in the following and there's a 100 % chance that they are part of an infinitely long sequence. I made the best experience finding deadly sequences this way: start with a set consisting of all states, for every bag calculate which states can be reached from this set, store each newly found set that is different from previously found sets and has only a low number of states in comparison to the other stored sets, repeat this process with each stored set. I also tried looping 2 bags (a 14 piece-long sequence repeated over and over) because when starting with all states, the number of remaining reachable states can only decrease (or stagnate) with each loop. But this didn't work out properly for 6res.

Anyway, with 3 residuals there are 3-bags-long deadly sequences, for example LJOTZSI ISZJTLO LOSZJTI (after 2 bags only 2 states with O piece on hold can be reached). However, there are no 2-bags-long deadly sequences (they can be survived when starting in the right state and making the right decisions). 2 bags-long loops can be also deadly, for example LJTSOZI ZISLTJO needs 2 loops to be deadly and LZTSJIO OIZTSJL needs 7 loops to be deadly.
With 6 residuals, the shortest deadly sequences I found where 8 bags long, for example ILJTOZS OSITZLJ IJLOTSZ IZTSJLO LOSJZIT ZTSJLOI OLSZTJI JOZSTLI. I assume the shortest deadly sequences are either 5 or 6 bags long (without success, I tested all 4 bags-long sequences that resulted in a rather low amount of states after 2 bags). A loop consisting of 2 bags is never deadly for 6res. I couldn't even find a deadly sequence by taking the 2 bag-long loops with rather low amounts of remaining states and adding a 2 bag-long finisher to them.

So, there are far less deadly sequences in case of 6res. Is it only because there are more states which must be eliminated, or is 6res more stable than 3res? Well, at least I can say that the bot I programmed performed much better on 6res. So, with proper stacking and a sufficient amount of previews, 6res is indeed more stable.

The Bot

It needs at least 5 previews (knows 1 bag in advance) and 12 previews at max (knows 2 bags in advance). It only makes a decision at the start of a bag, and sticks to this decision for the rest of the bag. To explain how the bot works, I must first introduce a concept I call "extended states". It's like a base state (field and piece on hold) but the first pieces of a bag are also added towards it. In case of 1 extra piece, we have 7 times as many extended states as base states. In case of 6 or 7 extra pieces, we have 5040 times as many extended states. However, to get from an extended state to another extended state, you still have to drop only 7 pieces and only 5040 piece combinations can occur during this time (I will also use the term "bag" for those 7 piece-long sequences, although there are technically no bags because certain shapes can appear twice). Also, which (extended) states can be reached from an extended state can still be gathered directly from the continuation matrix (the data which was created just for base states). So, the concept of extended states doesn't add to the complexity of the problem besides increasing the amount of states that must be checked.

I will call a set of (extended) states "stable", if for every state in the set and for every bag there exists a reachable state that is part of the set. Before I knew that there were deadly sequences, my goal was to find a stable set (to prove that you can play forever). In fact, stable sets exist, if you remove certain pieces from Tetris, e.g. if you just work with T, L, J and O pieces (i.e. a bag is only 4 pieces long), then stable sets exist for 2 extra pieces (but not for 0 or 1 extra piece, so you must pay attention to the first 2 pieces of the next bag in order to play forever with those 4 pieces).

To find the largest stable subset I did the following: start with a set consisting of all (extended) states, go over all states that are still in the set, mark a state (as dead end) if there's at least one bag where no state in the set can be reached, remove all marked states from the set, repeat until the set is empty or no states were marked in the last step. I couldn't use that algorithm for what I had intended originally (the set will always be empty if there are deadly sequences) but at least it can give a hint of how good a state is. In the following the "level" of a state is the step in which the state was marked (as dead end) in the algorithm. A state is level 0, if there's a bag without any continuation. A state is level 1, if at least one state is reachable for every bag, but there's a 1 bag where only states in level 0 can be reached. Basically, the level of a state tells you how many bags can be survived at least starting in this state, when for each bag you take a reachable state with the maximum level.

The approach "take state with maximum level" (among all continuations) actually defines a way how a bot could work. However, it would be suboptimal if you choose randomly a state among those candidates. For example, in level 0 there are not too bad states but also states that have no continuation at all (note that an extended state specifies the first pieces of a sequence, together with a bad piece on hold, it could mean instant fail). A better way to describe the "quality" of a state would be "average of maximum reachable level": for each of the 5040 bags, look for the maximum level that can be reached for each, sum that up and divide the result by 5040. I also added a fraction of the original state's level towards it but this is rather unimportant. I could imagine there are better ways to determine the quality of a state but I wouldn't know how to do so.

So, yeah that's how the combo bot works. Let's say the bot uses 3 extra pieces for extended states and it can look 10 pieces in advance. At the start of each bag (I mean real bags, not the fake ones I was talking about earlier in extended states), the bot looks at the field, the hold piece and the first 3 pieces. This information defines the (extended) state the bot is currently in. The bot looks at the following 7 pieces and determines which (extended) states can be reached. From those states, it chooses the one with the maximum quality (average of maximum reachable level) and places the pieces accordingly until the end of the bag.

Here are the results for 3 residuals (first table) and 6 residuals (second table). Each row stands for a certain amount of "extra" pieces. 0 extra pieces means that the bot is looking 1 bag ahead, and 6 extra pieces means that the bot is looking 2 bags ahead (extra = 7 is basically the same as 6, so it is not listed). The numbers in the middle say how many states are located in each level (if bot is currently in level xxx, then it can always survive the next xxx bags). The numbers in the most right column tells how the bot performed with that amount of extra pieces. I started in a nice state and let the bot play until it either dropped 1 million pieces or failed the combo. I used 100 to 1000 tries to determine the averages. As you can see, the bot performs better the more extra pieces it has at its disposal. It also performs better on 6 residuals. With 6res and 6extra, the bot can place several million pieces in average before a combo fails.

CODE
                           ### 3 residuals ###

  extra │    0     │    1     │    2     │    3     │    4     │ bot average
────────┼──────────┼──────────┼──────────┼──────────┼──────────┼─────────────
   0    │100.000 % │          │          │          │          │     111
   1    │ 89.942 % │ 10.058 % │          │          │          │     288
   2    │ 71.137 % │ 28.839 % │  0.024 % │          │          │     940
   3    │ 57.580 % │ 36.448 % │  5.972 % │          │          │    2904
   4    │ 50.709 % │ 31.299 % │ 17.992 % │          │          │   10294
   5    │ 48.172 % │ 25.929 % │ 25.899 % │          │          │   24726
   6    │ 47.408 % │ 22.825 % │ 29.715 % │  0.052 % │          │   66461


                           ### 6 residuals ###

  extra │    0     │    1     │    2     │    3     │    4     │ bot average
────────┼──────────┼──────────┼──────────┼──────────┼──────────┼─────────────
   0    │ 99.197 % │  0.803 % │          │          │          │     187
   1    │ 89.870 % │ 10.130 % │          │          │          │    2477
   2    │ 70.089 % │ 27.366 % │  2.545 % │          │          │   25038
   3    │ 53.670 % │ 31.445 % │ 14.611 % │  0.274 % │          │  423350
   4    │ 45.350 % │ 27.412 % │ 21.558 % │  5.680 % │          │  903870
   5    │ 42.099 % │ 22.197 % │ 19.027 % │ 16.554 % │  0.122 % │  990663
   6    │ 41.199 % │ 19.057 % │ 15.317 % │ 21.611 % │  2.816 % │ 1000000

The source code for the bot can be downloaded here. Attached File  combo_source.zip ( 32.18k ) Number of downloads: 57

It's programmed in Java. Note that it needs a lot of memory; I recommend using it with Java VM arguments -Xms500m -Xmx1200m. The continuation matrix will need around 500 MB (in 32-bit Java) but it is not needed anymore once the quality data is created. Quality data itself is 47 MB in case of 6res + 6extra and the program will try to save that data locally.

Note that the bot isn't meant to be used for real. It's just meant for the purpose of combo theory and to make some nice videos. In real Tetris, the height of a stack is limited, and so are the amount of previews (which means a real combo bot must readjust its decisions during a bag).

Here's the bot in action. It plays a slightly modded version of 1,000 lines Combo Race in NullpoMino, one time with 3 residuals and the other time with 6 residuals (both times with 6 extra pieces) . I once saw it failing after 2 bags with 6 residuals but once it has acclimated (i.e. it has reached a nice state at the end of a bag), it will be able to play pretty much forever.





As you can see in the 6 residuals video, the bot will have exactly 1 hole in the bottom row in over 95% of the times, whereas in this case the hole is located in the 2 center columns again in over 95% of the times. So, the bot stacks 6res very similar to 3res. However, I saw the bot making interesting/weird choices once:


And here are the states that the bot considers best in average (top 10 base states in case of 6extra). For each base state (field and hold piece) and for each of the 7 pieces, I went through all corresponding extended states that start with said piece and took the average of the qualities. In case of 6 residuals, there are quite some states with 2 holes in bottom row among the best states. However, those states are hard to reach, so they won't see them often in practice.

User is offlinePM
Go to the top of the page
+Quote Post
Shuey
post Mar 10 2018, 12:59 AM
Post #2


Tetris Expert
Group Icon
Posts: 457
Joined: 12-November 10



Cool stuff Okey!


--------------------
Subscribe to me on YouTube
User is offlinePM
Go to the top of the page
+Quote Post
caffeine
post Mar 10 2018, 02:26 AM
Post #3


Tetris Grand Master
Group Icon
Posts: 1,748
Joined: 27-June 09



For a while I thought maybe it was not possible to combo indefinitely, but then Kitaru pointed out how poochy's bot seems to never lose. Apparently it had to do with nullpomino's piece sequence looping after a certain amount. Anyway, this is fascinating.
User is offlinePM
Go to the top of the page
+Quote Post
mahnameseddoi
post Mar 10 2018, 04:22 AM
Post #4


Tetris Novice
Group Icon
Posts: 20
Joined: 25-October 14



I barely understood any of that and I think it's way too technical for the layman tetris player, but boy you sure are smart. Glad to see you advancing tetris knowledge for the whole community smile.gif
User is offlinePM
Go to the top of the page
+Quote Post
Okey_Dokey
post Mar 10 2018, 08:27 AM
Post #5


Tetris Professional
Group Icon
Posts: 582
Joined: 13-May 15



Thank you, Shuey, caffeine and Eddie.

QUOTE(caffeine @ Mar 10 2018, 02:26 AM) *
For a while I thought maybe it was not possible to combo indefinitely, but then Kitaru pointed out how poochy's bot seems to never lose. Apparently it had to do with nullpomino's piece sequence looping after a certain amount.

I think the bot is only integrated in NullpoMino which means that you can watch it stacking but you cannot give it a 1 million piece-long sequence where it tells you in a few secs how long it could survive.

From the data I collected I would say, if knowing the whole piece sequence in advance, a bot should be able to make in average a 500,000 combo (via deep search). Since NullpoMino loops the piece sequence after 1400 pieces, you could let PoochyBot play a sequence and it will be able to combo forever in let's say 99 out of the 100 times. Just by watching a bot stacking, you could get the impression that it can combo forever for real. Just by trial and error the bot can reach a huge amount of states after a certain amount of placed pieces, and usually at least one of these states will have a continuation. There are 3 bag-long sequences that will end the combo no matter in which state you start - but those bags are sparse.

It's a similar situation with playing forever on memoryless randomizer. A well programmed bot can survive over 1 million pieces in average, even with only 1 preview (and I assume billions of pieces if it knows the sequence in advance). So one could get the impression that playing forever is possible on memoryless randomizer but indeed there are sequences that top you out (e.g. alternating SZ sequence) no matter what you do.

And I assume it's the same with the Infinite T-Spin Triple loop. There are Tool Assisted Speedruns out there where players reach 99,999,999 points in Tetris DS using nothing but back to back T-Spin Triples. I assume there are combination of bags out there that make you waste some T pieces no matter what you do (because in the Infinite TST loop you stack 2 TSTs before you execute one) - but those combinations occur too rarely to matter in a TAS play (again you can reach just too many states with trial and error and one state will usually work). However, this problem is far too complex to prove that is not possible to play forever.

-----

I have a challenge for anybody interested. As said in initial post, the sequence LZTSJIO OIZTSJL causes inevitable death if looped 7 times. However, it can be survived 6 times. So, try to do so in NullpoMino. Note that surviving 6 loops is only possible if you start with the correct field and piece on hold. You have to do the following to play NullpoMino Combo Race with said sequence:
  1. In NullpoMino main folder, create a file called sequence.txt .
  2. Open this file with a text editor and paste the following sequence into it:
    XLZTSJIOOIZTSJLLZTSJIOOIZTSJLLZTSJIOOIZTSJLLZTSJIOOIZTSJLLZTSJIOOIZTSJLLZTSJIOOI
    ZTSJLLZTSJIOOIZTSJL
    (X must be replaced with a letter, it represents the piece on hold with which you start)
  3. In NullpoMino main folder, open ruleeditor.bat
  4. In Rule Editor, open StandardZero.rul,
  5. In Basic tab, change randomizer to FixedSequenceRandomizer and also change rule name to STANDARD-FIXED
  6. save the rule afterwards as StandardFixed.rul (use save as... and NOT save...)
  7. Open NullpoMino, choose Options -> Rule Select -> Tetromino -> Standard-Fixed
  8. In NullpoMino, choose Start -> More... -> Race Modes -> Combo Race -> Current Rule
  9. In Combo Race, set Width to 4 and choose a Start Shape you like
  10. First piece you get represents the piece on hold, don't forget to edit sequence.txt if you want to start with another
If you really manage to survive 6 loops (84 pieces) without the following spoilers, then you can be really proud of yourself. I guess 4 loops is already an accomplishment.

The following spoiler tells you which states can be reached after each loop (depending on the initial field and hold piece):

middle stands for a state that can be reached after placing the bag LZTSJIO
end stands for a state that can be reached after placing the bag OIZTSJL

start = 0T , middle = 6J , end = 25S
start = 0T , middle = 11T , end = 6S
start = 0T , middle = 11T , end = 16J
start = 0L , middle = 6J , end = 25S
start = 0L , middle = 7T , end = 10O
start = 0L , middle = 7T , end = 11L
start = 0L , middle = 7T , end = 1S
start = 0L , middle = 7T , end = 19L
start = 0L , middle = 7T , end = 20L
start = 0L , middle = 5O , end = 10S
start = 0L , middle = 5O , end = 6L
start = 0L , middle = 5O , end = 25L
start = 0L , middle = 7J , end = 1J
start = 0L , middle = 7J , end = 7L
start = 0J , middle = 3O , end = 25S
start = 0J , middle = 5O , end = 10S
start = 0J , middle = 5O , end = 6L
start = 0J , middle = 5O , end = 25L
start = 0J , middle = 10J , end = 10Z
start = 0J , middle = 10J , end = 23L
start = 0J , middle = 10J , end = 26L
start = 0J , middle = 10J , end = 17L
start = 0J , middle = 7J , end = 1J
start = 0J , middle = 7J , end = 7L
start = 0O , middle = 11S , end = 10O
start = 0O , middle = 11S , end = 11L
start = 0O , middle = 11S , end = 1S
start = 0O , middle = 11S , end = 19L
start = 0O , middle = 11S , end = 20L
start = 0O , middle = 6J , end = 25S
start = 0S , middle = 11T , end = 6S
start = 0S , middle = 11T , end = 16J
start = 0S , middle = 3O , end = 25S
start = 0S , middle = 5O , end = 10S
start = 0S , middle = 5O , end = 6L
start = 0S , middle = 5O , end = 25L
start = 0S , middle = 11S , end = 10O
start = 0S , middle = 11S , end = 11L
start = 0S , middle = 11S , end = 1S
start = 0S , middle = 11S , end = 19L
start = 0S , middle = 11S , end = 20L
start = 0Z , middle = 6J , end = 25S
start = 0I , middle = 11S , end = 10O
start = 0I , middle = 11S , end = 11L
start = 0I , middle = 11S , end = 1S
start = 0I , middle = 11S , end = 19L
start = 0I , middle = 11S , end = 20L
start = 0I , middle = 6S , end = 10Z
start = 0I , middle = 6S , end = 23L
start = 0I , middle = 6S , end = 26L
start = 0I , middle = 6S , end = 17L
start = 0I , middle = 11T , end = 6S
start = 0I , middle = 11T , end = 16J
start = 0I , middle = 3O , end = 25S
start = 1T , middle = 11T , end = 6S
start = 1T , middle = 11T , end = 16J
start = 1T , middle = 3O , end = 25S
start = 1T , middle = 11S , end = 10O
start = 1T , middle = 11S , end = 11L
start = 1T , middle = 11S , end = 1S
start = 1T , middle = 11S , end = 19L
start = 1T , middle = 11S , end = 20L
start = 1T , middle = 7J , end = 1J
start = 1T , middle = 7J , end = 7L
start = 1J , middle = 6J , end = 25S
start = 1O , middle = 6J , end = 25S
start = 1O , middle = 7T , end = 10O
start = 1O , middle = 7T , end = 11L
start = 1O , middle = 7T , end = 1S
start = 1O , middle = 7T , end = 19L
start = 1O , middle = 7T , end = 20L
start = 1O , middle = 5O , end = 10S
start = 1O , middle = 5O , end = 6L
start = 1O , middle = 5O , end = 25L
start = 1O , middle = 7J , end = 1J
start = 1O , middle = 7J , end = 7L
start = 1Z , middle = 7J , end = 1J
start = 1Z , middle = 7J , end = 7L
start = 1I , middle = 11S , end = 10O
start = 1I , middle = 11S , end = 11L
start = 1I , middle = 11S , end = 1S
start = 1I , middle = 11S , end = 19L
start = 1I , middle = 11S , end = 20L
start = 2T , middle = 6J , end = 25S
start = 2T , middle = 11T , end = 6S
start = 2T , middle = 11T , end = 16J
start = 2T , middle = 11S , end = 10O
start = 2T , middle = 11S , end = 11L
start = 2T , middle = 11S , end = 1S
start = 2T , middle = 11S , end = 19L
start = 2T , middle = 11S , end = 20L
start = 2T , middle = 5O , end = 10S
start = 2T , middle = 5O , end = 6L
start = 2T , middle = 5O , end = 25L
start = 2L , middle = 6J , end = 25S
start = 2L , middle = 7T , end = 10O
start = 2L , middle = 7T , end = 11L
start = 2L , middle = 7T , end = 1S
start = 2L , middle = 7T , end = 19L
start = 2L , middle = 7T , end = 20L
start = 2L , middle = 5O , end = 10S
start = 2L , middle = 5O , end = 6L
start = 2L , middle = 5O , end = 25L
start = 2L , middle = 7J , end = 1J
start = 2L , middle = 7J , end = 7L
start = 2J , middle = 3O , end = 25S
start = 2J , middle = 5O , end = 10S
start = 2J , middle = 5O , end = 6L
start = 2J , middle = 5O , end = 25L
start = 2J , middle = 10J , end = 10Z
start = 2J , middle = 10J , end = 23L
start = 2J , middle = 10J , end = 26L
start = 2J , middle = 10J , end = 17L
start = 2J , middle = 7J , end = 1J
start = 2J , middle = 7J , end = 7L
start = 2J , middle = 7Z , end = 6S
start = 2J , middle = 7Z , end = 16J
start = 2O , middle = 11S , end = 10O
start = 2O , middle = 11S , end = 11L
start = 2O , middle = 11S , end = 1S
start = 2O , middle = 11S , end = 19L
start = 2O , middle = 11S , end = 20L
start = 2O , middle = 6J , end = 25S
start = 2O , middle = 11T , end = 6S
start = 2O , middle = 11T , end = 16J
start = 2S , middle = 6J , end = 25S
start = 2Z , middle = 11T , end = 6S
start = 2Z , middle = 11T , end = 16J
start = 2Z , middle = 3O , end = 25S
start = 2Z , middle = 11S , end = 10O
start = 2Z , middle = 11S , end = 11L
start = 2Z , middle = 11S , end = 1S
start = 2Z , middle = 11S , end = 19L
start = 2Z , middle = 11S , end = 20L
start = 2I , middle = 11S , end = 10O
start = 2I , middle = 11S , end = 11L
start = 2I , middle = 11S , end = 1S
start = 2I , middle = 11S , end = 19L
start = 2I , middle = 11S , end = 20L
start = 2I , middle = 6S , end = 10Z
start = 2I , middle = 6S , end = 23L
start = 2I , middle = 6S , end = 26L
start = 2I , middle = 6S , end = 17L
start = 2I , middle = 11T , end = 6S
start = 2I , middle = 11T , end = 16J
start = 2I , middle = 3O , end = 25S
start = 2I , middle = 7J , end = 1J
start = 2I , middle = 7J , end = 7L
start = 3T , middle = 11T , end = 6S
start = 3T , middle = 11T , end = 16J
start = 3T , middle = 3O , end = 25S
start = 3T , middle = 11S , end = 10O
start = 3T , middle = 11S , end = 11L
start = 3T , middle = 11S , end = 1S
start = 3T , middle = 11S , end = 19L
start = 3T , middle = 11S , end = 20L
start = 3T , middle = 5O , end = 10S
start = 3T , middle = 5O , end = 6L
start = 3T , middle = 5O , end = 25L
start = 3T , middle = 7J , end = 1J
start = 3T , middle = 7J , end = 7L
start = 3L , middle = 11L , end = 25S
start = 3L , middle = 11L , end = 6S
start = 3L , middle = 11L , end = 16J
start = 3L , middle = 5O , end = 10S
start = 3L , middle = 5O , end = 6L
start = 3L , middle = 5O , end = 25L
start = 3L , middle = 11S , end = 10O
start = 3L , middle = 11S , end = 11L
start = 3L , middle = 11S , end = 1S
start = 3L , middle = 11S , end = 19L
start = 3L , middle = 11S , end = 20L
start = 3J , middle = 3O , end = 25S
start = 3J , middle = 5O , end = 10S
start = 3J , middle = 5O , end = 6L
start = 3J , middle = 5O , end = 25L
start = 3J , middle = 11T , end = 6S
start = 3J , middle = 11T , end = 16J
start = 3J , middle = 11S , end = 10O
start = 3J , middle = 11S , end = 11L
start = 3J , middle = 11S , end = 1S
start = 3J , middle = 11S , end = 19L
start = 3J , middle = 11S , end = 20L
start = 3J , middle = 7J , end = 1J
start = 3J , middle = 7J , end = 7L
start = 3O , middle = 6S , end = 10Z
start = 3O , middle = 6S , end = 23L
start = 3O , middle = 6S , end = 26L
start = 3O , middle = 6S , end = 17L
start = 3O , middle = 7J , end = 1J
start = 3O , middle = 7J , end = 7L
start = 3S , middle = 11S , end = 10O
start = 3S , middle = 11S , end = 11L
start = 3S , middle = 11S , end = 1S
start = 3S , middle = 11S , end = 19L
start = 3S , middle = 11S , end = 20L
start = 3Z , middle = 7J , end = 1J
start = 3Z , middle = 7J , end = 7L
start = 3Z , middle = 6J , end = 25S
start = 3Z , middle = 7T , end = 10O
start = 3Z , middle = 7T , end = 11L
start = 3Z , middle = 7T , end = 1S
start = 3Z , middle = 7T , end = 19L
start = 3Z , middle = 7T , end = 20L
start = 3Z , middle = 5O , end = 10S
start = 3Z , middle = 5O , end = 6L
start = 3Z , middle = 5O , end = 25L
start = 3I , middle = 6J , end = 25S
start = 4T , middle = 6J , end = 25S
start = 4T , middle = 11T , end = 6S
start = 4T , middle = 11T , end = 16J
start = 4L , middle = 11S , end = 10O
start = 4L , middle = 11S , end = 11L
start = 4L , middle = 11S , end = 1S
start = 4L , middle = 11S , end = 19L
start = 4L , middle = 11S , end = 20L
start = 4J , middle = 6S , end = 10Z
start = 4J , middle = 6S , end = 23L
start = 4J , middle = 6S , end = 26L
start = 4J , middle = 6S , end = 17L
start = 4J , middle = 6J , end = 25S
start = 4J , middle = 7J , end = 1J
start = 4J , middle = 7J , end = 7L
start = 4J , middle = 7T , end = 10O
start = 4J , middle = 7T , end = 11L
start = 4J , middle = 7T , end = 1S
start = 4J , middle = 7T , end = 19L
start = 4J , middle = 7T , end = 20L
start = 4J , middle = 5O , end = 10S
start = 4J , middle = 5O , end = 6L
start = 4J , middle = 5O , end = 25L
start = 4O , middle = 3O , end = 25S
start = 4Z , middle = 6J , end = 25S
start = 4Z , middle = 11T , end = 6S
start = 4Z , middle = 11T , end = 16J
start = 4I , middle = 11L , end = 25S
start = 4I , middle = 11L , end = 6S
start = 4I , middle = 11L , end = 16J
start = 4I , middle = 5O , end = 10S
start = 4I , middle = 5O , end = 6L
start = 4I , middle = 5O , end = 25L
start = 4I , middle = 11S , end = 10O
start = 4I , middle = 11S , end = 11L
start = 4I , middle = 11S , end = 1S
start = 4I , middle = 11S , end = 19L
start = 4I , middle = 11S , end = 20L
start = 5T , middle = 7J , end = 1J
start = 5T , middle = 7J , end = 7L
start = 5L , middle = 6J , end = 25S
start = 5L , middle = 11T , end = 6S
start = 5L , middle = 11T , end = 16J
start = 5L , middle = 11S , end = 10O
start = 5L , middle = 11S , end = 11L
start = 5L , middle = 11S , end = 1S
start = 5L , middle = 11S , end = 19L
start = 5L , middle = 11S , end = 20L
start = 5L , middle = 7J , end = 1J
start = 5L , middle = 7J , end = 7L
start = 5J , middle = 6J , end = 25S
start = 5O , middle = 7J , end = 1J
start = 5O , middle = 7J , end = 7L
start = 5O , middle = 6J , end = 25S
start = 5O , middle = 7T , end = 10O
start = 5O , middle = 7T , end = 11L
start = 5O , middle = 7T , end = 1S
start = 5O , middle = 7T , end = 19L
start = 5O , middle = 7T , end = 20L
start = 5O , middle = 5O , end = 10S
start = 5O , middle = 5O , end = 6L
start = 5O , middle = 5O , end = 25L
start = 5S , middle = 7J , end = 1J
start = 5S , middle = 7J , end = 7L
start = 5I , middle = 5O , end = 10S
start = 5I , middle = 5O , end = 6L
start = 5I , middle = 5O , end = 25L
start = 5I , middle = 7Z , end = 6S
start = 5I , middle = 7Z , end = 16J
start = 5I , middle = 3O , end = 25S
start = 6T , middle = 6J , end = 25S
start = 6T , middle = 5O , end = 10S
start = 6T , middle = 5O , end = 6L
start = 6T , middle = 5O , end = 25L
start = 6T , middle = 7Z , end = 6S
start = 6T , middle = 7Z , end = 16J
start = 6L , middle = 11S , end = 10O
start = 6L , middle = 11S , end = 11L
start = 6L , middle = 11S , end = 1S
start = 6L , middle = 11S , end = 19L
start = 6L , middle = 11S , end = 20L
start = 6J , middle = 6S , end = 10Z
start = 6J , middle = 6S , end = 23L
start = 6J , middle = 6S , end = 26L
start = 6J , middle = 6S , end = 17L
start = 6J , middle = 6J , end = 25S
start = 6J , middle = 7J , end = 1J
start = 6J , middle = 7J , end = 7L
start = 6O , middle = 3O , end = 25S
start = 6O , middle = 11T , end = 6S
start = 6O , middle = 11T , end = 16J
start = 6O , middle = 11S , end = 10O
start = 6O , middle = 11S , end = 11L
start = 6O , middle = 11S , end = 1S
start = 6O , middle = 11S , end = 19L
start = 6O , middle = 11S , end = 20L
start = 6Z , middle = 6J , end = 25S
start = 6I , middle = 11T , end = 6S
start = 6I , middle = 11T , end = 16J
start = 6I , middle = 3O , end = 25S
start = 6I , middle = 7J , end = 1J
start = 6I , middle = 7J , end = 7L
start = 6I , middle = 11S , end = 10O
start = 6I , middle = 11S , end = 11L
start = 6I , middle = 11S , end = 1S
start = 6I , middle = 11S , end = 19L
start = 6I , middle = 11S , end = 20L
start = 7T , middle = 11L , end = 25S
start = 7T , middle = 11L , end = 6S
start = 7T , middle = 11L , end = 16J
start = 7T , middle = 5O , end = 10S
start = 7T , middle = 5O , end = 6L
start = 7T , middle = 5O , end = 25L
start = 7T , middle = 11S , end = 10O
start = 7T , middle = 11S , end = 11L
start = 7T , middle = 11S , end = 1S
start = 7T , middle = 11S , end = 19L
start = 7T , middle = 11S , end = 20L
start = 7L , middle = 11T , end = 6S
start = 7L , middle = 11T , end = 16J
start = 7L , middle = 3O , end = 25S
start = 7J , middle = 6J , end = 25S
start = 7J , middle = 11T , end = 6S
start = 7J , middle = 11T , end = 16J
start = 7J , middle = 11S , end = 10O
start = 7J , middle = 11S , end = 11L
start = 7J , middle = 11S , end = 1S
start = 7J , middle = 11S , end = 19L
start = 7J , middle = 11S , end = 20L
start = 7I , middle = 7J , end = 1J
start = 7I , middle = 7J , end = 7L
start = 7I , middle = 5O , end = 10S
start = 7I , middle = 5O , end = 6L
start = 7I , middle = 5O , end = 25L
start = 7I , middle = 7Z , end = 6S
start = 7I , middle = 7Z , end = 16J
start = 7I , middle = 3O , end = 25S
start = 8T , middle = 11T , end = 6S
start = 8T , middle = 11T , end = 16J
start = 8T , middle = 3O , end = 25S
start = 8T , middle = 11S , end = 10O
start = 8T , middle = 11S , end = 11L
start = 8T , middle = 11S , end = 1S
start = 8T , middle = 11S , end = 19L
start = 8T , middle = 11S , end = 20L
start = 8T , middle = 7J , end = 1J
start = 8T , middle = 7J , end = 7L
start = 8L , middle = 11T , end = 6S
start = 8L , middle = 11T , end = 16J
start = 8L , middle = 3O , end = 25S
start = 8L , middle = 11S , end = 10O
start = 8L , middle = 11S , end = 11L
start = 8L , middle = 11S , end = 1S
start = 8L , middle = 11S , end = 19L
start = 8L , middle = 11S , end = 20L
start = 8L , middle = 7J , end = 1J
start = 8L , middle = 7J , end = 7L
start = 8L , middle = 5O , end = 10S
start = 8L , middle = 5O , end = 6L
start = 8L , middle = 5O , end = 25L
start = 8J , middle = 3O , end = 25S
start = 8J , middle = 5O , end = 10S
start = 8J , middle = 5O , end = 6L
start = 8J , middle = 5O , end = 25L
start = 8J , middle = 11T , end = 6S
start = 8J , middle = 11T , end = 16J
start = 8J , middle = 11S , end = 10O
start = 8J , middle = 11S , end = 11L
start = 8J , middle = 11S , end = 1S
start = 8J , middle = 11S , end = 19L
start = 8J , middle = 11S , end = 20L
start = 8J , middle = 7J , end = 1J
start = 8J , middle = 7J , end = 7L
start = 8O , middle = 7J , end = 1J
start = 8O , middle = 7J , end = 7L
start = 8O , middle = 6S , end = 10Z
start = 8O , middle = 6S , end = 23L
start = 8O , middle = 6S , end = 26L
start = 8O , middle = 6S , end = 17L
start = 8S , middle = 11S , end = 10O
start = 8S , middle = 11S , end = 11L
start = 8S , middle = 11S , end = 1S
start = 8S , middle = 11S , end = 19L
start = 8S , middle = 11S , end = 20L
start = 8Z , middle = 7J , end = 1J
start = 8Z , middle = 7J , end = 7L
start = 8I , middle = 5O , end = 10S
start = 8I , middle = 5O , end = 6L
start = 8I , middle = 5O , end = 25L
start = 8I , middle = 7Z , end = 6S
start = 8I , middle = 7Z , end = 16J
start = 8I , middle = 3O , end = 25S
start = 9T , middle = 6J , end = 25S
start = 9T , middle = 11T , end = 6S
start = 9T , middle = 11T , end = 16J
start = 9T , middle = 11S , end = 10O
start = 9T , middle = 11S , end = 11L
start = 9T , middle = 11S , end = 1S
start = 9T , middle = 11S , end = 19L
start = 9T , middle = 11S , end = 20L
start = 9L , middle = 5O , end = 10S
start = 9L , middle = 5O , end = 6L
start = 9L , middle = 5O , end = 25L
start = 9L , middle = 7Z , end = 6S
start = 9L , middle = 7Z , end = 16J
start = 9L , middle = 3O , end = 25S
start = 9J , middle = 3O , end = 25S
start = 9J , middle = 5O , end = 10S
start = 9J , middle = 5O , end = 6L
start = 9J , middle = 5O , end = 25L
start = 9J , middle = 7Z , end = 6S
start = 9J , middle = 7Z , end = 16J
start = 9O , middle = 11T , end = 6S
start = 9O , middle = 11T , end = 16J
start = 9O , middle = 3O , end = 25S
start = 9O , middle = 11S , end = 10O
start = 9O , middle = 11S , end = 11L
start = 9O , middle = 11S , end = 1S
start = 9O , middle = 11S , end = 19L
start = 9O , middle = 11S , end = 20L
start = 9S , middle = 6J , end = 25S
start = 9Z , middle = 11T , end = 6S
start = 9Z , middle = 11T , end = 16J
start = 9Z , middle = 3O , end = 25S
start = 9Z , middle = 11S , end = 10O
start = 9Z , middle = 11S , end = 11L
start = 9Z , middle = 11S , end = 1S
start = 9Z , middle = 11S , end = 19L
start = 9Z , middle = 11S , end = 20L
start = 9I , middle = 11S , end = 10O
start = 9I , middle = 11S , end = 11L
start = 9I , middle = 11S , end = 1S
start = 9I , middle = 11S , end = 19L
start = 9I , middle = 11S , end = 20L
start = 9I , middle = 6S , end = 10Z
start = 9I , middle = 6S , end = 23L
start = 9I , middle = 6S , end = 26L
start = 9I , middle = 6S , end = 17L
start = 9I , middle = 7J , end = 1J
start = 9I , middle = 7J , end = 7L
start = 10T , middle = 7J , end = 1J
start = 10T , middle = 7J , end = 7L
start = 10J , middle = 11T , end = 6S
start = 10J , middle = 11T , end = 16J
start = 10J , middle = 3O , end = 25S
start = 10Z , middle = 5O , end = 10S
start = 10Z , middle = 5O , end = 6L
start = 10Z , middle = 5O , end = 25L
start = 10Z , middle = 7Z , end = 6S
start = 10Z , middle = 7Z , end = 16J
start = 10Z , middle = 3O , end = 25S
start = 10I , middle = 6J , end = 25S
start = 10I , middle = 7T , end = 10O
start = 10I , middle = 7T , end = 11L
start = 10I , middle = 7T , end = 1S
start = 10I , middle = 7T , end = 19L
start = 10I , middle = 7T , end = 20L
start = 10I , middle = 5O , end = 10S
start = 10I , middle = 5O , end = 6L
start = 10I , middle = 5O , end = 25L
start = 10I , middle = 7J , end = 1J
start = 10I , middle = 7J , end = 7L
start = 11T , middle = 11T , end = 6S
start = 11T , middle = 11T , end = 16J
start = 11T , middle = 3O , end = 25S
start = 11L , middle = 7J , end = 1J
start = 11L , middle = 7J , end = 7L
start = 11J , middle = 6S , end = 10Z
start = 11J , middle = 6S , end = 23L
start = 11J , middle = 6S , end = 26L
start = 11J , middle = 6S , end = 17L
start = 11J , middle = 6J , end = 25S
start = 11O , middle = 6J , end = 25S
start = 11S , middle = 11L , end = 25S
start = 11S , middle = 11L , end = 6S
start = 11S , middle = 11L , end = 16J
start = 11S , middle = 5O , end = 10S
start = 11S , middle = 5O , end = 6L
start = 11S , middle = 5O , end = 25L
start = 11S , middle = 11S , end = 10O
start = 11S , middle = 11S , end = 11L
start = 11S , middle = 11S , end = 1S
start = 11S , middle = 11S , end = 19L
start = 11S , middle = 11S , end = 20L
start = 11I , middle = 6J , end = 25S
start = 12J , middle = 11T , end = 6S
start = 12J , middle = 11T , end = 16J
start = 12J , middle = 3O , end = 25S
start = 12J , middle = 5O , end = 10S
start = 12J , middle = 5O , end = 6L
start = 12J , middle = 5O , end = 25L
start = 12J , middle = 11S , end = 10O
start = 12J , middle = 11S , end = 11L
start = 12J , middle = 11S , end = 1S
start = 12J , middle = 11S , end = 19L
start = 12J , middle = 11S , end = 20L
start = 12Z , middle = 7J , end = 1J
start = 12Z , middle = 7J , end = 7L
start = 12I , middle = 11S , end = 10O
start = 12I , middle = 11S , end = 11L
start = 12I , middle = 11S , end = 1S
start = 12I , middle = 11S , end = 19L
start = 12I , middle = 11S , end = 20L
start = 13T , middle = 6J , end = 25S
start = 13L , middle = 7J , end = 1J
start = 13L , middle = 7J , end = 7L
start = 13L , middle = 5O , end = 10S
start = 13L , middle = 5O , end = 6L
start = 13L , middle = 5O , end = 25L
start = 13L , middle = 7Z , end = 6S
start = 13L , middle = 7Z , end = 16J
start = 13L , middle = 3O , end = 25S
start = 13J , middle = 6S , end = 10Z
start = 13J , middle = 6S , end = 23L
start = 13J , middle = 6S , end = 26L
start = 13J , middle = 6S , end = 17L
start = 13J , middle = 6J , end = 25S
start = 13O , middle = 11T , end = 6S
start = 13O , middle = 11T , end = 16J
start = 13O , middle = 3O , end = 25S
start = 13O , middle = 11S , end = 10O
start = 13O , middle = 11S , end = 11L
start = 13O , middle = 11S , end = 1S
start = 13O , middle = 11S , end = 19L
start = 13O , middle = 11S , end = 20L
start = 13S , middle = 6J , end = 25S
start = 13S , middle = 11T , end = 6S
start = 13S , middle = 11T , end = 16J
start = 13I , middle = 6J , end = 25S
start = 14T , middle = 11T , end = 6S
start = 14T , middle = 11T , end = 16J
start = 14T , middle = 3O , end = 25S
start = 14T , middle = 11S , end = 10O
start = 14T , middle = 11S , end = 11L
start = 14T , middle = 11S , end = 1S
start = 14T , middle = 11S , end = 19L
start = 14T , middle = 11S , end = 20L
start = 14O , middle = 7J , end = 1J
start = 14O , middle = 7J , end = 7L
start = 14Z , middle = 7J , end = 1J
start = 14Z , middle = 7J , end = 7L
start = 15T , middle = 7J , end = 1J
start = 15T , middle = 7J , end = 7L
start = 15O , middle = 11T , end = 6S
start = 15O , middle = 11T , end = 16J
start = 15O , middle = 3O , end = 25S
start = 16T , middle = 7J , end = 1J
start = 16T , middle = 7J , end = 7L
start = 16L , middle = 11T , end = 6S
start = 16L , middle = 11T , end = 16J
start = 16L , middle = 3O , end = 25S
start = 16J , middle = 6J , end = 25S
start = 16I , middle = 7J , end = 1J
start = 16I , middle = 7J , end = 7L
start = 17T , middle = 6J , end = 25S
start = 17L , middle = 6J , end = 25S
start = 17L , middle = 7T , end = 10O
start = 17L , middle = 7T , end = 11L
start = 17L , middle = 7T , end = 1S
start = 17L , middle = 7T , end = 19L
start = 17L , middle = 7T , end = 20L
start = 17L , middle = 5O , end = 10S
start = 17L , middle = 5O , end = 6L
start = 17L , middle = 5O , end = 25L
start = 17L , middle = 7J , end = 1J
start = 17L , middle = 7J , end = 7L
start = 17J , middle = 3O , end = 25S
start = 17J , middle = 5O , end = 10S
start = 17J , middle = 5O , end = 6L
start = 17J , middle = 5O , end = 25L
start = 17J , middle = 10J , end = 10Z
start = 17J , middle = 10J , end = 23L
start = 17J , middle = 10J , end = 26L
start = 17J , middle = 10J , end = 17L
start = 17J , middle = 7J , end = 1J
start = 17J , middle = 7J , end = 7L
start = 17O , middle = 11S , end = 10O
start = 17O , middle = 11S , end = 11L
start = 17O , middle = 11S , end = 1S
start = 17O , middle = 11S , end = 19L
start = 17O , middle = 11S , end = 20L
start = 17I , middle = 11S , end = 10O
start = 17I , middle = 11S , end = 11L
start = 17I , middle = 11S , end = 1S
start = 17I , middle = 11S , end = 19L
start = 17I , middle = 11S , end = 20L
start = 17I , middle = 6S , end = 10Z
start = 17I , middle = 6S , end = 23L
start = 17I , middle = 6S , end = 26L
start = 17I , middle = 6S , end = 17L
start = 17I , middle = 11T , end = 6S
start = 17I , middle = 11T , end = 16J
start = 17I , middle = 3O , end = 25S
start = 18J , middle = 11T , end = 6S
start = 18J , middle = 11T , end = 16J
start = 18J , middle = 3O , end = 25S
start = 18J , middle = 11S , end = 10O
start = 18J , middle = 11S , end = 11L
start = 18J , middle = 11S , end = 1S
start = 18J , middle = 11S , end = 19L
start = 18J , middle = 11S , end = 20L
start = 18O , middle = 7J , end = 1J
start = 18O , middle = 7J , end = 7L
start = 19L , middle = 7J , end = 1J
start = 19L , middle = 7J , end = 7L
start = 19O , middle = 11T , end = 6S
start = 19O , middle = 11T , end = 16J
start = 19O , middle = 3O , end = 25S
start = 20L , middle = 7J , end = 1J
start = 20L , middle = 7J , end = 7L
start = 20J , middle = 7J , end = 1J
start = 20J , middle = 7J , end = 7L
start = 21L , middle = 11T , end = 6S
start = 21L , middle = 11T , end = 16J
start = 21L , middle = 3O , end = 25S
start = 21J , middle = 6J , end = 25S
start = 21I , middle = 7J , end = 1J
start = 21I , middle = 7J , end = 7L
start = 22T , middle = 7J , end = 1J
start = 22T , middle = 7J , end = 7L
start = 22L , middle = 11T , end = 6S
start = 22L , middle = 11T , end = 16J
start = 22L , middle = 3O , end = 25S
start = 22L , middle = 11S , end = 10O
start = 22L , middle = 11S , end = 11L
start = 22L , middle = 11S , end = 1S
start = 22L , middle = 11S , end = 19L
start = 22L , middle = 11S , end = 20L
start = 22J , middle = 6J , end = 25S
start = 23T , middle = 11T , end = 6S
start = 23T , middle = 11T , end = 16J
start = 23T , middle = 3O , end = 25S
start = 23J , middle = 7J , end = 1J
start = 23J , middle = 7J , end = 7L
start = 24S , middle = 7J , end = 1J
start = 24S , middle = 7J , end = 7L
start = 25Z , middle = 11T , end = 6S
start = 25Z , middle = 11T , end = 16J
start = 25Z , middle = 3O , end = 25S
start = 25I , middle = 11L , end = 25S
start = 25I , middle = 11L , end = 6S
start = 25I , middle = 11L , end = 16J
start = 25I , middle = 5O , end = 10S
start = 25I , middle = 5O , end = 6L
start = 25I , middle = 5O , end = 25L
start = 25I , middle = 11S , end = 10O
start = 25I , middle = 11S , end = 11L
start = 25I , middle = 11S , end = 1S
start = 25I , middle = 11S , end = 19L
start = 25I , middle = 11S , end = 20L
start = 26L , middle = 7J , end = 1J
start = 26L , middle = 7J , end = 7L
start = 26J , middle = 6S , end = 10Z
start = 26J , middle = 6S , end = 23L
start = 26J , middle = 6S , end = 26L
start = 26J , middle = 6S , end = 17L
start = 26J , middle = 6J , end = 25S
start = 26I , middle = 6J , end = 25S
start = 27J , middle = 11T , end = 6S
start = 27J , middle = 11T , end = 16J
start = 27J , middle = 3O , end = 25S

The following spoiler tells you which states you must reach at the end of each loop in order to survive 6 loops:

start in: 0J 9I 0I 6J 11J 2J 2I 3O 26J 17J 8O 13J 17I 4J
after x loops reach one of the following states:
after 1 loop : 9L 0L 9J 0S 1O 10Z 10I 2T 2L 11S 3T 3L 12J 3J 3Z 13L 4I 5O 5I 6T 7T 25I 7I 17L 8L 8J 8I
after 2 loops: 18J 9O 14T 0O 5L 9Z 1T 6L 1I 6O 6I 2O 2Z 7J 8T 3S 12I 17O 22L 8S 4L 13O 9T
after 3 loops: 18O 5T 23J 14O 10T 19L 5S 14Z 15T 1Z 24S 20L 11L 20J 16T 16I 26L 12Z 21I 22T 8Z
after 4 loops: 0T 4Z 23T 10J 19O 15O 11T 16L 7L 21L 25Z 4T 13S 27J
after 5 loops: 13I 9S 0Z 5J 1J 6Z 11O 2S 16J 11I 21J 17T 3I 13T 22J 26I 4O
after 6 loops: any state

Note that not every listed state can be reached after a certain amount of loops, I think only these are possible:
start in: 0J 9I 0I 6J 11J 2J 2I 3O 26J 17J 8O 13J 17I 4J
after 1 loop : 17L 10Z
after 2 loops: 6L
after 3 loops: 19L 20L 11L
after 4 loops: 7L
after 5 loops: 16J
after 6 loops: 25S

A state may look like 1T , where 1 represents the field and T the piece on hold. The fields corresponding to the numbers are as follows:

CODE
ID: 0   ID: 1    ID: 2    ID: 3    ID: 4    ID: 5    ID: 6    ID: 7
____    ____     ____     ____     ____     ____     ____     ____
XX__    __XX     X___     ___X     X___     ___X     ____     ____
X___    ___X     X__X     X__X     XX__     __XX     XXX_     _XXX

    
ID: 8    ID: 9   ID: 10    ID: 11   ID: 12   ID: 13   ID: 14  ID: 15
X___     ___X    ____      ____     ____     ____     ____     ____
X___     ___X    ____      ____     ___X     X___     XX__     __XX
X___     ___X    XX_X      X_XX     XX__     __XX     _X__     __X_


ID: 16  ID: 17   ID: 18   ID: 19   ID: 20   ID: 21   ID: 22   ID: 23
____    ____     ____     ____     ____     ____     ____     ____
X___    ___X     _X__     __X_     X___     ___X     X___     ___X
X_X_    _X_X     XX__     __XX     _XX_     _XX_     _X_X     X_X_


ID: 24  ID: 25   ID: 26   ID: 27
____    ____     ____     ____
_X__    __X_     _XX_     _XX_
X__X    X__X     X___     ___X
User is offlinePM
Go to the top of the page
+Quote Post
Cosine
post Mar 10 2018, 01:07 PM
Post #6


Tetris Novice
Group Icon
Posts: 18
Joined: 1-September 17



The answer if you want to know:


How about 4 and 5 residuals?
User is offlinePM
Go to the top of the page
+Quote Post
Kitaru
post Mar 10 2018, 09:25 PM
Post #7


Tetris Grand Master
Group Icon
Posts: 1,244
Joined: 26-June 09



QUOTE(caffeine @ Mar 9 2018, 06:26 PM) *

For a while I thought maybe it was not possible to combo indefinitely, but then Kitaru pointed out how poochy's bot seems to never lose. Apparently it had to do with nullpomino's piece sequence looping after a certain amount. Anyway, this is fascinating.

QUOTE(Okey_Dokey @ Mar 10 2018, 12:27 AM) *
Since NullpoMino loops the piece sequence after 1400 pieces, you could let PoochyBot play a sequence and it will be able to combo forever in let's say 99 out of the 100 times.

Yeah, to get the context into this thread, that is exactly how it was able to "infinite combo." I think it memoized the residuals and was able to find a state where it would link back into the state at piece 1 (or otherwise near the beginning of the sequence) and then just rip through that forever for a 9999 combo counter and beyond. I think Poochy's goal at the beginning was just to see if he could program a bot to sustain a 4w combo given the relative low number of states, and then the "infinite combo" was a fun end result.


--------------------
My Backloggery
User is offlinePM
Go to the top of the page
+Quote Post
Okey_Dokey
post Mar 10 2018, 11:35 PM
Post #8


Tetris Professional
Group Icon
Posts: 582
Joined: 13-May 15



QUOTE(Cosine @ Mar 10 2018, 01:07 PM) *
The answer if you want to know:

Thanks for the Fumen. Kudos if you managed to do this without the hints.

QUOTE(Cosine @ Mar 10 2018, 01:07 PM) *
How about 4 and 5 residuals?

Fields and how they link to each other

4 residuals: pastebin, 46 fields, a field has 5.39 links in average
5 residuals: pastebin, 164 fields, a field has 5.81 links in average

Deadly sequences

4 residuals: There are 2 bag-long deadly sequences, e.g. LJITOSZ TOSZJLI. You have to loop TLSJIZO IZSLJTO 9 times such that it becomes deadly.

5 residuals: There are 4-bag long deadly sequences, e.g. ILJOTZS SZLTIOJ OZTSLIJ TJOZSLI (only 2 states can be reached at the end of 3rd bag). I am pretty sure there are no 3 bags long deadly sequences. Sequence TLIJOZS SZJOLTI becomes deadly if looped 3 times. STOZJLI IJLOZTS becomes deadly if looped 11 times (that's the highest amount of loops needed I have seen so far)

Levels & bot performance

4 residuals:

CODE
  extra  │    0     │    1     │    2     │    3     │ bot average
─────────┼──────────┼──────────┼──────────┼──────────┼─────────────
    0    │100.000 % │          │          │          │      31
    1    │ 97.604 % │  2.396 % │          │          │      64
    2    │ 83.333 % │ 16.667 % │          │          │     107
    3    │ 63.940 % │ 35.921 % │  0.139 % │          │     177
    4    │ 51.611 % │ 46.018 % │  2.371 % │          │     289
    5    │ 46.215 % │ 46.722 % │  7.063 % │          │     375
    6    │ 44.628 % │ 43.785 % │ 11.587 % │          │     625

5 residuals:

CODE
  extra  │    0     │    1     │    2     │    3     │ bot average
─────────┼──────────┼──────────┼──────────┼──────────┼─────────────
    0    │100.000 % │          │          │          │      47
    1    │ 93.280 % │  6.720 % │          │          │     134
    2    │ 77.987 % │ 21.980 % │  0.033 % │          │     383
    3    │ 62.923 % │ 35.177 % │  1.901 % │          │    1315
    4    │ 53.558 % │ 39.285 % │  7.157 % │          │    4821
    5    │ 49.310 % │ 37.596 % │ 13.072 % │  0.022 % │   16994
    6    │ 47.835 % │ 35.319 % │ 16.602 % │  0.243 % │   31701

Summary

Note that I didn't let the bot start in such a nice state as in 3res and 6res (I saw the bot topping out more often after 21 or less pieces) because I had no experience with 4res and 5res. As compensation, you may have to add 10% or 20% to the bot average in order to compare it with 3res or 6res.

As expected, 4 residuals' performance is the worst so far. No state in level 3 and the average bot performance doesn't even double per added extra preview. On 6 extra previews it performs at least 20 times worse than the other tested residuals.

5 residuals' performance is a little worse than that of 3 residuals. In my opinion there's no advantage for 5res at all. When you look at how the bot stacks, you will notice that the bot will have 2 holes in the bottom row's center columns 95 % of the time. The bot doesn't either do any moves that are not possible in 3res, except when it has 1 hole in the bottom row for a very short period. Also note that it's much harder to start a combo with 5res because the states with 1 hole in bottom are rather instable.



I don't intend to do any testings for a higher amount of residuals. 9 residuals would be most interesting (3res -> 6res -> 9res) but I assume that I couldn't present any results there: I guess there are too many states so the creation of the continuation matrix will end in an Out Of Memory error (32-bit Java can use 1500 MB of memory at maximum). And if that's not the case, then determining the levels of all states would take too long for a higher amount of extra previews. I also doubt I could find a deadly sequence (if there isn't even any).

QUOTE(Okey_Dokey @ Mar 10 2018, 08:27 AM) *
It's a similar situation [as] with playing forever on memoryless randomizer.

BTW the still-open theoretical result I am most interested in is playing forever with bag randomizer but without hold (I don't care if it is with or without softdrop and SRS kicks and how far you can look ahead). I don't even have a clue, if it is possible to play forever there or not. If it is not possible, then there's no way this could be ever shown because the shortest deadly sequence would be hundreds of pieces long and the amount of playfields that can be visited in that time is just insanely huge.

However, if it is possible to play forever with bag randomizer but without hold, then I think it can be best shown with a bot using the "extended state" system I was speaking of (you proceed a bag but make the bot stacking dependent on the first pieces of the next bag). But instead of reducing the amount of reachable states in in each step (like I did in the combo bot), you have to increase that number. You start with an empty field and add all corresponding extended states to the set of visited states. Then you proceed each visited state and look to which state the bot's decision will lead. If you are lucky, then the amount of visited fields doesn't grow too quickly and stagnates after a while. think that the chances that this works out is really low but maybe it's worth a try.
User is offlinePM
Go to the top of the page
+Quote Post
Cosine
post Mar 11 2018, 05:40 AM
Post #9


Tetris Novice
Group Icon
Posts: 18
Joined: 1-September 17



Thanks for answering my question.

QUOTE(Okey_Dokey @ Mar 10 2018, 11:35 PM) *

QUOTE(Cosine @ Mar 10 2018, 01:07 PM) *
The answer if you want to know:

Thanks for the Fumen. Kudos if you managed to do this without the hints.


I used hints because I suck and I was too lazy to do all 196 different states at the beginning. No kudos.
User is offlinePM
Go to the top of the page
+Quote Post
farter
post Apr 13 2018, 09:08 AM
Post #10


Tetris Expert
Group Icon
Posts: 302
Joined: 19-April 11



wow, another heavyweight research!

but i just wonder why 4res is so weak... as misamino quite frequently use it (though according to misaka, no special code for choice between 3 or 4 was written?)

as it's quite different from 5, 6 being padded 3res for most of the time, 4res is quite unique.

a table of the expected chain length for each opening would be nice.

and maybe this will be an easier god's algorithm to approximate?

though we have to use bag-7, then the index in the current bag, with the pieces already used in this bag, also the hold, will be taken into account for the randomizer status...
but i still think it'll need less computation than even 4*4 survival god (needs 2^16 expected scores to be optimized) (as the status space is so small..) (how about disabling hold with 6res?)

will look into it.


--------------------
User is offlinePM
Go to the top of the page
+Quote Post
farter
post Apr 13 2018, 09:24 AM
Post #11


Tetris Expert
Group Icon
Posts: 302
Joined: 19-April 11



QUOTE(Okey_Dokey @ Mar 10 2018, 04:27 PM) *

It's a similar situation with playing forever on memoryless randomizer. A well programmed bot can survive over 1 million pieces in average, even with only 1 preview (and I assume billions of pieces if it knows the sequence in advance). So one could get the impression that playing forever is possible on memoryless randomizer but indeed there are sequences that top you out (e.g. alternating SZ sequence) no matter what you do.


btw, from what i remember (it's been quite some years...), misaka's bot with 0 preview clears 3 million lines on average (she has run it for about 100 games).
with 1 preview available, we simply can't see the end for a 10*20 field. through exponential extrapolation of data from running with 10*7, 8, 9, 10, 11... it's estimated to be around 5T (5*10^12) lines on average in a 10*20 field.


--------------------
User is offlinePM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

©2009-2018 Hard Drop Community & Forum
harddrop.com is not sponsored or endorsed by The Tetris Company or its subsidiaries.