billa12 said:
Does a chess program game knows every move that you can make?
No, chess has too many moves for that.
The computer performs a mathematical calculation that produces a rating or score for a position. e.g. +1 point per peice, +1 point if it has more board space, etc etc
It then tries different moves and works out the scores for the new board positions and records which gives it the most points. It then does the same for the other player and works out which give the other player the least points. By looking at the chain of moves, and the score differences, it decides what to do. This is called "min max strategy".
The ability of the computer is determined by how good it's scoring formula is, and how many moves ahead it can calculate. I haven't looked a modern chess program but 7 moves ahead (4 for one player, 3 for the other) was about where most chess software was, the last time I looked. They are certainly a lot better now.
Of course in the end game with fewer pieces and moves, it can think much further ahead. They can indeed play "perfect" endgames. In the opening like a human player it can play from a memorised list. There are "standard openings" in Chess that good players will memorise.
Checkers/draughts is simple enough that the computer can determine all possible moves. It could in theory then play from a pre-computed list of moves, but it could also work them out as it needs them, as there are not as many.
billa12 said:
Does this apply to more complex games with open worlds
That is actually really complex and it can't be explained without going into programming. I feel kind of bad about saying that, but I can't really explain how AI of that type works in a few sentences, especially as lot of the logic is now in the game data (i.e. the level data) instead of the core code. If you give me a particular situation in a particular game I can explain how *I* would have done it, but I doubt that's going to the way they did it - there really isn't a standard model for anything more complex than Pacman.
Although I can explain how the Pacman AI works if you want :-)