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

2 Pages V  1 2 >  
Reply to this topicStart new topic
> Fastest possible 40 lines time?, human or not
simonlc
post Mar 11 2013, 03:18 AM
Post #1


Tetris Apprentice
Group Icon
Posts: 168
Joined: 31-October 12



So I've been thinking, since lots of actions are based on frames, that would be the limiting factor. So if you played the most strategic and accurate game, with no delay of pressing keys, what's the hard time limit?

I'm no tetris expert, but I tried out some estimates that maybe someone else can refine. Now I know there's lots of ways that you could cut this time down if you had the right order of tetrominos, but for the sake of keeping this simple lets just give averages.

One frame at 60 FPS is 16.666 ms. Lets say on average you need to move/rotate a piece (2 frames) then move the piece two more times (one to adjust and one to place it). So in total you have 4 frames to place a piece. We need 100 pieces to clear 40 lines. I'm not sure if that's exactly how many frames it could take, but an average could be made with all the finesse moves possible. Next, we need 100 pieces to clear 40 lines so if we put that all together we get:

16.666 x 4 x 100 = 6666.666 ms = 6.667 s

So that is the fastest feasible time, unlikely to be possible by a human, I'm not sure if there's any bots that have solved the 40 lines game but that would be interesting to see. This would give the player 15 pieces per second.

For a human I would add in two frames, which would give you 10 seconds, and a pps of 10.

Edit: fixed pps.
User is offlinePM
Go to the top of the page
+Quote Post
myndzi
post Mar 11 2013, 04:45 AM
Post #2


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



>882 pieces per second

You might need to re-check your math there Wink.png


--------------------
User is offlinePM
Go to the top of the page
+Quote Post
Integration
post Mar 11 2013, 07:54 AM
Post #3


Tetris Professional
Group Icon
Posts: 666
Joined: 9-October 10



Currently we have no sprint time below 20 seconds. I doubt there'll ever be a sub 17 seconds sprint in future.

QUOTE(simonlc @ Mar 11 2013, 06:18 AM) *
16.666 x 4 x 100 = 6666.666 ms = 6.667 s

So that is the fastest feasible time, unlikely to be possible by a human, I'm not sure if there's any bots that have solved the 40 lines game but that would be interesting to see.

Those 6.667 seconds are a good estimation in my opinion. To be sure that NullpoMino registers a key you have to press it down for at least 17 ms. If you'd set DAS to 2, 17 ms could also lead to an unintended autorepeat to the wall. So DAS values smaller than 3 are not usable, even for bots.

Here's a sprint bot of mine. It uses 2 step finesse, but no finesse between pieces (diagonal movement).




The same bot in Keyblox.




And a bot by Orich playing Cultris 2 (before cheat protection was introduced).


User is offlinePM
Go to the top of the page
+Quote Post
post Mar 11 2013, 10:03 AM
Post #4




Posts: 0
Joined: --



First off, Welcome to HD Simon! I'd highly recommend making an official introduction on our forums and getting to know the community better Smile.png

Secondly, WOW, your analytical thirst and curiosity pleases me Wink.png I've also pondered this question myself, but it's refreshing to see you have tackled it very nicely.

My 2cents, it is indeed literally impossible for a human to achieve a Perfect Sprint. The microscopic fractional unnoticeable pauses we take to subconsciously process our next move, already this minuscule pause in itself wastes countless precious frames and renders the game utterly imperfect. But regardless of the actual feasibility, this has certainly been an interesting topic to explore, and I encourage/anticipate your future contributions!
User is offlinePM
Go to the top of the page
+Quote Post
simonlc
post Mar 11 2013, 11:33 AM
Post #5


Tetris Apprentice
Group Icon
Posts: 168
Joined: 31-October 12



QUOTE(myndzi @ Mar 11 2013, 04:45 AM) *

>882 pieces per second

You might need to re-check your math there Wink.png


Yup, fixed it lol.

QUOTE(Integration @ Mar 11 2013, 07:54 AM) *

Currently we have no sprint time below 20 seconds. I doubt there'll ever be a sub 17 seconds sprint in future.
Those 6.667 seconds are a good estimation in my opinion. To be sure that NullpoMino registers a key you have to press it down for at least 17 ms. If you'd set DAS to 2, 17 ms could also lead to an unintended autorepeat to the wall. So DAS values smaller than 3 are not usable, even for bots.

Here's a sprint bot of mine. It uses 2 step finesse, but no finesse between pieces (diagonal movement).

