Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Tetris AI

Name: Anonymous 2010-06-08 3:34

Help, I want to implement an AI in my Tetris game but there aren't many good resources about it and I can't figure out what this guy is talking about: http://www.vidarholen.net/contents/junk/tetris/

When a piece drops, it simple goes through all rotations and horizontal movements of these to find the place where it's best to drop, for some definition of best. In this case is the total mass of the board where the weight of each square is the cubed distance from the top, minus a big penalty for each covered hole.
That didn't say much, I suppose. Let me try again: for each non-empty square (x,y), sum up y^3. Subtract the number of empty squares with a filled square over it (ie, they are unreachable by dropping blocks).

Besides the first paragraph being slightly nonsensical, I get lost at "Subtract the number of empty squares with a filled square over it".  Does that mean to take the total number of empty squares that are unreachable, and subtract that number from each y^3 that I calculate?  And then after I've done this for each non-empty square, am I meant to choose the highest value or lowest value to drop onto?

Name: Anonymous 2010-06-10 15:27

http://www.gamedev.net/community/forums/topic.asp?topic_id=391139
- when dropped, count the number of edges on your block that are touching the edges of block already dropped or those which are touching the wall or ground.
If you implement this algo, you will see it will start building in 'V' shaped formations of blocks. To avoid it building too much formations on the sides, penalize height. So for any given rotation and position of blocks, the score is this:
(number of edges touching) - (average block heigth / total height).


Can anybody figure out what total height is supposed to be there?  The sum of the height of each filled block?  It would seem to mean that, but when I calculate the average block height I am already dividing the total height by the number of blocks, and dividing the average by the total height again just gives me a really small number that wouldn't influence anything.  I wish people wrote coherently on forums.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List