Added: 5 years ago
From: badmephisto
Views: 39,710
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (109)

Sign In or Sign Up now to post a comment!
  • if this works for tetris battle on facebook...

  • The song is called TETRISED TO DEATH. LOL

  • the |numbers| go down as the number tetris blocks go down

  • welll... it's easy to say that it's much much better than me

  • I want this bot!

    Yo're a great man!

  • What's the song please ?

  • @Ckrooss - I think it's "Road to Zion" from the Matrix soundtrack.

  • " but at this pace, it will start hunting John Connor very soon. "

    and then it will become the govenor of california?

    nice work, all we need is to have it advance in the levels

  • I haven't analysed the entire vid, just noticed that at 1:30 it puts that bright green L the other way around...

  • Even though this AI is old, playing against him would be almost like LTris.

  • wow awsome

  • What's the name of the song?

  • It's from The Matrix - Clubbed to Death

  • Thx

  • It was on the matrix, but it's from the artist "Rob D" or Rob Dougan - Clubbed to Death.

  • song?

  • That was awesome. Good soundtrack too.

  • did you have to make the game tetris in python?? and also is this abunch of if then and else lines of programming or is it more complicated

  • yes the game is first made in python, and then there is an AI module built on top of that. And its much more complicated than if statements :) Classes, method calls, loops etc

  • omg sorry for being so interested but how are you running this? did you turn it into a exe gui?? and how did you do tht lol thanks

  • HAHHAHAHA funny comment at the end of discription

  • I sense future screensaver

  • Lol, that's cool. 5/5 *

  • What language did you write this in? or whatever..i wanna learn to program stuff like this

  • from the scrolling side bars it looks like C

  • Well, the name at the top of the window is "PyTtris". Py being the common prefix for things written in Python.

  • LOL, that was cool.

  • Wow. This really got off topic...

    On topic: Is this the speed it really plays at? Looks pretty sick :)

  • you should make it able to hook into browser based games, if thats even possible. im sure it is, it would be like cheat engine or mhs

  • hahaha no...

  • yeah it would defiantly be possible...

  • Hey man, I know this game, bastet. It is named after the 2 words, Bastard Tetris.

    It calculates what would be the worst block to play with, instead of dropping blocks in random order.

    I wonder who would win the game. His ai or yours ;)

    If you want to, I could send you a link, it might be interesting!

    Daniel

  • i know it. i played it. its mean :D

    there would be no way to "hook" the AI into that program, because its nan executable. I suppose if i had the source I could re-implement the AI in there. but I wouldnt want to do that :)

  • I would imagine that only the current state of the board is taken into account for the next move, there is no need to take past moves in to account it's not really relevant when playing tetris...

  • Is there a place I can download this?

  • John Connor has no chance

  • man do you consider past plays? or just evaluate the actual state of the board and the next 2 moves to make? and how exactly do you determine the heuristic from the current board? i am truly impressed! =D

  • YAY TSCC...call it the Arab instead of the Turk

  • test

  • Oh and one more thing :).. what are the values flowing up on the left?

  • thats the score of the move it just made. And it gets better all the time progressively because it uses an algorithm that determines better ways of playing throughout

  • Ah, i get it thx...

  • wow, I'm really impressed ;).

    BTW is this a self improving AI or some sort of pre-made algorythm?

  • awesome vid... but I spotted some flaws, for example putting the T piece where it would create a gap, other than that, nice job!

  • What programming language did you make this in? Pretty impressing I must say :)

  • wow, insane

  • actually its pretty crappy :). This is an old video, and I've improved it considerably since then. I may upload the new version someday.

  • cool vid... consider putting the code online to share? uploading onto google code will be great!

  • :)

    loved the description.

    Made me laugh :D

  • hi badmephisto, may I inquire as to what search strategy you adopted for this? is it greedy? A* star?

  • no. I have a function that can evaluate a board, and returns "goodness" of that board as a floating point number... so I just loop all possible places to drop this block in, and then run that on all states, and take the max. So it is greedy I suppose. This implementation is not too sophisticated but as you can see it can do quite well. Since then I have developed much more sophisticated techniques, but yes they are all greedy. I think its a suitable approach to the problem.

  • because it's totally impossible to hear one song too many times...

  • This is not a complex problem for a computer... the environement is easly specified, the actions are so limited, and the evaluation function is "the less it is heigh the best it is"

  • hahaha oh man you are so wrong :) That's more like what I thought when I first started the project... little did I know... I urge you to try implement that heuristic you conceived of there. Hilarity will ensue, I guarantee it :p

  • have you got the source code for this? fancy distributing it? google code is nice ;)

  • :O Nice, <3 AI

  • i've always wondered..is it possible to beat tetris.. like deplete all the blocks.. and boom! you become champion of the world!

  • well... no. And you cant even beat tetris. There exists a sequence of blocks which I can give you to guarantee that you loose.

  • What is it??

  • sure you can beat tetris, at least a version ive seen.

    when you win mario and his friends come on the screen lawl

  • Chuck Norris did it, he bet tetris...^^

  • hehe.. hunting down John Conner. That'd be sweet

  • ...one block at a time :)

  • His days are numbered. >=)

  • I want to learn to do this,is it hard?what should I study?

  • well depends on your age and programming experience. I use python to do my programming usually. Pygame is the library used to do the actual graphics

  • XD sorry I have no experience,im 17 and about to go to college,but I want to learn,any tips?

  • ok well i've been programming since i was about 6... so about 15 years now. I don't know how hard it is to pick it up from scratch. I would imagine trying Python would be easiest. And maybe getting an actual book for this kind of thing because it provides a clear linear way of making something, and takes you through necessary concepts one by one

  • alright I´ll save for a laptop,and when im ready may I ask where to dowload or buy this programm?really,thanks.I need to begin working hard

  • Can it lose?

  • Song is from Matrix :p

    Nice program, looks great !

  • Song is familiar but I can't remember what it's from.

  • Nissan Maxima commercial

  • Watch out my Tetris playing AI (TetrisAnalyzer), just click on the link "tengstrand". In "Normal mode" showing the next piece and no deep search (Next=On, Level=2), this algorith has made 100,000,000 lines in four days without filling the board more than 55% any time (100 dots on a 10x20 grid). When only knowing the falling piece (Next=Off, Level=1) it makes 1,800,000 lines in average and sometimes > 10,000,000 lines in a speed of over 6000 pieces per second! (on a 2,8 Ghz Pentium).

  • Testing...

  • At 0:42 you can clearly see that the AI is "waiting" for a yellow block to maximize points... freaky :)

  • It's freaky that you can program a computer to play tetris. Is that anything similar to what is happening when you watch a game demo or is a demo just the recording of a human player? Dude you are bringing us closer to judgment day... lets hope this computer doesn't become self aware.

  • lol! no, you dont have to worry about that. The computer here is just blindly following a set of simple rules that I define for it. Its not really making any type of decisions on its own, its just crunching numbers. There is no danger... yet :)

  • Looked like some sort of TAS, nice.

  • what did you base the placement and orientation of the piece on? e.g. solving 1 line; solving a few lines; probability of best line completion depending on current state? Also did u ever get into any bad habits with finger tricks on the cube that you got out of?

  • lol is that a series of terrible puns?

  • lol no, i was being serious. i know nothing about programming :) how does the program determine where to put the pieces? i haven't been cubing long enough to make puns! once i get to sub. 30 i'll start making them :p

  • well we give it simple set of rules it should follow, loop all possible places it could put it in, and run our "evaluation function" of the board on that and try to evaluate how good a board is, and then pick the best and do the corresponding move that leads to it. For example, having holes is bad. Having many blocks is bad. Having places where not too many patterns after this one could fit in is bad. That kind of stuff.

  • OMG i thought i was a good programmer s*t man this is good

  • cool :D and python is great language :S but i have must use c# and php for my job:S :P

  • C(dammit, apple keyboard, no hash)? **throws up**

  • you can just press alt-3 to get #

  • Me <3 python

  • What language is it written in? and is there any way you would put up parts of the source for me to look over dumbfounded? :p

  • its python, and no :) the code is a mess :p

  • dude, if you teach a computer to play tetris then it's only a matter of time before the machines take over!

  • actually, that's false. The program wasn't taught anything. it follows blindly a mathematical formula that I give it. There is much more involved in intelligence. Let me just assure you that unless a huge groundbreaking discovery is made, computers aren't taking over for at least the next 100 years :)

  • buzzzz killer

  • cool. How long is the program?

  • decently long, but not too long. i wrote it long time ago. if i had to guess, just below 1000 or somewhere there. most of it is visual stuff and interface of course

  • nice idea. i would like to know how that algorithm works.

  • Very good job!

  • so the computer THINKS in which to put the piece in a postition on it's own?

  • ummm... i suppose so? it's got a genetic algorithm to help it figure out where to put a piece yes

  • i wonder what would the programming code would do if the blocks got to the top and it lost?

  • well... that's pretty easy to asnwer: the game would restart... lol?

  • The tetris AI apocalypse is coming soon thanks to gentlemen like you. X)

  • Amazing idea!

  • nice one!!! :)

  • cool

  • But it doesn't look half as pretty as yours =(

  • How does this perform on a standard board? I made a Tetris AI but just experimented with different weights. I got tired after completing 40,000 lines, but I'll leave it on overnight and see what happens. I also programmed in Python, and tried many ways to optimize it for speed, so it eliminates 100 lines every 5-6 seconds.

  • where did you learn how to do that??

  • well i'm in a university doing a computer science major, but this program has nothing to do with the kind of stuff we do normally... this is AI & Genetic Algorithms... so in that area i'm completely self-taught

  • Very cool video, 5 stars and a comment from me.

  • That looks pretty good!

  • hi joel, thanks! Please get your site back up I need it, kthx :)

  • very good job... Which AI tool did you use for solving it?

  • ?? what do you mean? i used genetic programing, and the implementation is in python. More or less a guess&check thing, and just pick out the vector of weights that gives best results after a few generations of induced mutations

  • Good job...keep working ;)

  • great job

  • Not a bad start.

    I am currently in the middle of trying to create the world's best Tetris playing agent for an academic project - at the moment it is already routinely getting over 5 million lines.

    Care to try and beat that?

    If you are feeling brave the highest 'lines made' by an AI that I can find in a published academic paper is 480 million - they only let that algorithm run once as it took so long to finish!

  • The AI seems to push blocks on top of covered empty spots, which is bad if the straight doesn't come for a long time (I've died many times in tetris with a full screen and only needing a line). I'd suggest a negative score on dropping on a covered empty.

  • what's the name of the song?

  • clubbed to death, its from matrix

  • did you train it by inputing the moves of a human player?

  • I think the program simply analyzes the positions and the form of the actual stone and calculates, where it fits best.. that'd be the easiest way in my opinion.

  • I can do this too, but at last it will go to stage 9 or 10, the blocks will move too fast for anybody to do it. If it always stays at stage '0' like this one, it will never finish either.

  • that stage thing is arbitrary. It is unlike in real Tetris. That stage is defined in my program for number of times a block drops. But since the AI decides where to drop the block instantly, it has no time to drop... I guess my answer to that is just that that Stage you see there does not really reflect the Stage you would have in a regular tetris. Its not the same thing. Same goes to the Points.

  • on gameboy advanced tetris you can keep pressing the spin piece button and it never lands then tap left or right and it will rotate over other pieces. using this method level 9 and 1o become much eaiser.

  • What is the record??

  • on that particular version it was around 13000. Since i posted this video though i reworked the points system to simply count the number of blocks dropped and reworked the AI kernel altogether, so i am currently in the process of fine-tuning that version. You can expect a video (in the worst case) in around next month... I have tests coming up :)

  • hmm intresting... quite complex isn't it?

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more