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

10 Pages V  1 2 3 > »   
Reply to this topicStart new topic
> The T-spin AI bot (MisaMino ver 1.4.5 1111), turn-based mode and normal mode Tetris
misakamm
post Jul 15 2013, 12:42 PM
Post #1


Tetris Novice
Group Icon
Posts: 49
Joined: 14-July 13



Hello everyone, I'm a fan of Tetris, and also a programmer.

Recently I'm making a bot which focuses on playing competitive Tetris games.
But I don't play quite well, it improves so fast and it's almost unbeatable for me now...

Here's the demo program where you can play against it.
full version (include bgm&sfx):
click here (Windows Platfrom) Updated At GMT 2013-11-11 14:30. host by kingofstackers

no bgm&sfx version:
click here
bgm&sfx pack: click here
screenshot:
IPB Image


Update Log:
2013-11-11 improved AI; pieces ratio setting in turnbase mode; fix some bugs
2013-10-06 improved AI, new AI style; garbage blocking setting; fix some bugs
2013-09-16 improved AI, new AI style; grid display
2013-09-10 include TOJ AI, more custom AI settings; improved the demo AI project; some other bugs fixed
2013-09-01 new name of this AI; some bugs of AI fixed and parameters adjusted; ai dll interface and sample dll project package; some other bugs fixed
2013-08-22 more sfx settings; TOP BGM support added
2013-08-21 TOP sound effects; more items in statistics; controls configuration key changed to F12; more das settings
2013-08-15 improved AI (max level8); 4-wide combo strategy switch; Tetris Friend combo table support; fix a crash problem (0815); Automatic leveling down (0815)
2013-07-31 improved AI; add 4-wide combo (level 7 AI only); attacks cancel; nobuffer; same sequence control
2013-07-24 improved AI; add level7; 180 rotate; normal game mode
2013-07-20 Add a softdrop option and improved AI
2013-07-17 Add a config file to set AI searching depth and garbage style
2013-07-15 First preview version

★Game rule:
Tetris guideline, with TOJ vs-rule, 1v1.
turn-based game by default, player first.

some exceptions:
no lock-out death, no falling speed, no slide move limit, only lock when hard drop key pushed.

★Default controls:
move left ------------- left arrow
move right ------------ right arrow
soft drop ------------- down arrow
hard drop ------------- space
rotate ccw ------------ Z
rotate 180 ------------ X
rotate cw ------------- C
hold ------------------ V

★Functional keys:
Press F12 to config your own controls (saved automatially). ESC cancel current settings.
Press F2 to restart the game (after finishing a game or before 10 pieces are locked).
Press F3 to toggle garbage buffer height display.
Press F4 to toggle grid display.
Press F5 and F6 to adjust SFX & BGM volume.

Default DAS is 8 frames under 60fps.

★Config:
In file "misamino.ini"
CODE
section "AI"
        "delay": AI think delay ( enable when turnbase=0 )
        "move" : AI move delay ( enable when turnbase=0 )
        "4w"   : Enable AI 4-wide combo strategy, but only enable when level>=6 and toj rule (combo table=1 or 2; tspin/tspin+/ren AI; garbage buffer, garbage blocking and garbage cancel on)

section "AI_P1" and "AI_P2"
        "style": The style of AI, P1 default is 0, P2 default is 2, style list:
0, human
1, T-spin+ AI
2, T-spin
3, Ren
4, non-Hold
5, Downstack
-1, Use the dll plugin specified below.

        "level": The level of AI is between 0 to 8. Default value is 4
        "PieceMul": In normal trunbase mode, setting the ratio of pieces (integer only)
        "dllplugin": AI dll plugin file path for player. set style=-1 to enable this plugin

section "Rule"
        "turnbase": Turn-based game, 0 to have real-time game using the delay values above.
        "KOS_turnbase": 7 pieces a turn
        "spin180" : allow 180 degree rotate if set to 1
        "GarbageStyle" : Garbage line style. 0 means TOJ style; 1 means messy style (hole change every 2 lines); 2 means more messy style (hole change every line)
        "GarbageCancel"  : Allow garbage cancelling. Default is 1.
        "GarbageBuffer": Attack applies immediately if set to 0, like in older games / hangame.
        "GarbageBlocking": Clearing lines prevents the garbage from rising.
        "samesequence": P1 and P2 will have different piece sequence if set to 0.
        "combo_table_style": 0 means the combo table is [0,0,1,1,2], 1 is TOJ combo table, 2 means Tetris Friend E+ combo table. default is 1

