BrettVsop wrote:The 4 ply in 20 seconds I was getting with AlphaBeta. I reworked some of the code to speed it up and while reworking it I switched back to MinMax. I am sticking with MinMax for a bit until I work out some other problems that I am noticing.
I think some important issues have already been identified within this thread regarding your AlphaBeta version:
- the costs of your way of doing the move legality check are high (I proposed a different, common way to restrict legality check to few cases only, all other moves are 100% legal; also, the legality check may be done within AlphaBeta instead of the move generation, which means to have pseudo legal move generation; but even with fully legal move generation the "restricted legality check" will help);
- the costs of having a poor move ordering are very high, your search visits much more nodes than necessary to get the same AlphaBeta result.
Also, move generator bugs seem to be present ("perft") which should be fixed soon.
Considering these issues I can only propose that you proceed like this:
1. continue with the fastest AlphaBeta version you have available (i.e., the one without legality check) just to save a huge amount of testing time (MinMax lets you wait very long for its result, each time you did a small change takes a couple of minutes),
2. then write a function that checks whether the enemy king is in check (and call it e.g. in the very beginning of each node, so that AlphaBeta returns +INFINITY for illegal positions) [EDIT: you probably have it already but use it within FindAllLegalMoves()],
3. then write a perft function and fix your perft numbers,
4. then add some simple move ordering improvements like iterative deepening, killer moves, MVV/LVA,
[EDIT] 4a. then add quiescence search,
5. then add some very simple and cheap positional evaluation criteria,
6. then implement a simple time control and let your search stop on timeout instead of reaching a fixed depth limit,
7. then play many games with fast time control against other engines to see where you are really standing,
...
99. and much later make small performance speedups with negligible effect on your engine's playing strength.
BrettVsop wrote:- Code: Select all
int CMinMax::GetFutureImbalance(CReferee *chessboard, bool check_white, int iTime)
{
int iValue = Min(chessboard,check_white,iTime);
return iValue;
}
What is the meaning of "GetFutureImbalance", and what does your "Min()" function do?
Sven