Comments

Not too much here to say about the game, it is the unofficially released Tengen Tetris, well known for its superiority to the official Nintendo Tetris. Tengen Tetris has 2-player versus AND cooperative modes, as well as versus or co-op with the Computer, plus more music options, a more entertaining Russian motif, and better level/garbage options. The gameplay itself is pretty identical, with only 1 preview piece, no hold queue or hard drop, etc.
After Fraplatek’s submissions of this game, attempting to obsolete PikachuMan’s 2014 movie, Spikestuff took to making a properly optimized movie. I don’t mean to be rude to Fraplatek, but, well, he got 6 singles, so, yeah. I expressed interest and Spikestuff offered me to help him with a good attempt he got stuck on. I ended up being into the idea of trying a different RNG entirely, which turned into writing an extra-next-pieces Lua script, and thoroughly documenting as many RNG options as I could.
Before continuing to run details, here’s the Lua script, mostly designed by Spikestuff and mostly coded by me. Instead of trying to disassemble the RNG to simulate what the next pieces will be, I took a brute force approach that just places 80 blocks to record what they are.
I should mention that the run uses a cheat to increase the level to 17, the maximum. There’s also a cheat to change your current piece to an I-block, and to remove your last placed block, which aren’t used. Also, 1 frame was purposely delayed to select a music track instead of the default Silence, for entertainment.

The run

For TASing, the major difference in Tengen Tetris is that it has a fixed piece order once you begin the game. That means that there isn’t really a way to have a truly perfect game. You have to play every piece dealt to you.
With the fixed piece order system, it is impossible to say that the RNG I’ve used here is the best possible. I only tried maybe 4 or 5 RNG options, actually. But, I did find over 40 that would cost 0 or 1 frame (this is a 0 frame one), and would say with near certainty that all of those RNG options I found are worse than this one. If you expanded your search to 2 or 3 frame delays, there are likely hundreds of potential options, as the starting RNG seems to be cycle-based, so different input patterns during the menus can give different results (and there’s a LOT of possible input patterns, when you include delaying the Start inputs, and doing Up/Down).
The branch names are the RNG values, which are RAM address 005C/005D. This appears to be seeded from 0034/0035. Here's a RAM watch
I’m not an expert on optimizing Tetris for speed by any means, but the main ways to save time in this game are obvious: Minimize the total number of pieces dropped. Minimize line clear animations. Minimize vertical piece travel. Minimize horizontal piece travel. Here’s how this run minimizes these 4 areas.

Minimize pieces dropped

In “30 lines”, you’ll need 300 chunks to clear that many lines. That would mean 75 pieces dropped. However, thanks to the starting garbage, this can be reduced. This run uses 3 garbage lines that spawned with 9 chunks. So, that’s 27 free chunks; 6.75 pieces saved!
But, due to very limited piece options near the end (ZOIOIZIZOOI), my board had 11 chunks leftover that I had placed there, including a Z piece that I literally did not need and just placed ASAP. So, 27-11 = 16 chunks, and 4 pieces saved, essentially. And indeed, this run places 71 pieces.
This is where almost all RNG options immediately fail in my eyes, because most garbage options are… garbage. This garbage layout is especially fantastic because clearing the 2nd and 3rd garbage lines only takes 1 piece:
That easy 3 garbage lines is why I prioritized trying this RNG, and luckily, it was able to fulfill the other time saves fantastically as well. There was another similar single-then-double layout I tested, but it ran into a 20-piece drought of I’s which really killed its effectiveness.
Most garbage layouts have multiple gaps that don’t line up, like this… But, if you were to find a layout that has perhaps, a 3-deep 1-block gap, that would have serious potential to be faster than this run.

Minimize line clear animations

A line clear animation is 28 frames, no matter how many lines you clear. This means 30 singles would lose 560 frames compared to 10 triples. That’s no good, and this is a main thing that the current movie does not optimize very well.
The bare minimum that you’d need for 30 lines is 8 line clears; either 7 Tetrises and a Double, or 6 Tetrises and 2 Triples. This run ended up with 9 line clears; 6 Tetrises and one of each of the others. The time a piece takes to drop varies of course based on horizontal and vertical travel needed, but tends to take 15-25 frames each. So, if reducing the line clears to 8 would take more than 1 extra piece drop, it isn’t worth it. In this run’s case, I had to build so close to the top that my placement options were too limited, and I had to place an extra chunk on the 2-deep garbage column, which I had to clear off with a Single.
And of course, having a piece order that would allow you to even have an option for only 8 line clears is rare. I’m assuming it exists, but I would bet that it would require more than 72 piece drops, so I’m not sure if it’d be faster...