section "Player"
        "das": The das setting, 8 frames default.
        "softdropdas": softdrop das setting, 3 frames default.
        "softdropdelay": The softdrop delay, 10 is default, means 10 * 0.1 = 1 frame

Note:
when 4-wide combo strategy is enabled, it will NOT stop after receiving garbage until AI wants to attack.

plugins:
dllai.dll ---- baka(9)
jim_ai.dll ---- jim ai
tojai/tojai.dll ---- tojai


Have fun, and any feedback or suggestion is welcomed. My skype name is 'misakamm.com'




--------------------
User is offlinePM
Go to the top of the page
+Quote Post
XaeL
post Jul 15 2013, 02:18 PM
Post #2


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



Not bad. I won the first two games, but then it beat me when i wasnt thinking too hard.

Could you make it make its move instantly?


Its annoying stopping between each piece.


--------------------
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
misakamm
post Jul 15 2013, 02:45 PM
Post #3


Tetris Novice
Group Icon
Posts: 49
Joined: 14-July 13



QUOTE(XaeL @ Jul 15 2013, 02:18 PM) *

Not bad. I won the first two games, but then it beat me when i wasnt thinking too hard.

Could you make it make its move instantly?
Its annoying stopping between each piece.


I adjusted some parameter a bit, and now the player is allowed to move freely, and it seems the new one plays a bit better?


--------------------
User is offlinePM
Go to the top of the page
+Quote Post
oofw
post Jul 15 2013, 04:19 PM
Post #4


Tetris Novice
Group Icon
Posts: 64
Joined: 14-June 13



is it decision tree based or .. something else ?


--------------------
Stream : www.twitch.com/oofw
http://oofw.blogspot.ca/
Tetris fanfiction

User is offlinePM
Go to the top of the page
+Quote Post
Integration
post Jul 15 2013, 05:13 PM
Post #5


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



Oh a nice bot (and game) you have there. The bot would have beaten me, if I had tried to play faster.

Can you say some words about the bot? How many moves does it think ahead (previews)? Does it check to use hold several times in a row? Can it switch tactics, e.g. trying more to downstack when it is near the top? Does your playfield influence its decision? For example you send 4 lines and the bot can do a double, but spares to do as to accept clean garbage and send back messy garbage.

my suggestions:
1. Allow the player to tweak the ruleset. Games tend to be long for me (without combos). So I'd like to see an option to disable garbage blocking (delaying insertion of lines by clearing a line). You can beat the bot easily with a 4-wide. So I would add an option to weaken long combos, e.g. increasing your combo sends 3 lines at most.
2. Add additionally softdrop. Having sonic drop is nice, but sonic drop doesn't replace completely softdrop.
User is offlinePM
Go to the top of the page
+Quote Post
misakamm
post Jul 16 2013, 02:54 AM
Post #6


Tetris Novice
Group Icon
Posts: 49
Joined: 14-July 13



QUOTE(oofw @ Jul 16 2013, 12:19 AM) *

is it decision tree based or .. something else ?



QUOTE(Integration @ Jul 16 2013, 01:13 AM) *

Oh a nice bot (and game) you have there. The bot would have beaten me, if I had tried to play faster.

Can you say some words about the bot? How many moves does it think ahead (previews)? Does it check to use hold several times in a row? Can it switch tactics, e.g. trying more to downstack when it is near the top? Does your playfield influence its decision? For example you send 4 lines and the bot can do a double, but spares to do as to accept clean garbage and send back messy garbage.



it behaves like AIs for chess games, the actual depth of searching depends on the number of states evaluated, 4 next pieces are used in most cases. the strategy smoothly changes for different height. currently it doesn't see the opponent's playfield


--------------------
User is offlinePM
Go to the top of the page
+Quote Post
caffeine
post Jul 16 2013, 03:13 AM
Post #7


Tetris Grand Master
Group Icon
Posts: 1,752
Joined: 27-June 09



