Results 1 to 10 of 10
Thread: Chess Ai
-
February 9th, 2004, 10:43 PM #1
Chess Ai
hi all!!!
i just started my ISU for my programming class and i decided i want to make a chess game... i was wondering how i should go about programming the AI (no specific code required, just general steps to take etc.)
I was thinking of using the minimax algorithm to determine the next move for the computer and using the bitboard method of storing all the positions of the peices on the board.
any help would be appreciated,
mike
-
February 10th, 2004, 08:57 AM #2
Min/Max is definitely the way to go, but man! Can't you try anything easier than chess?
Last smoke by Ilyas : yesterday at 11:45 PM.
-
February 10th, 2004, 12:24 PM #3
Sounds like a cool project
I did pong once.... that AI is easy hehe
i made it always win!
hehe...
" paddle_y = (ball._y /2) "
hehe
~Dred
Website: www.raydred.com
My Comic: www.thatcomicthing.com
Twitter: @Raydred http://www.twitter.com/raydred
-
February 10th, 2004, 01:06 PM #4
Re: Chess Ai
I designed a checkers AI a while back for C++... It wasn't overly difficult.. But it took alot of brainwork to figure it out...Originally posted by zylum
hi all!!!
i just started my ISU for my programming class and i decided i want to make a chess game... i was wondering how i should go about programming the AI (no specific code required, just general steps to take etc.)
I was thinking of using the minimax algorithm to determine the next move for the computer and using the bitboard method of storing all the positions of the peices on the board.
any help would be appreciated,
mike
Basically.. To do a Chess AI correctly.. You have to let the computer think ahead by a couple of turns.. This is where the fun part comes in. You take every move humanly possibly by the player character.. You assign a numeric value to that move... Let's say.. 0 = no threat, 1 = minor threat, 2 = possible piece lost, 3 = impiortant piece lost, 4 = have to move, king being checked
Then... You can go down the line.. If there are any 4's... You must move that piece.. If there are any 3's.. You must move that piece... If there are any 2's.. You must move that piece.. and so on down the line... Now... Not only do you have to figure that out.. You have to figure out how to make it challenging.. So the computer player is going to place his move on the board.. You must virtually (in his mind).. Allow him to think if that is a good move or not... Basically, if he moves the bishop.. Is there a piece that is going to intercept him? And then you can assign values to that specific move as well..
And this is just the gist of it.. If I were to give you everything.. I could probably take up a couple of pages with diagrams and explanations.. Needless to say.. I'll have to do it sometime for my AI tutorials.. Found in the end of this forum.aiMarz : v. 11.34c - Current Version
-
February 10th, 2004, 08:44 PM #5
my friend had the same course last semester and he made a chess program that can think ahead 4 moves in an average of 30 seconds per move. i thought i'd challenge myself to make one that thinks 6 moves ahead and takes the same amount of time to calculate the move. this might be quite the challenge since for each extra "depth" the computer has to loop through an average of 35^depth moves. so his program loops through 35^4 moves while mine will hopefully loop through 35^6 (A LOT MORE). this means my program will have to be highly optimized aswell as have lots of short cuts to cut down the amount of moves to look through...
anyways i have 2.5 months to finish this so i'll have plenty of time (hopefully)
right now im working on making a player vs player chess program and its going along fairly well but once im done ill be working on the ai.
-
February 10th, 2004, 09:52 PM #6
Eh... If you need help.. I could help you out... Especially in optimization
aiMarz : v. 11.34c - Current Version
-
February 11th, 2004, 06:49 AM #7
Well, you probably know it already, but the alpha-beta pruning algorithm is perfect for such optimisation. I used to have a great link about it, can't find it right now, but a search on google should help
Last smoke by Ilyas : yesterday at 11:45 PM.
-
February 11th, 2004, 04:01 PM #8
yea for sure, i think i read that the alpha-beta algorithm cuts down the moves the program has to look through by a square root.
i was just wondering exactly how i would get <i>started</i> lol. man, this is going to be tough

-
February 16th, 2004, 07:19 PM #910,202Registered User
postsGo for tic-tac-toe. Much more quicker. But if you do a chess, I wanna see this! I would grade it a A++++++.
-
February 21st, 2004, 08:28 AM #10
Basically what Marz said. You have to try all the possible moves, and assess the situation after each move. And then play the best move.
Last smoke by Ilyas : yesterday at 11:45 PM.

Reply With Quote

Bookmarks