I totally forgot to factor in DAS! That's an awesome bot you have, I'd love to see the source code. The description says you wrote it with autohotkey? Seems like a quick and dirty way to make a bot. Grin.png

QUOTE(Panda @ Mar 11 2013, 10:03 AM) *

First off, Welcome to HD Simon! I'd highly recommend making an official introduction on our forums and getting to know the community better Smile.png

Secondly, WOW, your analytical thirst and curiosity pleases me Wink.png I've also pondered this question myself, but it's refreshing to see you have tackled it very nicely.

My 2cents, it is indeed literally impossible for a human to achieve a Perfect Sprint. The microscopic fractional unnoticeable pauses we take to subconsciously process our next move, already this minuscule pause in itself wastes countless precious frames and renders the game utterly imperfect. But regardless of the actual feasibility, this has certainly been an interesting topic to explore, and I encourage/anticipate your future contributions!


Hi, thank you for the welcome, I'll check out the introduction forum.

I also don't think it'll be possible to hit the very fastest limit, but I do think breaking 17 s would be possible. If someone plays purely on patterns, you only have to look at what pieces are coming. Get good enough at this and you're queuing up what keys you need to press eliminating that delay of thinking. The next step would be to get some Korean APM, and you've got a record. That's how Integration's bot works right?
User is offlinePM
Go to the top of the page
+Quote Post
Integration
post Mar 11 2013, 06:08 PM
Post #6


Tetris Professional
Group Icon
Posts: 666
Joined: 9-October 10



QUOTE(simonlc @ Mar 11 2013, 02:33 PM) *
I totally forgot to factor in DAS! That's an awesome bot you have, I'd love to see the source code. The description says you wrote it with autohotkey? Seems like a quick and dirty way to make a bot. Grin.png

Yes, AutoHotKey is a simple way to simulate keystrokes or analyze pixels' color. However, it's a bit slow to program a real bot. Perhaps you can call c++ / c# code via DLLs (see sleepy function), so that just the know-your-field-data / simulate-keystrokes part is done by AutoHotKey itself (I have no clues in this regard though). For a real bot you'd have to analyse the goodness of a stack to find a good spot. And that's the hard part. I didn't have that problem because this sprint bot follows a predefined setup, which is only adjusted by the order in which you get O, J and L pieces.

I won't share the NullpoMino version, because I don't want to cause more issues with fake sprint times in NullpoMino League Edition. I see no problem posting the Keyblox version, though: Click me. Deep drop must be enabled and you might have to change qy and qw so that it is working properly.

This script sends infinite short keystrokes. Those keystrokes are still registered, because KeyBlox is event based. For frame based games, the send code must look different. Here an extract from my NullpoMino version:

CODE

qh := 58; hold sleep time
qt := 23; tap sleep time
qw := 23; wait sleep time for double taps
ql := "Left"; left move
qr := "Right"; right move
qd := "R"; drop piece
qs := "Space"; sonic move piece down

moveO:
if ( bag >= 13 )
{
    send {%qd% down}
    sleepy(qt)
    send {%qd% up}    
}
else if ( JLO = "JLO" OR JLO = "LJO" OR JLO = "OJL" OR JLO = "OLJ" )
{
    send {%qr% down}
    sleepy(qh)    
    send {%qr% up}    
    send {%ql% down}
    send {%qd% down}    
    sleepy(qt)    
    send {%ql% up}    
    send {%qd% up}            
}
else if ( JLO = "JOL" )
{
    send {%qr% down}
    sleepy(qh)    
    send {%qr% up}
    send {%qs% down}    
    sleepy(qt)    
    send {%qs% up}                
    sleepy(qw)
    send {%ql% down}
    send {%qd% down}    
    sleepy(qt)    
    send {%ql% up}    
    send {%qd% up}                
}
else if ( JLO = "LOJ" )
{
    send {%qr% down}
    sleepy(qt)
    send {%qr% up}
    sleepy(qw)
    send {%qr% down}
    send {%qs% down}
    sleepy(qt)
    send {%qr% up}
    send {%qs% up}
    sleepy(qw)
    send {%qr% down}
    send {%qd% down}    
    sleepy(qt)    
    send {%qr% up}    
    send {%qd% up}        
}
return

That's what's happening in that part of the code:


User is offlinePM
Go to the top of the page
+Quote Post
simonlc
post Mar 11 2013, 09:30 PM
Post #7


Tetris Apprentice
Group Icon
Posts: 168
Joined: 31-October 12



