Advice to improve my AI

Code, algorithms, languages, construction...

Advice to improve my AI

Postby caza » Tue May 16, 2017 8:24 pm

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 =)
caza
 
Posts: 2
Joined: Tue May 16, 2017 7:57 pm

Re: Advice to improve my AI

Postby H.G.Muller » Fri May 19, 2017 7:05 pm

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).
H.G.Muller
 
Posts: 176
Joined: Sun Jul 14, 2013 10:00 am

Re: Advice to improve my AI

Postby User923005 » Sat May 20, 2017 1:35 am

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.
User923005
 
Posts: 606
Joined: Thu May 19, 2011 1:35 am

Re: Advice to improve my AI

Postby caza » Mon May 22, 2017 12:04 pm

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 =)
caza
 
Posts: 2
Joined: Tue May 16, 2017 7:57 pm


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron