170 likes | 425 Views
Board Representation. Saboteur. Permanent Brain. Features. Training. The engine that may or may not have beaten your engine. Jamie Morton. Hung Nguyen. Board Representation. Per-side representation Combined representation: standard of modern chess engines (e.g. Stockfish ).
E N D
Board Representation Saboteur Permanent Brain Features Training The engine that may or may not have beaten your engine.. Jamie Morton Hung Nguyen
Board Representation Per-side representation Combined representation: standard of modern chess engines(e.g. Stockfish)
C/C++ Usage • Bit hacks at http://graphics.stanford.edu/~seander/bithacks.html • Assembly instructions can speed up bit manipulation instructions • Ambitious project to generate all board transpositions – failed because of 16GB memory limit • Initial usage JNI to interface Java with C/C++
Communication • C++ threading is not used becauseVS 2010’s compiler is not C++11 compliant and Boost is not installed in BEN 002 • Java threading is used because java.util.concurrent.Future<V> has a cancel(bool) method
Permanent Brain • Permanent brain, or ponder, is the ability for a chess engine to think out-of-turn • Java program communicates with the C++ process through standard streams • All the threading, time management, etc. is done in Java
Permanent Brain (ctd.) • Once the Java getMove(GameState) method has found its move, it: • makes the move by changing the GameState • sorts the best 15 moves for the opponent • starts 15 threads from a reusable pool • each thread starts a C++ executable to find the best move for each of those board positions
Permanent Brain (ctd.) • Once the opponent has made a move • If the move was already being considered, it is considered a ponder hit: • all other threads are cancelled • the main thread blocks until the ponder thread returns a move • Else, the main thread will: • cancel all threads • find its own best move
Features • distance_to_goal • - • supported_piece • count_piece • - • threatened_piece
More Features • charlie_piece • breakthrough_piece • max_column_dif • min_column_dif • reinforce_columns • reinforce_ground • indispensible_piece Offensive Defensive
Evaluation Function • Features vector • WWeights vector • H Evaluation function + • How to choose the best weights? • Winning game > losing trivial piece
Test Bed • Python interface • Hosts 2 game matches • Adjust player parameters • Determines winners Test Bed Tournament.jar Saboteur.jar Params1.txt Params2.txt
Experimental Methods • Hilling Climbing • Adjust parameters at 0.1 increments • Pros: Easy to implement • Cons: • Many plateaus • Not precise • Gradient Descent • Adjust parameters via steepest slope • Pros: Guaranteed to converge • Cons: Hard to calculate • Evolutionary programming • Breed winning players
Training Player Queue W Initial Player W )
Training Player Queue Battle Zone
Training W Player Queue Battle Zone
Things to Consider • Draws? • Over 50% of all matches are draws • Parameter Convergence • Takes around 100 games to converge • Altogether over 30,000 games have been played • Converges to {1,0,0,0,…} More features?
Questions? “These are not the questions you wanna ask,” Obi-wan.