Posted: Fri May 23, 2008 11:43 pm Post subject: RE:Chess in making
I definitely haven't heard of american chess before, and a google search didn't come up with anything tangible... You sure you didn't just make it up?
Did you give the AI an opening book? If not, how deep is your search?
A.J
Posted: Sat May 24, 2008 7:02 pm Post subject: Re: Chess in making
American chess is a pretty well known thing in my school........I don't know where it originated though....
I didn't use an open book. I used minimax with alpha-beta pruning (wiki it ).
The AI I have is my 'stupid' AI (looks 0 moves forward). Being my Level 1, it should be pretty easy to beat (so you can just scholars mate it )
I finished my minimax with alpha-beta pruning function yesterday, and since I have A lot of summatives/exams, I'll finish the good version only by the end of this coming week (by thursday, friday in other words)
I'll add more graphics and better heuristics for my evaluation functions.
Right now, this is how it calculates the heuristic:
pawn: check if it is passed or not ,more points if it is passed ('passed' meaning no threats + passed halfway sorta thing)
knight: if it is in outer ring of board, 2nd outer ring or middle 3 rings (by rings I mean squares). The further away from center,
the worse.
bishop: range (accessible squares) + if it is on the middle diagonal (the diagonal running from the top-right point to the
bottom-left, or top-left to bottom-right)
rook:range (accessible squares)
queen: range (accessible squares)
king: range (accessible squares)
As you can see, m queen/bishop/king's heuristic are currently in the making.
To every piece, I add/subtract points according to how many pieces threaten it/how many (and type of the) pieces it can take
I sort the legal moves for white and black in 2 separate heaps, so when I minmax I run through the moves from best -> worst
I'll finish the chess part soon (and try adding a timer if the player so wishes), but I'm worried about the graphics.
I need some advise on that.
Thanks, Gandalf, for replying.
[Gandalf]
Posted: Sun May 25, 2008 12:29 am Post subject: Re: Chess in making
A.J @ 2008-05-24, 7:02 pm wrote:
I didn't use an open book. I used minimax with alpha-beta pruning (wiki it ).
The AI I have is my 'stupid' AI (looks 0 moves forward).
I don't have to wiki it, believe me. I was just wondering because it seemed to play a decent opening compared to other early chess programs, but then went on to leave a bishop hanging for no reason. The disproportionate search compared to the eval explains that, though. It's pretty unusual to work on the eval as much as it seems you have before even getting a basic search going, not that it's a bad thing.
A.J @ 2008-05-24, 7:02 pm wrote:
I sort the legal moves for white and black in 2 separate heaps, so when I minmax I run through the moves from best -> worst
Move ordering is important, however minimax is a full width search so this really has no effect until you start using alpha beta.
A.J @ 2008-05-24, 7:02 pm wrote:
I'll finish the chess part soon (and try adding a timer if the player so wishes), but I'm worried about the graphics.
The graphics are fine, there are other things you should be fixing though...
1.e4 Nf6 2.e5 Nd5 3.d4 Nc6 4.Nf3 b6 5.Bc4 Bb7 6.Bxd5 a6 7.Be4 { The program made this move for me?? } Qb8 8.Bd5 Qc8 9.Ng5 Qb8 10.Bxf7+ { Error, array subscript out of range, line 1158. }
A.J @ 2008-05-24, 7:02 pm wrote:
Thanks, Gandalf, for replying.
No problem. I'm really quite curious how much potential a Turing chess AI has. Maybe consider releasing the source code?
Sponsor Sponsor
A.J
Posted: Sun May 25, 2008 9:52 am Post subject: Re: Chess in making
here's an updated version !!! (still about level 2 AI though...)
I'm putting my source code up now.....but I'm very inefficient with my code (so, 0 comments!!!....sry abt that)
I'll add the comments/improve AI and add a better version.