Page 1 of 1

Advice to improve my AI

Posted: Tue May 16, 2017 8:24 pm
by caza
Hello I'm currently programming an AI for chess in Java, I have an Alphabeta algorithm with memory ( Transposition tables ), I'm using multi-thread at the root node. Also I'm using quiescence search with only capture move.
For the moment Alphabeta is with depth = 4 and quiescence depth = 3. On average it takes around 20 seconds to find the "best" move. I sort the list of move by placing first all captures.
For the evaluation I'm using material balance ( Queen : 900, King : 0, Pawn : 100, Bishop : 330, Knight : 320, Rook : 500 ), Piece-Square Tables for each sides and pieces and I add the number of possibility.
I have tried Alphabeta with depth = 5 but it takes more than 1 min.
I would like to know how many time takes a "good" AI and if you have some advice to improve my AI.
thanks you =)

Re: Advice to improve my AI

Posted: Fri May 19, 2017 7:05 pm
by H.G.Muller
Micro-Max 1.6, which uses no pruning except alpha-beta, has no hash table, and uses a recapture extension (on the same square) throughout the search instead of a quiescence search needs immeasurably short time (less then one system clock tick) to reach depth 4, and 38 sec to reach depth 8 (on a 3.4GHz i7).

Re: Advice to improve my AI

Posted: Sat May 20, 2017 1:35 am
by User923005
caza wrote:Hello I'm currently programming an AI for chess in Java, I have an Alphabeta algorithm with memory ( Transposition tables ), I'm using multi-thread at the root node. Also I'm using quiescence search with only capture move.
For the moment Alphabeta is with depth = 4 and quiescence depth = 3. On average it takes around 20 seconds to find the "best" move. I sort the list of move by placing first all captures.
For the evaluation I'm using material balance ( Queen : 900, King : 0, Pawn : 100, Bishop : 330, Knight : 320, Rook : 500 ), Piece-Square Tables for each sides and pieces and I add the number of possibility.
I have tried Alphabeta with depth = 5 but it takes more than 1 min.
I would like to know how many time takes a "good" AI and if you have some advice to improve my AI.
thanks you =)
There are 4,865,609 possible chess positions up to ply 5.
Even pure mini-max should achieve that very quickly.

I guess you are doing something strange like zillions of:
new otype;
when allocation really is not needed. Even really bad move ordering would be hard put to explain more than a minute to depth 5.

Look at what is done here:
http://hem.bredband.net/petero2b/javachess/index.html
It includes java source code.

Re: Advice to improve my AI

Posted: Mon May 22, 2017 12:04 pm
by caza
Hello thank you for your reply I will take a look on your link.
When I do a move I create a clone of my chess board and I do the move on this clone. On the software "yourkit" I saw it takes 75% of time. Each pseudo code which I have seen use do undo I will change my code to use that
thank you =)