Hi all, havn't posted anything in a while so how are all of you?
Anyways, I've wanted to make a chess engine since I was little, but the problem is I don't know how to program any AI. And I have a few design issues of my framework/engine that I havn't even started to code yet, still in the design stage. So..... What should the base class include, just to start me off? I'm pretty stuck because a chess engine is extremely new to me and I havn't programmed anything in a while. Is the AI hard to program? Is their any tutorials on how to program AI? If so can somebody please point me in the right direction?
The AI you'd normally use for chess is a minimax tree, which isn't that bad. If you have a class that can represent a board state, let the user change the board state, and evaluate the board state for each player then you have most of what you're going to need. To do the AI you just build a tree where the root is the current state, the next layer is all of your possible moves, the layer after that is all of your opponents possible moves (you might want to start with checkers or connect 4 here because the branching factor on chess is something like 40). Once you have the tree built to a certain depth, you evaluate each board state in the tree and find a path to the end where you go for your highest score while assuming your opponent plays optimally.
I am currently writing my chess engine. If you want some search keywords for google, try minimax, alpha-beta prunning, transposition table, iterative deepening. Here is a tutorial specifically on Chess programming http://www.gamedev.net/reference/lis...categoryid=163
starting from "Chess Programming Part I: Getting Started." Also, if you don't want to write a GUI but want to have one, try writing your chess engine to interface with xboard/winboard compatible interfaces (google "xboard communication protocol"), that is what I am doing now. However, like ichijoji said, I wouldn't recommend starting with chess if you have never programmed any AI before, as the rules of chess is pretty complicated (castling, en passant, promotion, draw by repetition, 50 moves rule etc), and the average branching factor is around 35, which means your code has to be pretty optimized to reach any considerable depth. This is my second AI program, my first one was an AI for reversi (othello), and I would recommend starting on reversi because of its much simpler rules and smaller average branching factor of 8.
For basic Chess AI: http://aihorizon.com/essays/chessai/index.htm
(Though cyberfish's page looks better.)
 Moderators: consider moving this thread to the General AI Programming forum. Just a thought. [/edit]