Minimize vertical piece travel

Put simply, play close to the top. Of course, survival is the main concern, so there’s limited options for purposely optimizing this beyond “objective: survive”. There was a point where I could have done a back-to-back Tetris combo with two consecutive I’s, but I placed the second one instead and waited it out; that’s the extent that one can do.
I do not know how well different RNG options can be tested for “play close to the toppability” aside from playing through them by hand, but the one here has some insanely close calls; three times, I only had a 4 chunk leeway before the I-piece finally came. But to come that close without dying is exactly what this run asks for.
The length of the I-piece droughts in this run; a 16-piece drought at the start and a 15-piece drought in the middle; were just perfect for being able to reach the top without having to bail out with a weak L/J triple. 20+ long droughts are fairly common in RNG options, and, considering that you only have 8 rows to work with (9 if you clear a garbage line), and you have to leave one column open, having 80 straight chunks you can’t make Tetrises with is not a plan for success.

Minimize horizontal piece travel

This one’s probably the least important, as the board has to get filled up regardless, but still something I tried to keep in mind. Being a 10-wide playfield, 3-wide pieces can’t be in the center of the playfield; they have to be one slot to the left or right of it. Generally, the pieces spawn right of center, except for O-block, which is exactly in the center. So, it could save L presses to try to put O-blocks on the left, for example. And also, something like an I-block takes more presses to reach the rightmost position it can be in, than an L or J jutting rightward.
Survivability is far more important than this, but you can see in the run that I do tend to put O-blocks on the left generally. I feel like horizontal travel is the most likely place someone could possibly shave frames off this RNG option. I did try a few mass rebuilds of the board, but they were either slower or died from bad gaps.
EDIT: This point of optimization has become more interesting thanks to figuring out the ability to clip leftward using rotations. Basically, when you rotate a piece, if its new position would collide with another piece, it tries shifting the piece leftward, and if that position has no collisions, it allows it. All of the rotations (except I-piece) are pushed as far up and left as they can be. This rotation chart from the Tetris Wiki can help understand how to get them.
For example, in this case, the rotation would be wedged inside another piece, but it can be shifted leftward without issue:
I do not believe there's a way to ever get clipped rightward. As an example, this I-piece cannot rotate to reach the right gaps; it's blocked by the O-block, both where it wants to go, and one column to the left. (This was an attempt to re-build the board that didn't work out because of this...)

Possible time saves

Using more garbage lines could further lower the number of pieces placed. The garbage in this RNG has a fourth row that could be cleared somewhat easily, but digging to it early would greatly increase vertical movement and increase number of line clears, so I don’t believe it’s a time saver for this RNG.
An elusive 8 line clears run would have a free 28 frames saved, but at what expense?
The end-of-input could be optimized by having a board setup that allows more than just the last piece to be placed after input end, like leaving an unrotated T-shaped gap in the middle of the board to get a last double.
And as I’m not a Tetris Grandmaster, I can’t visualize every possible board setup, so there could be a faster way to implement this RNG...

Conclusion

Well, I’ve never thought myself up to the challenge of Tetris TASing, but here I am. I feel a bit weird to submit this despite trying so few options, but, I did find every 0/1-frame delay RNG I could, targeted this one for its great garbage, and it happened to be usable and deliver insanely on staying close to the top. I thought it would take longer to find such a result…
I cannot say with 100% certainty this is an optimized time, but it’s certainly much closer than the 2014 movie was. I am extremely happy with how the run turned out, and if someone can find a timesave, be my guest, cause I can’t! I don’t even know how to T-spin!
Thank you to Spikestuff for the base, inspiration and assistance with the run. Also, he’s provided extended input for Game Over + Name Entry. Here’s a bk2 that includes those. Wait he’s probably going to claim this for encoding anyway or wait is that against the rules if you’re an author
I have four TASes currently awaiting judgement right now! With a total length of like 15 minutes! Wow I’ve been both busy and also it’s not really that impressive at all

Spikestuff’s comments

I did something. This was the something.

feos: Replacing with a 28 frame improvement.
Maru: Judging.
Maru: This is a good improvement over the published run. You have done well with the research put into the game. Feedback was solid enough. Accepting to Moons tier.
feos: Pub.


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15628
Location: 127.0.0.1
This topic is for the purpose of discussing #6635: Spikestuff's NES Tengen Tetris "30 lines" in 00:23.55
MarbleousDave
He/Him
Player (13)
Joined: 9/12/2009
Posts: 1560
Wow! That's amazing. That's what I call an improvement. A definite yes vote.
Blazephlozard
He/Him
Banned User
Joined: 2/27/2013
Posts: 175
Location: Ohio
Oopsies, I found an easy 8 frame improvement. I didn't realize that rotations can be done while quick dropping without resetting the quick drop. There were 4 pieces that did more rotations than horizontal movements, so I was able to start holding Down 2 frames earlier on each of those. And armed with this knowledge that spamming rotations can be done without losing frames, I'm going to try to abuse it. Rotating a piece close to a wall can cause some odd reorientations. Observe, I'm holding down here: And now press A: And press A again to get it where it was before. This managed to save 4 frames by reducing two Left inputs. I'm not sure where else this can be done; I tested it on this piece due to having the tall I-piece wall, which is a pretty rare scenario to have. Probably at least 80% of the pieces dropped have no way of shaving directional input like this. I'll check as thoroughly as I can tonight. EDIT: Things might get more broken now. As I can go from this: To this, using two simultaneous rotations: If I didn't do it simultaneously, the piece would get locked in the other orientation. So this seems like a promising option for S and Z pieces. It's funny, I spent quite some time trying to optimize WHERE I place the pieces, but didn't give enough effort into HOW I place the pieces, haha. This chart may help understand how these rotation clips work: https://tetris.wiki/Tetris_(NES,_Tengen)#Rotation_rules (I'd use a url tag but it wipes the whole message?) My takeaway from it is that, as the rotation boxes are all pushed into the leftmost position (except I), that rotation clips like this might only be possible in a leftward direction? I'll trial and error as many possible placements as I can, though.
MarbleousDave
He/Him
Player (13)
Joined: 9/12/2009
Posts: 1560
Pressing A and B together at the same time is very difficult to do by humans.
Blazephlozard
He/Him
Banned User
Joined: 2/27/2013
Posts: 175
Location: Ohio
I managed 28 frames save on the movie. I believe it's: 8 frames from starting quick drops earlier 1 frame from placing the useless Z at the end one row earlier by rotating it 19 frames from rotation pushes (It's an odd number, because for one of them, I used a 1-frame Pause to be able to press B two game frames in a row, to avoid an early piece lock) I think a different board setup would be needed to get more pushes than this, but everything I tried for improving possible pushes, just makes the board not quite fill in enough to survive. So, I'm once again happy with where it is. Spikestuff made a comparison video: Link to video Here's the movie file to update the submission: http://tasvideos.org/userfiles/info/61562979381368213
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3828)
Joined: 11/30/2014
Posts: 2834
Location: US
Nice work and research, yes vote.
Joined: 12/10/2006
Posts: 118
Nice improvements. Minimizing line clears seemed so obvious. Strange noone commented on that on the old submission.
Blazephlozard
He/Him
Banned User
Joined: 2/27/2013
Posts: 175
Location: Ohio
Fraplatek has been improving their time, which is very cool: Link to video They've found an 8-line clear RNG here, though with a pretty weak garbage layout. I'd like to try it, if I got a movie file or could duplicate the RNG. I can't think of any way to really effectively automate finding RNGs in Lua, I'm thinking about trying to make some kind of brute forcer that has tables defining different useless inputs (like P1 Up + P2 Down) and "go up" inputs, though it'd be hardish to account for making sure to not press the same input 2 frames in a row.
SonicFan53
He/Him
Joined: 2/6/2020
Posts: 93
I love this TAS, It's very entertaining :)
*playing Sonic Chaos*
Post subject: Movie published
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15628
Location: 127.0.0.1
This movie has been published. The posts before this message apply to the submission, and posts after this message apply to the published movie. ---- [4124] NES Tengen Tetris "30 lines" by Spikestuff in 00:23.55