Solve this problem (hard)
Dave Mark - President and Lead Designer
Intrinsic Algorithm - "Reducing the world to mathematical equations!"
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
It looks like you are using a linear scoring system where 1 block = 1 point. I don't believe that's how the Same Game is usually set up... it's an exponential system so that if you can manage to get larger blocks together by removing smaller, meaningless combos, you get more points. That IS a very different sort of problem from what you are asking above... which do you want to solve?
Dave Mark - President and Lead Designer
Intrinsic Algorithm - "Reducing the world to mathematical equations!"
[edited by - InnocuousFox on April 24, 2003 9:25:13 PM]
[edited by - InnocuousFox on April 24, 2003 9:25:45 PM]
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
Perhaps if it is in the fewest possible moves it will help the score a little too, but I am just looking for an algo to clear the board right now. .sen
quote:
Original post by InnocuousFox
Question: you said "solve". The point of the game is to get the highest score possible, not to remove all the blocks. Certainly being able to remove more blocks helps with the score, but the true maximization of the score comes from removing large, contiguous blocks.
That is not exactly true. Some implementations of the game give a large bonus for clearing the board. One I know of multiplies your score times 5 if you clear the board, so clearing the board should yeild the highest scores, although it''s theoretiaclly possible to get a higher score even without a 5x boost.
Unfortunately, there is really no standard scoring system. Some give you (N - 2)^2 points for clearing N squares in one turn. Others give 2^N.
I would think "solve" means to clear the board.
However, I think this problem could be solved using reinforcement learning with a neural network. At least to some extent. What I would do is train a network to try and solve the game. Ie maybe for the inputs you use the all the squares within 5 units on any given side. To make it simple you could maybe just represent them on weither they are the same or different than the one being considered. So 0 for different and 1 for the same or something. Using a simple Q-learning type alg you could train the network with an imediate reward (easy to calculate) and future reward (the preditction from the NN). The output of the neural network could be the % of those pieces looked at for the inputs, that you would expect to have by the end of the game (ie % of them that you got rid of). Then to pick the move you just have to examine each square, feed the inputs into the network, and pick the one that gives the highest imediate reward + NN output * num pieces. This would be more efficient, as your only looking at < ~20 different combinations each move. You let the NN estimate what happens at the higher depths. You'd only have to take the inputs around those valid moves (which i assume you already have a method to find) and put them into the network.
I think this would work fairly well. but, it will probably fall apart a little at the end. Once you reach a certain point (ie 50 blocks left or something) you could do a brute force search of what is left (end game type strategy) and find the path that will give the best solution.
I think it would work, if it had enough practice games at least... you might be able to represent the inputs into the network better too, and could maybe come up with a better way of picking the piece.
[edited by - drjonesdw3d on April 25, 2003 4:52:37 AM]
I just enumerate all the choices at state 0 (the start of the game), then I use a neural net to trim that down (deleting 10 of the worst ones maybe?) Then enumerate all the next choices and their states, and trimming that down by 50%, and so on, untill an answer is found.
I don''t know too much about neural nets or GA''s, I have fiddled with a program that uses them before, but I wouldn''t know how to make one from scratch. .sen