Advice needed in relation of writing a board game.

Started by
1 comment, last by nickelplate 20 years, 7 months ago
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.
Advertisement
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]
Thanks for your input, you indirectly answered my question. I knew about the info you were talking about, it''s just that I misinterpreted the problem.

Cheers.

This topic is closed to new replies.

Advertisement