Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to make a match 3 game in C++ and I want to make a best move method to show the player the ideal position to move to get the most amount of points.

The rules of the game are as follows:

  • Pairs of objects adjacent vertically and horizontally can be swapped.
  • You can only swap objects when this will result in a match being created.
  • A match happens when there are 3 or more objects of the same kind adjacent vertically or horizontally.
  • objects that match are removed from the board. objects above a gap will keep fall down until all gaps are filled. New matches made by objects falling into place will be removed with the process repeating until there are no matches left.
  • Points are awarded based on the number of objects removed. The best move for a given board is the one that removes the most objects .

However, I'm stumped for ideas on how to implement such a method. Can anyone give me some ideas on how I can do it?

If you've made a match 3 game, and have implemented a similar method; how did you do it?

share|improve this question
    
Brood force would be try all possible moves and pick the best. –  Maik Semder Jun 2 '13 at 14:54
1  
The answer strongly depends on whether you want to get the most points in one move, or if you also want to set up the board for a more profitable next move (like an experienced human player does). In the latter case the player may not immediately see why the move was so good. –  Dan Hulme Jun 2 '13 at 14:58
2  
There seem to be some ideas in gamedev.stackexchange.com/questions/2607/… –  Dan Hulme Jun 2 '13 at 14:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.