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

 
Reply to this topicStart new topic
> Different approach to keyboard mapping, An alternative way to play, including a small script to try it out
Okk
post Oct 10 2018, 12:42 PM
Post #1


Tetris Novice
Group Icon
Posts: 3
Joined: 10-October 18



Here's the keyboard setup i had in mind (actions in brackets correspond to their respective keys)
  • remap [cw] to [cw] + [hard drop]
  • remap [ccw] to [ccw] + [hard drop]
  • remap [180] to [180] + [hard drop]
Or in short, automatically drop the tiles after they are rotated.
This mapping would eliminate a lot of button presses, since you don't have to press hard drop for every single tile.
I can only think of few insignificant downsides
  • you can't do complex twists since the tile will drop after the first one (basic twists are still possible)
  • if you move after rotating (as many do with I pieces on the wall), you have to adjust your playstyle, however it is still possible to keep perfect finesse with this setup
So, to try it out I wrote a small script using AutoHotKey (download here) and I think it feels really natural and fast.
What are your thoughts on this? Could this be viable even on high level play? Would you consider this cheating? Please also let me know if you have issues with the program. Thank you!




User is offlinePM
Go to the top of the page
+Quote Post
Okey_Dokey
post Oct 10 2018, 06:24 PM
Post #2


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



Could be considered cheating. That said, there was a time where I used an AutoHotKey script to play multiplayer in 1-key-finesse style (move + rotate + harddrop in 1 key). Wouldn't work on most clients though (Jstris is the only active client where it would work). Most clients are frame-based; they will not detect ultra-short keypresses. I wonder what those clients would do, if they detect rotation and harddrop in the same frame. I guess they would first rotate and then harddrop (no matter the order in which you pressed the keys) from which you would benefit.

What would you do in the following situation: you want to place a L,J,T,I piece with the majority of the filled cells on the wall?


All in all, I don't think combining rotation + harddrop is worth the trouble. I don't see any real speed advantage in official games. You usually have enough time to rotate the piece (before you reach the desired column), except if you use finesse tricks.
User is offlinePM
Go to the top of the page
+Quote Post
Okk
post Oct 10 2018, 07:09 PM
Post #3


Tetris Novice
Group Icon
Posts: 3
Joined: 10-October 18



Now that you say it, I've noticed this also only works on Jstris unfortunately. Might have to experiment with longer key presses (altough I doubt ahk lets you tune timings that precisely). Your 1-key script actually sounds pretty intriguing but I can't even think about the finger movement..

As for the fumen, you could DAS to the wall and hold left/right while rotating (+dropping). I know it is technically not the correct way to do this but Jstris at least doesn't recognize it as a mistake.

Yeah it probably doesn't save as much time as I initially thought Sticking Out Tongue.png. Thanks for the feedback
User is offlinePM
Go to the top of the page
+Quote Post
Okey_Dokey
post Oct 10 2018, 10:15 PM
Post #4


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



QUOTE
Now that you say it, I've noticed this also only works on Jstris unfortunately.

With working in Jstris, you mean that you can move after rotation in Jstris by pressing down Left/Right while rotating? That's interesting. I suppose you need to have your DAS charged though (having pressed down Left/Right for ~100 miliseconds).

(In the following, I will ignore the move-after-rotation issue.) Longer keypresses in a frame-based clients is no problem in your case. If the client interpretes rotation before harddrop - if pressed down in the same frame -, then you will not lose any time by doing the following:
  • press down rotation & press down harddrop
  • wait 2 frames (to ensure that the keypresses were registered)
  • release rotation & release harddrop
CODE
setkeydelay -1,-1
sendmode input
setbatchlines -1
qs := 23; sleep time
qd := "Space"; drop piece
qc := "X"; clockwise rotate
qi := "Z"; inverse rotate

*s::
send {%qc% down}
send {%qd% down}
sleep %qt%
send {%qc% up}
send {%qd% up}
return

It's more problematic in case of 1-key-finesse because you have to wait between keystrokes. For example, if you tap a key twice ("double tap"), you have to:
  • press down the key
  • wait 2 frames (to ensure that the keypress was registered)
  • release the key
  • wait 2 frames (to ensure that the release was registered)
  • press down the key
  • wait 2 frames (to ensure that the keypress was registered)
  • release the key
So, you will lose 4 frames in that example. Cultris 2 is event-based like Jstris but it has some anticheat code which will detect, if you double tap too fast. So, for 1-key-finesse, you have to wait there, too.

(Heading back to the move-after-rotation issue.) However, Cultris 2 is unproblematic in your case. If you want to move a T,L,J,I piece to the wall, then you could do the following in Cultris 2:
  • detect if Left or Right key is pressed down when rotating
  • if Left or Right: simulate quick keypresses in this order: rotation, left/right, harddrop
  • if not Left or Right: simulate quick keypresses in this order: rotation, harddrop
CODE
setkeydelay -1,-1
sendmode input
setbatchlines -1
; script uses the following keys:
; Numpad4,Numpad6: move left/right
; w, e: rotate clockw. / ccw
; f: harddrop
; assuming the client uses the following keys:
; Left,Right: movement
; x,z: rotation
; Space: harddrop

*Numpad4:: Left
*Numpad6:: Right
*f:: send {Space}

*e::; clockwise rotate
send {x}
if ( GetKeyState( "Numpad4" , "P" ) = 1 )
    send{Left}
if ( GetKeyState( "Numpad6" , "P" ) = 1 )
    send{Right}
send {Space}
return

*w::; clockwise rotate
send {x}
if ( GetKeyState( "Numpad4" , "P" ) = 1 )
    send{Left}
if ( GetKeyState( "Numpad6" , "P" ) = 1 )
    send{Right}
send {Space}
return

So, you won't lose any time in Cultris 2 (you wouldn't lose any time in a framebased-client either, if (and only if) the client interpretes rotation before left/right before harddrop - but that is unlikely). Cultris 2 is also interesting in your case because Cultris 2 allows vertical spawning orientations and 180 degree rotations. With vertical spawning orientations, you will not need to rotate the piece for vertical T,L,J placements in half of the cases, and you only need 180 rotation for the other half of the cases (so placing T,L,J with 3 filled cells on the wall is less problematic).

(The code examples are untested.)
User is offlinePM
Go to the top of the page
+Quote Post
XaeL
post Oct 10 2018, 11:19 PM
Post #5


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



QUOTE(Okk @ Oct 10 2018, 12:42 PM) *

Here's the keyboard setup i had in mind (actions in brackets correspond to their respective keys)[list]

If you're going to go to those efforts, i recommend using something like
Finesse. Though Finesse uses column, rather than "number of left/right keypresses".


--------------------
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
Okk
post Oct 11 2018, 06:47 PM
Post #6


Tetris Novice
Group Icon
Posts: 3
Joined: 10-October 18



QUOTE
detect if Left or Right key is pressed down when rotating
if Left or Right: simulate quick keypresses in this order: rotation, left/right, harddrop
if not Left or Right: simulate quick keypresses in this order: rotation, harddrop

I even implemented this in the script, hoping it would be useful for other games. Actually I press left/right twice after the rotation in case you DAS an I piece but rotate it away from the wall.
Thank you for the code snippets, I'll make sure to toy around with them a bit. Honestly Cultris II doesn't seem worth the trouble with the random spawning rotation.

@Xael thanks for that, never knew this existed. I tried it for an hour but can't really make progress. Guess that takes some more practice
User is offlinePM
Go to the top of the page
+Quote Post
Okey_Dokey
post Oct 11 2018, 07:53 PM
Post #7


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



I played a little with rotation and harddrop combined to one key. It doesn't really work with frame-based clients. And for event-based clients, it's not really multiplayer-suitable. I am also pretty sure, the fastest players would be slower when playing this way because they can't use finesse tricks as effectively.

Here's the AutoHotKey script I used to make rotation possible on the wall: The piece will be shifted sidewards, if Left/Right was pressed down for at least 100 miliseconds when pressing the rotation key.

CODE
setkeydelay -1,-1
sendmode input
setbatchlines -1
qt := 40; sleep time
qd := "f"; drop piece
qc := "e"; clockwise rotate
qi := "w"; inverse rotate
qf := "q"; 180 rotate
ql := "Numpad4"
qr := "Numpad9"
holdTime := 100
holdLeft := 0
holdRight := 0
#MaxThreadsPerHotkey 4

Numpad1::
Send {%ql% down}
SetTimer, timerLeft, -%holdTime%
return

Numpad1 up::
Send {%ql% up}
holdLeft := 0
SetTimer, timerLeft, off
return

timerLeft:
holdLeft := 1
Return

Numpad6::
Send {%qr% down}
SetTimer, timerRight, -%holdTime%
return

Numpad6 up::
Send {%qr% up}
holdRight := 0
SetTimer, timerRight, off
return

timerRight:
holdRight := 1
Return

*v:: send {%qd%}

*d::; clockwise rotate
send {%qc%}
if ( holdLeft )
{
    send {%ql% up}
    send {%ql% down}
    send {%qd%}
}
else if ( holdRight )
{
    send {%qr% up}
    send {%qr% down}
    send {%qd%}
}
else
{
    send {%qd%}
}
return

*s::; counterclockwise rotate
send {%qi%}
if ( holdLeft )
{
    send {%ql% up}
    send {%ql% down}
    send {%qd%}
}
else if ( holdRight )
{
    send {%qr% up}
    send {%qr% down}
    send {%qd%}
}
else
{
    send {%qd%}
}
return

*a::; 180 rotate
send {%qf%}
if ( holdLeft )
{
    send {%ql% up}
    send {%ql% down}
    send {%qd%}
}
else if ( holdRight )
{
    send {%qr% up}
    send {%qr% down}
    send {%qd%}
}
else
{
    send {%qd%}
}
return

Works in Jstris and Cultris II as far as I can tell. And the same script using the same keys as the client:
CODE
setkeydelay -1,-1
sendmode input
setbatchlines -1
qt := 40; sleep time
qd := "f"; drop piece
qc := "e"; clockwise rotate
qi := "w"; inverse rotate
qf := "q"; 180 rotate
ql := "Numpad4"
qr := "Numpad9"
holdTime := 100
holdLeft := 0
holdRight := 0
#MaxThreadsPerHotkey 4

~Numpad4::
SetTimer, timerLeft, -%holdTime%
return

~Numpad4 up::
holdLeft := 0
SetTimer, timerLeft, off
return

timerLeft:
holdLeft := 1
Return

~Numpad9::
SetTimer, timerRight, -%holdTime%
return

~Numpad9 up::
holdRight := 0
SetTimer, timerRight, off
return

timerRight:
holdRight := 1
Return

*f:: send {%qd%}

*e::; clockwise rotate
send {%qc%}
if ( holdLeft )
{
    send {%ql% up}
    send {%ql% down}
    send {%qd%}
;    send {%ql% down}
}
else if ( holdRight )
{
    send {%qr% up}
    send {%qr% down}
    send {%qd%}
;    send {%qr% down}
}
else
{
    send {%qd%}
}
return

*w::; counterclockwise rotate
send {%qi%}
if ( holdLeft )
{
    send {%ql% up}
    send {%ql% down}
    send {%qd%}
;    send {%ql% down}
}
else if ( holdRight )
{
    send {%qr% up}
    send {%qr% down}
    send {%qd%}
;    send {%qr% down}
}
else
{
    send {%qd%}
}
return

*q::; 180 rotate
send {%qf%}
if ( holdLeft )
{
    send {%ql% up}
    send {%ql% down}
    send {%qd%}
;    send {%ql% down}
}
else if ( holdRight )
{
    send {%qr% up}
    send {%qr% down}
    send {%qd%}
;    send {%qr% down}
}
else
{
    send {%qd%}
}
return{%qd%}
}
return

QUOTE(Okk @ Oct 11 2018, 06:47 PM) *
@Xael thanks for that, never knew this existed. I tried it for an hour but can't really make progress. Guess that takes some more practice

In case you want to play this game again, consider using this modded version. It makes some small changes, e.g. moving the current preview into the playfield (instead of showing it on the top of the next piece queue), and it also introduces a 180 toggle key (so you only need 20 keys instead of 40, on the expense of ocassionally pressing 2 keys instead of 1). Here's a video of somebody playing the modded version.
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.