QUOTE(Integration @ Mar 11 2013, 06:08 PM) *

Yes, AutoHotKey is a simple way to simulate keystrokes or analyze pixels' color. However, it's a bit slow to program a real bot. Perhaps you can call c++ / c# code via DLLs (see sleepy function), so that just the know-your-field-data / simulate-keystrokes part is done by AutoHotKey itself (I have no clues in this regard though). For a real bot you'd have to analyse the goodness of a stack to find a good spot. And that's the hard part. I didn't have that problem because this sprint bot follows a predefined setup, which is only adjusted by the order in which you get O, J and L pieces.

I won't share the NullpoMino version, because I don't want to cause more issues with fake sprint times in NullpoMino League Edition. I see no problem posting the Keyblox version, though: Click me. Deep drop must be enabled and you might have to change qy and qw so that it is working properly.

This script sends infinite short keystrokes. Those keystrokes are still registered, because KeyBlox is event based. For frame based games, the send code must look different. Here an extract from my NullpoMino version:

That's what's happening in that part of the code:



Awesome, thanks for sharing. I'm actually surprised at how simple that is, using autohotkey got rid of a lot of the complexities though. I don't think I would have a hard time making that work with NullpoMino, so maybe it's a good idea to not share it if cheating is a concern. I might have to adapt this script on Tetris Friends since everyone here seems to hate it. Grin.png

On second thought maybe I should just work more on my clone.
User is offlinePM
Go to the top of the page
+Quote Post
XaeL
post Mar 12 2013, 04:03 AM
Post #8


Tetris God
Group Icon
Posts: 2,918
Joined: 30-June 09



As i said 10000 times already, Event based ftw, that way you can reduce minimal time to like 0.0001s


--------------------
IPB Image


QUOTE(Paradox @ Dec 16 2010 @ 05:52 PM)
Like many setups here, it is useful if your opponent doesn't move and you get 4 Ts in a row.
User is offlinePM
Go to the top of the page
+Quote Post
Integration
post Mar 12 2013, 07:22 AM
Post #9


Tetris Professional
Group Icon
Posts: 666
Joined: 9-October 10



QUOTE(simonlc @ Mar 12 2013, 12:30 AM) *
I might have to adapt this script on Tetris Friends since everyone here seems to hate it. Grin.png

On second thought maybe I should just work more on my clone.

Second thought sounds much better. This bot was just a try to write a basic AI and make a video of it. There's no real usefulness for it. More explicitely, it's not worth porting it to Tetris Friends. TF has much slower DAS and runs with 40 frames per second. So this bot wouldn't be able to sub 20 s there. Additionally, TF has VERY slow softdrop speed. This bot softdrops an O every 3rd bag in average, so you'll lose a lot of time. And you'd need to introduce a variable telling you how high the JLO stack is, so that you know how long you have to press down softdrop key.
User is offlinePM
Go to the top of the page
+Quote Post
Ravendarksky
post Mar 12 2013, 05:22 PM
Post #10


Tetris Professional
Group Icon
Posts: 813
Joined: 23-July 09



Kitaru has a TAS video clearing in 2.75seconds if it is at all relevant: http://www.youtube.com/watch?v=7glxpv5BELM...gQ&index=12


--------------------
User is offlinePM
Go to the top of the page
+Quote Post
UJS3
post Mar 12 2013, 07:33 PM
Post #11


Tetris Apprentice
Group Icon
Posts: 147
Joined: 21-November 12



I put the 2 step finesse stuff from the wiki in a spreadsheet to see how many KPT are needed on average (assuming all orientations are equally likely, 180 rotate is used).

I = 43/17
J, L, T = 3
O = 7/3
S, Z = 44/17

So assuming each piece is equally likely, average KPT is about 2.72. My new estimate would then be (2.72/4)*6.667 = 4.533 s

That TAS is a good indication of how far you can push the time. By choosing low KPT piece placements and using DAS preservation you can get well below this average. If we're only interested in the fastest possible time, then you can choose the piece order yourself (as long as it obeys bag).
User is offlinePM
Go to the top of the page
+Quote Post
Anonymous
post Mar 12 2013, 09:33 PM
Post #12


Tetris Professional
Group Icon
Posts: 595
Joined: 29-June 09



Forgive me for the thread jack, but I thought that this was kind of relevant to the topic. Feel free to move the post to a new thread, Myndzi.

I also think it'd be interesting to see how fast a human could theoretically go by doing something along the lines of using the same random seed* (i.e. playing the same piece sequence over and over in multiple games) and seeing how fast they could finish 40 lines.

