Archived

This topic is now archived and is closed to further replies.

nickelplate

Advice needed in relation of writing a board game.

Recommended Posts

Greetings all, I''m writing a simple board game to try out some AI techniques I read about recently. I''m not sure about how I should store the information regarding the allowed moves for the player. Is it better to compute all the possible moves for all the pieces in the game at each turn, or see if a move is possible only when the player tries that move? I''m asking better not in terms of performance, but in terms of overall advantages. The moves aren,t complex to compute at all. Cheers.

Share this post


Link to post
Share on other sites
It somewhat depends on the game, but not really. The truth is even tic tac toe you can't really store all possible moves, there's just too many. Chess or checkers or go? forget it. Typically these games have a move generator that for a given position determines all the possible moves at that moment. Then each turn you build a game tree with it.

There is a ton of info on this on the net, it's a very active and popular topic. Google should be very fruitful. It's almost all geared towards Chess, but the general concepts (alpha-beta pruning, game trees, move generators, bitboards, etc) are universal across most games. It's fun stuff.

[edited by - tortoise on September 3, 2003 9:07:51 PM]

Share this post


Link to post
Share on other sites