Introducing the AI 'Jeff' that can win first place in the battle royale 'TETRIS 99' where 99 people play Tetris



'

TETRIS 99 ', available to Nintendo Switch Online subscribers, is a battle royal game in which 99 people play Tetris at the same time to determine who will come first. An AI called ' Jeff ' has been released that can become number one in TETRIS 99. Jeff uses computer vision to recognize the placement of tetriminos on the field and uses a depth-first search algorithm to find the appropriate placement of falling tetriminos.

First place in Tetris 99 using computer vision, classical AI, and a whole lot of free time | TetrisAI
https://bpinzone.github.io/TetrisAI/



In addition to the usual Tetris rules, TETRIS 99 adds an additional obstacle: if a player gets a high score, they add tetriminos to the opponent's field. 99 people play at the same time, and the player who survives until the end without succumbing to interference from other players is the winner.

Ben Pinzone and Steven Schulte created an AI that can win first place in TETRIS 99. Below is a video of the moment when the Tetris AI 'Jeff' they created wins first place in TETRIS 99. It seems that Jeff is not yet a perfect Tetris AI, and sometimes he wins first place, but sometimes he loses in 10th to 15th place. If you watch the video below, you can see that the more time passes, the more Jeff struggles to place the tetriminos.

Jeff wins - YouTube


Jeff has three elements:

Eyes: Check the game status from the screen
Brain: Decide where to drop the tetriminos
Hands: Inputting movements into Nintendo Switch

◆ Eyes
Initially, Pinzone and his team tried to use a webcam in front of the TV to read the game situation. However, the image captured by the webcam was of low quality, and they had to adjust the lighting in the room to shoot, among other problems. So Pinzone and his team decided to use an HDMI splitter and capture card to read the video output from the Nintendo Switch directly on the PC.

In Tetris, tetriminos must be placed on a field that is 10 squares wide and 20 squares long, so the playfield is divided into 10x20, and each block that makes up the tetriminos can be recognized individually. In addition, the next tetrimino to fall in Tetris is displayed in 'NEXT' on the right side of the field, and the user can hold the tetrimino that can be dropped freely at their own timing in 'HOLD'. The detection area has been expanded to recognize these as well.



Jeff's eyes were implemented in Python using OpenCV.

Brain
The role of Jeff's brain is to create a text-based representation of the game state and determine what move to make next. To do this, Pinzone and his team developed an algorithm that can grasp the state of the game screen, search all possible sequences of moves in a depth-first search, find the sequence that optimizes the board, and execute the optimal sequence of moves. Pinzone describes Jeff's brain as a 'work-stealing (task-stealing) multi-threaded depth-first search algorithm.'

◆ Hand
Schulte apparently uses a slightly modified joycontrol , which emulates a Nintendo Switch controller via Bluetooth, and writes that 'all credit goes to the developers and contributors.'

GitHub - mart1nro/joycontrol: Emulate Nintendo Switch Controllers over Bluetooth
https://github.com/mart1nro/joycontrol



Jeff can win first place if he can execute the best play, but he usually loses when there are only 10 to 15 players left. 'I'm pretty confident that Jeff can become nearly invincible if we put in the effort,' Schulte wrote. 'However, as development time gets longer, it's becoming less and less likely that we'll be able to make significant improvements to Jeff. I've had a lot of fun developing Jeff, but I don't want to take away the wins of human TETRIS 99 players. So I'm happy with Jeff's current state.'

Jeff's source code is available on GitHub.

GitHub - bpinzone/TetrisAI
https://github.com/bpinzone/TetrisAI?tab=readme-ov-file



in Software,   Video,   Game, Posted by logu_ii