MisaMino

MisaMino is a singleplayer game that offers a multiplayer-like experience by pairing the player against a computer program (bot, Artificial Intelligence, AI). It uses the Tetris Online Japan (TOJ) ruleset. However, some rules can be adjusted by editing misamino.ini. The AI itself is probably smarter than any human playing at the same speed (provided the speed lies over 1 piece per second). There's also a TOJ Misa-bot, against which you can play online.

Gameplay
MisaMino uses TOJ-stylish guideline rules: Bag Randomizer, Hold feature, 6 Previews, Garbage Blocking and Countering, Combos and T-Spins send garbage, garbage is change per attack (Tetrises send clean garbage). The AI usually goes for T-Spins and Downstack combos. By editing misamino.ini, you can change its playstyle (go for 4-wide, don't use hold, prefer combos over T-Spins) and its smartness (level). Per default, both contestants get the same piece sequence and the AI plays at the same speed as the player. But this behaviour is customizable, too. Moreover, MisaMino has customizable controls and shows some relevant statistics.

The AI
The decisive thing which sets the MisaMino AI apart from other AIs is that it is capable of thinking many moves ahead. For example, the level 6 AI uses all 6 previews, i.e. it does not only consider the current piece, but also all 6 pieces in the next piece queue.

Additionally, it considers moves which require soft dropping the piece all the way to the ground (sonic drop) and moving or rotating (including SRS kicks) it afterwards. This way it is able to perform T-Spin Triples.

Of course, generating all possible playfields (matrices) resulting from placing the next 7 pieces takes way too long. So, the AI generates a limited number of playfields for each level (considered next pieces) before going to the next level. Here's a brief description of how the level 2 AI works (no Hold):


 * Generate all matrices resulting from placing the current piece on all possible spots (level-0-matrices)
 * Assign a score to all level-0-matrices which is a measure for their quality (number of holes, flatness of the surface, cleared and sent lines). Sort the level-0-matrices according to their score.
 * Generate all matrices resulting from placing the next piece into the "best" level-0-matrix (the field with the best score). Do the same for the second best level-0-matrix, and so on. Stop after a while (don't generate the children of bad fields). All resulting matrices are called level-1-matrices.
 * Assign a score to all level-1-matrices and sort them according to their score.
 * As before: generate all matrices resulting from placing the next-but-one piece into the best level-1-matrices; stop after a while; assign a score to all level-2-matrices.
 * Place the current piece on the spot that leads to the best level-2-matrix.