QUOTE(misakamm @ Jul 15 2013, 09:54 PM) *

the strategy smoothly changes for different height. currently it doesn't see the opponent's playfield

Interesting. Does it do something like optimize for adds/tetromino the lower it is and then garbage cleared/tetromino the higher it is? I was actually thinking of an AI strategy similar to that: always take the route that maximizes (adds + garbage cleared)/tetromino.
User is offlinePM
Go to the top of the page
+Quote Post
misakamm
post Jul 16 2013, 05:36 AM
Post #8


Tetris Novice
Group Icon
Posts: 49
Joined: 14-July 13



QUOTE(caffeine @ Jul 16 2013, 11:13 AM) *

Interesting. Does it do something like optimize for adds/tetromino the lower it is and then garbage cleared/tetromino the higher it is? I was actually thinking of an AI strategy similar to that: always take the route that maximizes (adds + garbage cleared)/tetromino.

current way of evaluating a situation is not simply based on the number of attack lines sent and garbage lines digged, or it'll be hard to make various types of t-spins. in fact it evaluates a move by its attack efficiency and the shape of the field, and many other parameters.
the weakest point of it is unable to stack for 4w, i've been trying quite a few ways but no one looks successful.


--------------------
User is offlinePM
Go to the top of the page
+Quote Post
insatiate
post Jul 16 2013, 06:41 AM
Post #9


Tetris Novice
Group Icon
Posts: 25
Joined: 6-May 13



Nice work. Question: can [the bot] use twists other than T?
User is offlinePM
Go to the top of the page
+Quote Post
misakamm
post Jul 16 2013, 07:15 AM
Post #10


Tetris Novice
Group Icon
Posts: 49
Joined: 14-July 13



QUOTE(insatiate @ Jul 16 2013, 02:41 PM) *

Nice work. Question: can [the bot] use twists other than T?

it can use and sometimes make (if necessary) all types of spin slots


--------------------
User is offlinePM
Go to the top of the page
+Quote Post
Kitaru
post Jul 16 2013, 08:08 AM
Post #11


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



Would you consider making the source code available or documenting the bot's strategy? I believe it would be a valuable contribution to the general knowledge of Tetris AI.


--------------------
My Backloggery
User is offlinePM
Go to the top of the page
+Quote Post
oofw
post Jul 16 2013, 08:18 AM
Post #12


Tetris Novice
Group Icon
Posts: 64
Joined: 14-June 13



surprisingly strong... somewhere around the 10th straight loss i had a vision of a future where humans have been m ade redundant... i trembled in fear...

also the tetris game is very well made (in my opinion)


--------------------
Stream : www.twitch.com/oofw
http://oofw.blogspot.ca/
Tetris fanfiction

User is offlinePM
Go to the top of the page
+Quote Post
insatiate
post Jul 16 2013, 08:49 AM
Post #13


Tetris Novice
Group Icon
Posts: 25
Joined: 6-May 13



<too many losses later>

Very nice work Smile.png
User is offlinePM
Go to the top of the page
+Quote Post
Integration
post Jul 16 2013, 08:57 AM
Post #14


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



I had a few more games. Your bot is really clever. But I don't like that garbage is so clean in TOJ style. When I play, games are nearly endless, and I am not sure if disabling garbage blocking would even change that. Can you make options to make the garbage more messy? For example 100 % change of attack (current attack uses a different garbage hole than your last successful attack). Or changing garbage hole within an attack, e.g. after every 2 lines (that means a Tetris would send garbage like 2 Triples; a B2B Tetris would send garbage like 2 Triples and a Double).

You said your bot tries to have a search depth of 4. Can you also make a version with a maximum search depth of 3? This means the game would work better on slower PCs and the bot would be a better match for beginners.
User is offlinePM
Go to the top of the page
+Quote Post
oofw
post Jul 16 2013, 09:51 AM
Post #15


Tetris Novice
Group Icon
Posts: 64
Joined: 14-June 13




i think allowing the user to set a speed for the bot would also be nice , if you plan on developing this game further


--------------------
Stream : www.twitch.com/oofw
http://oofw.blogspot.ca/
Tetris fanfiction

User is offlinePM
Go to the top of the page
+Quote Post

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

 

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