Chess Optimizations

后端 未结 12 743
伪装坚强ぢ
伪装坚强ぢ 2021-01-30 15:03

ok, so i have been working on my chess program for a while and i am beginning to hit a wall. i have done all of the standard optimizations (negascout, iterative deepening, kille

12条回答
  •  遇见更好的自我
    2021-01-30 15:37

    Late answer, but this may help someone:

    Given all the optimizations you mentioned, 1450 ELO is very low. My guess is that something is very wrong with your code. Did you:

    1. Wrote a perft routine and ran it through a set of positions? All tests should pass, so you know your move generator is free of bugs. If you don't have this, there's no point in talking about ELO.

    2. Wrote a mirrorBoard routine and ran the evaluation code through a set of positions? The result should be the same for the normal and mirrored positions, otherwise you have a bug in your eval.

    3. Do you have a hashtable (aka transposition table)? If not, this is a must. It will help while searching and ordering moves, giving a brutal difference in speed.

    4. How do you implement move ordering? This links back to point 3.

    5. Did you implement the UCI protocol? Is your move parsing function working properly? I had a bug like this in my engine:

        /* Parses a uci move string and return a Board object */
        Board parseUCIMoves(String moves)// e2e4 c7c5 g1f3 ...{
            //...
            if (someMove.equals("e1g1") || someMove.equals("e1c1"))
                //apply proper castle
           //...
       }
      

    Sometimes the engine crashed while playing a match, and I thought it was the GUI fault, since all perft tests were ok. It took me one week to find the bug by luck. So, test everything.

    For (1) you can search every position to depth 6. I use a file with ~1000 positions. See here https://chessprogramming.wikispaces.com/Perft

    For (2) you just need a file with millions of positions (just the FEN string).

    Given all the above and a very basic evaluation function (material, piece square tables, passed pawns, king safety) it should play at +-2000 ELO.

提交回复
热议问题