Exactly. The basic routine of almost all Chess programs is something like:
Search(depth)
{
if(ProbeHashTable(depth) == OK) return HashTableScore();
bestScore = -INFINITE;
if(depth <= 0) bestScore = Evaluation();
for(move = NextMove()) {
if(depth > 0 || Is_Capture(move)) {
MakeMove(move);
score = -Search(depth-1);
UnMakeMove(move);
if(score > bestScore) { bestScore = score, bestMove = move; }
}
}
SaveInHashTable(bestScore, bestMove);
return bestScore;
}
(Where I left out the technical details of alpha-beta pruning, but which contains a capture search and transposition table.)
Thanks.
I was thinking about this yesterday, and came up with a solution similar to what you described. Just because the move number is high (say 40) doesn't mean the position is necessarily in the endgame. For example, the Ruy Lopez is really odd-looking because it keeps almost all the pieces on the board for dozens of moves into the game. The board looks like somebody scrambled it from the initial position, without removing any pieces!) Therefore it is largely the number of pieces on the board that determines the "age" of the position. There might be other interesting measures of game age, though, like a count of how far the pieces have moved from their original positions (e.g., imagine a game that went something like 1. Nf3 Nf6 2. Ng1 Ng8 3. Nc3 Nc6 4. Nb1 Nb8 5. Na3 Na6, etc. for a while!). The count of pawn advances might also be a good indicator. An ideal learning system, though maybe too lengthy to be practical, would be to use that age value as a continuous variable that influenced the heuristics proportionally as they were learned.
I think I understand what you're saying about tree search. I suppose after the search, which is done node-by-node without saving all the nodes along the way, reaches its end, an evaluation score is made and assigned to the node that started the search, so the search itself was merely regarded as the scratchpad derivation of the score, and is regarded as unworthy of being saved. (Human memory doesn't work that way--it saves everything it sees, at least for a while, but we'll ignore that observation.) OK, that makes sense, thanks.
P.S.--A quote for nartreb/bertran:
----------
Our starting point [was that] we don't care about intelligence. We really care about just computational speed—what happens, you just put in speed. And it's interesting. For people doing massive computation, that's how you can speed things up, [and it's] a very interesting problem by itself. But, at the end, when we actually tried to beat Kasparov, we realized something: that you really need to put the intelligence in [as well]. You need to put the chess knowledge in. Because then the compounding effect, the fact that search was going to enhance your knowledge, become even more pronounced.
http://arstechnica.com/gaming/2011/08/force-versus-heuristics-the-contentious-rise-of-computer-chess/2/