Game Over Detections: a Tool for Tetris Streamers

Started by caffeine, August 14, 2016, 08:40:42 PM

Previous topic - Next topic

caffeine

While streaming Tetris Friends, between games the "wingraphix" will show up where the playfield once was. This creates a jarring, unpleasant effect for stream viewers.

[!--ImageUrlBegin--][a href=\\\"http://harddrop.com/file/pic/gallery/6650.jpg\\\" target=\\\"_new\\\"][!--ImageUrlEBegin--][img width=\\\"500\\\" class=\\\"attach\\\" src=\\\"http://harddrop.com/file/pic/gallery/6650.jpg\\\" border=\\\'0\\\' alt=\\\"IPB Image\\\" /][!--ImageUrlEnd--][/a][!--ImageUrlEEnd--]


This tool automatically detects when a game has ended and triggers an overlay to cover up the wingraphix with a blank playfield. To do this, it watches a pixel on the playfield in order to detect if a game is being played. If it is not, it sends a signal to OBS Studio to make the blank playfield overlay visible. When the next match starts, it hides this overlay. This tool has only been tested on Windows 10 and with OBS 0.15.4 32 bit version.

To set this up, first create a couple of image overlays to cover the playfields with dummy blank playfields. I have included an image I use. For best results, create your own by taking a screenshot of what it looks like on your OBS (while the player's field is blank).

[!--ImageUrlBegin--][a href=\\\"http://harddrop.com/file/pic/gallery/6651.jpg\\\" target=\\\"_new\\\"][!--ImageUrlEBegin--][img width=\\\"500\\\" class=\\\"attach\\\" src=\\\"http://harddrop.com/file/pic/gallery/6651.jpg\\\" border=\\\'0\\\' alt=\\\"IPB Image\\\" /][!--ImageUrlEnd--][/a][!--ImageUrlEEnd--]


Next, you will need to bind hotkeys to these dummy playfields in order to hide and unhide them. We will bind one key to hide both of them and one other key to unhide both of them. The Game Over Detection script will use this hotkey to automatically perform these functions. I chose to set these keys to F23 and F24 since these are almost never used by the general populace. This way, the hotkey will not accidentally type stuff, trigger browser features, etc. Since most keyboards do not have an F23 or F24 key, I have included a small program that allows you to send these keys repeatedly. Open "Set up OBS hotkeys," click the button you need to send, then click on the key binding field in OBS. Once it reads the F23 or F24 key, click stop. Repeat this for the other key bindings.

[!--ImageUrlBegin--][a href=\\\"http://harddrop.com/file/pic/gallery/6652.jpg\\\" target=\\\"_new\\\"][!--ImageUrlEBegin--][img width=\\\"500\\\" class=\\\"attach\\\" src=\\\"http://harddrop.com/file/pic/gallery/6652.jpg\\\" border=\\\'0\\\' alt=\\\"IPB Image\\\" /][!--ImageUrlEnd--][/a][!--ImageUrlEEnd--]


Once everything is set up, it's time to open the Game Over Detection program. When you do, it will prompt you to click on which pixel to watch. I've found what works is the middle of the white bar between the player's rank and his playfield.

[!--ImageUrlBegin--][a href=\\\"http://harddrop.com/file/pic/gallery/6653.jpg\\\" target=\\\"_new\\\"][!--ImageUrlEBegin--][img width=\\\"500\\\" class=\\\"attach\\\" src=\\\"http://harddrop.com/file/pic/gallery/6653.jpg\\\" border=\\\'0\\\' alt=\\\"IPB Image\\\" /][!--ImageUrlEnd--][/a][!--ImageUrlEEnd--]


After that, it will prompt you to click on OBS. After that, the program will run based on those parameters. In order for the program to read the pixel, Tetris Friends must be on top and must not be transparent!
In order to close out of the program, find the AHK icon on the bottom right of the taskbar, right click it, and then click "Exit."

Anyway, I hope you find this useful, and please let me know if you need some help setting things up.

Download:
[attachmentid=1009]

BarelyTherey

#1
YOU ARE A GENIUS!
//vote sticky.

Wojtek

Recommended games:
NullpoMino
Tetris Online Poland