The reason for this is because 40 lines times are limited by two main factors:
- mental speed (which includes good stacking, how fast you can think to place pieces, etc)
- finger speed (which includes finesse, how fast you can place down pieces, etc)

By providing the same seed (and same piece sequence), the player should be able to create the same stack each game (since he has the same piece sequence). This should effectively cut out the mental speed aspect, since he doesn't have to think as much about what pieces are coming up. In effect, the only real factor is finger speed.

Players could possibly use this to see how fast they could theoretically go based on just finger speed. Likewise, there are games such as keyblox*, where finger speed is not as important as mental speed. Players could potentially use both of these options, which could improve their overall 40 lines skills.

Anyway, this is all conjecture, but I think it'd be interesting to see.

*For those who haven't programmed much, the seed determines how the random number generator creates the random numbers (and in Tetris's case, the piece sequence).

*keyblox is a tetris clone, except each piece placement is mapped to an individual key reducing the key presses per piece to 1.


--------------------
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 Evolution of Tetris
User is offlinePM
Go to the top of the page
+Quote Post
Integration
post Mar 13 2013, 07:40 AM
Post #13


Tetris Professional
Group Icon
Posts: 666
Joined: 9-October 10



QUOTE(UJS3 @ Mar 12 2013, 10:33 PM) *
I put the 2 step finesse stuff from the wiki in a spreadsheet to see how many KPT are needed on average (assuming all orientations are equally likely, 180 rotate is used).

I = 43/17
J, L, T = 3
O = 7/3
S, Z = 44/17

So assuming each piece is equally likely, average KPT is about 2.72. My new estimate would then be (2.72/4)*6.667 = 4.533 s

It's interesting to see the average KPT numbers for 2 step finesse, but you cannot make the assumption, that 1 keypress = 1 frame. Sometimes, you can press keys simultaneously (moving and rotating), but sometimes you need more than 1 frame (DAS and doubletaps).

Let's take the O piece as example. Let's assume, you harddrop 1 frame after your last movement. Those are the frames you need at least (no DAS preservation) for certain spots (without harddrop):

on wall: DAS = 3 frames
1 step away from wall = DAS + tap = 3 + 1 frames
2 steps away from wall = tap + wait + tap = 1 + 1 + 1 frames
1 step away from middle = tap = 1 frame
stay in middle = wait = 1 frame

Now let's take the average (don't forget to add 1 frame for harddrop).

average # of frames = (2*3 + 2*4 + 2*3 + 2*1 + 1) /9 + 1 frames = 3 + 5/9 frames

That are 2.333 KPTs but at least 3.555 frames with 2 step finesse.
User is offlinePM
Go to the top of the page
+Quote Post
UJS3
post Mar 13 2013, 08:45 AM
Post #14


Tetris Apprentice
Group Icon
Posts: 147
Joined: 21-November 12



QUOTE(Integration @ Mar 13 2013, 07:40 AM) *

It's interesting to see the average KPT numbers for 2 step finesse, but you cannot make the assumption, that 1 keypress = 1 frame. Sometimes, you can press keys simultaneously (moving and rotating), but sometimes you need more than 1 frame (DAS and doubletaps).

Yes, good point. I didn't realize you need to wait between double tapping, but on second thought it makes sense Smile.png

For keyblox, the fastest humanly possible time would come down to typing a known string of 100 characters as fast as possible. Apparently 1280 characters per minute has been done, that would give a time of about 4.688 s.
User is offlinePM
Go to the top of the page
+Quote Post
XaeL
post Mar 13 2013, 09:45 AM
Post #15


Tetris God
Group Icon
Posts: 2,918
Joined: 30-June 09



QUOTE(UJS3 @ Mar 13 2013, 08:45 AM) *

For keyblox, the fastest humanly possible time would come down to typing a known string of 100 characters as fast as possible. Apparently 1280 characters per minute has been done, that would give a time of about 4.688 s.

Thats for words though. Keyblox has ;1'23154 all over the place.

You'd have to optimize the piece sequence significantly to get something that was wordy.

Here's an example of something i semi-optimized (tehres like no numbers pressed.. but I didn't optimize it to make it wordy. Also only tried about 20 times):



--------------------
IPB Image


QUOTE(Paradox @ Dec 16 2010 @ 05:52 PM)
Like many setups here, it is useful if your opponent doesn't move and you get 4 Ts in a row.
User is offlinePM
Go to the top of the page
+Quote Post

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

 

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