PDA

Click to See Complete Forum and Search --> : chess AI programming


demon.KILER
Jan 20th, 2008, 03:11 PM
hi all

any one want to Start a chess Ai programming Challenge?

concept: two players create their own chess Ai in any language u want and use A simple local sck connection to exchange information. And we will decide the winner in a match :D

any one up ?

If you want to make it simple for starting then we could start with a ticktacktoe :D

Dave Sell
Jan 22nd, 2008, 03:51 PM
I am up for this. I am looking to make a simple chess AI in the upcoming months for a TORQUE game. I wouldn't mind starting with tic-tac-toe. How can our softwares compete?

demon.KILER
Jan 23rd, 2008, 12:50 PM
code the application so that it will connect to port 5001 and then my application will send in the coordinates to ur and urs to mine

If u have trouble coding Winsock I will give u a Dll that u can call

i will upload my app once i finish ;)

coordinates
1 2 3
4 5 6
7 8 9
1 for 'x'
0 for 'o'
there fore for example if u want to put a 'x' in 5th one then send 11

or any other way u want
I am done my Algorithm - it mostly ends the match in a Draw
its not a AI - this time its a Algorithm
but for Chess mine will be a AI [ it will learn from its mistake ]

edit : send "me" or "you" in the starting
"me" = you app first
"you"= my app first

Milk
Jan 24th, 2008, 02:50 PM
If your interested in Chess AI, Bruce Moreland's site (http://web.archive.org/web/20070607231311/www.brucemo.com/compchess/programming/index.htm) is worth a look. I would be interested in doing something along these lines but with an easier game like Reversi (http://en.wikipedia.org/wiki/Reversi) (still harder than tic-tac-toe)

For a real challenge there is always Go (http://en.wikipedia.org/wiki/Go_%28board_game%29), it is said that the best existing Go AI can still be beaten by an amateur human player.

demon.KILER
Jan 24th, 2008, 06:24 PM
For a real challenge there is always Go (http://en.wikipedia.org/wiki/Go_%28board_game%29), it is said that the best existing Go AI can still be beaten by an amateur human player.

well that may be cause most programmers never know what the rules are ! at least Thats my case - I tried to learn but it was too complicated for me :o

Dave Sell
Feb 6th, 2008, 01:39 PM
code the application so that it will connect to port 5001 and then my application will send in the coordinates to ur and urs to mine

If u have trouble coding Winsock I will give u a Dll that u can call

i will upload my app once i finish ;)

coordinates

1 for 'x'
0 for 'o'
there fore for example if u want to put a 'x' in 5th one then send 11

or any other way u want
I am done my Algorithm - it mostly ends the match in a Draw
its not a AI - this time its a Algorithm
but for Chess mine will be a AI [ it will learn from its mistake ]

edit : send "me" or "you" in the starting
"me" = you app first
"you"= my app first

Sorry no response from me - I too have a nice Winsock wrapper - give me a couple days.

demon.KILER
Feb 7th, 2008, 11:40 AM
np

I "was" done but I did some thing and now its really sewered up :eek: I need a couple of days to finish up too.

Shaggy Hiker
Feb 7th, 2008, 04:35 PM
I considered a GA based chess AI for a time, before I realized that there would be no rational way to explain the rook-king endgame. At that point I went online to see what I could find, and realized that chess games generally follow canned openings until the human deviates from the standard opening. Chess computers also use canned end games, which explains away the problem I had with the rook-king end game. The rules used in the rest of the game (protect the king) are abandoned for an end game that requires attacking with the king.

Then I encountered an article that suggests that an AI for chess would be novel, because there is no I in chess, so every I would be AI by definition. The study showed that human chess masters get where they are not by learning how to think through combinations, but by having lots of experience and a very good memory of other games. Studies show that grand masters generally evaluate only one or two moves, they just choose the right moves to evaluate. Other studies showed that if a grand master was shown a position from an actual game they were far better than a novice was at reconstructing the position from memory. However, if the same masters were shown a board where the pieces were positioned at random, then they were no better than novices at reconstructing the position from memory.

The point is that chess computers use a brute force approach to evaluate every possible move, and fancy algorithms to snip off branches that appear unpromising. Meanwhile, human chess masters are simply playing and remembering so many games that they can evaluate a position by subconsiously comparing the position to games in memory.

At that point, I abandoned the idea of a chess AI in favor of building a robot. There is no evidence that either humans or machines use intelligence to win chess games. Instead, the machines use brute force, while humans use encyclopedic memory.

Dave Sell
Feb 8th, 2008, 01:25 PM
np

I "was" done but I did some thing and now its really sewered up :eek: I need a couple of days to finish up too.

My networking objects are really easy to use in VB6 or .NET. You want to use them?

Option Explicit

Private Sub cmdClient_Click()
Me.tntcClient.Connect
End Sub

Private Sub cmdSend_Click()
Me.tntcClient.SendData Me.txtSendData.Text
End Sub

Private Sub cmdServer_Click()
Me.tntcServer.Listen Me.tntcServer.Port
End Sub

Private Sub tntcServer_DataReceived(strData As String)
' strData = "Hello dood"
End Sub

demon.KILER
Feb 8th, 2008, 04:52 PM
My networking objects are really easy to use in VB6 or .NET. You want to use them?

Option Explicit

Private Sub cmdClient_Click()
Me.tntcClient.Connect
End Sub

Private Sub cmdSend_Click()
Me.tntcClient.SendData Me.txtSendData.Text
End Sub

Private Sub cmdServer_Click()
Me.tntcServer.Listen Me.tntcServer.Port
End Sub

Private Sub tntcServer_DataReceived(strData As String)
' strData = "Hello dood"
End Sub



sure Why not .
I cannot do any thing for this week ;) Sry about that - i have so many things going on :O

honeybee
Nov 2nd, 2010, 06:36 AM
Then I encountered an article that suggests that an AI for chess would be novel, because there is no I in chess, so every I would be AI by definition. The study showed that human chess masters get where they are not by learning how to think through combinations, but by having lots of experience and a very good memory of other games. Studies show that grand masters generally evaluate only one or two moves, they just choose the right moves to evaluate. Other studies showed that if a grand master was shown a position from an actual game they were far better than a novice was at reconstructing the position from memory. However, if the same masters were shown a board where the pieces were positioned at random, then they were no better than novices at reconstructing the position from memory.


Ummm... there is the straightforward way of analysing your options, discard the suicidal ones and reanalyse the remaining ones. If you end up with more than one course of action that sounds promising, you take your pick based on your choice, experience, judgement etc etc. This is the strategy followed by every chess player.

But the true 'masters' do not necessarily follow this, specially in complicated middle game or end game scenarios. They construct a position in mind which would be favourable to them and then work backwards to the current position to see which moves would force the opponent to go towards the desired position. I had once played back a classic game between Karpov and Kasparov from their world championship match where both of them seemed to be playing aimlessly for a draw, and it's only when Karpov gained the upper hand that I realized he had been slowly steering the game towards the particular position.

If your 'studies' are from non-chess fraternity, I would take them with some grain of salt. When Bobby Fischer played d4 against Spassky, or when Anand played the same opening against Kasparov, there are psychological factors at play which I think till date the computers can use.

Even when I learnt the endgames with a Rook, a Rook and a Pawn, a Rook and Bishop and so on, I had to learn the patterns which were winning, patterns which were losing and patterns which would lead to a draw. In a game, my task is to stay clear of the losing patterns, try to steer the game towards the winning ones and if the opponent knows as much as me, be happy to get to a draw. If I don't know the right patterns, I can't steer the game to the desired pattern. Effectively squandering away a win.

.


Oops, didn't notice the date :( My apologies!

akhileshbc
Nov 6th, 2010, 09:45 PM
honey, you are digging out old threads ! This thread is approximately 3 years old !!! :p

minitech
Nov 15th, 2010, 07:40 PM
Still a good idea for a coding challenge... but not over a network. It should focus on only one thing.

Shaggy Hiker
Jan 12th, 2011, 09:37 AM
Ummm... there is the straightforward way of analysing your options, discard the suicidal ones and reanalyse the remaining ones. If you end up with more than one course of action that sounds promising, you take your pick based on your choice, experience, judgement etc etc. This is the strategy followed by every chess player.


Apparently it is not. There was a famous chess master (Lopez comes to mind, but I'm not sure) who, when asked how many moves he evaluated, replied that he only evaluated one move, but it was always the right one. Studies have suggested that he was being completely honest. Chess masters appear to only actively evaluate one or two moves. The studies are pretty interesting, and should be available on line.

BramVandenbon
Feb 22nd, 2011, 08:52 AM
It sounds believable that players often evaluate the correct move first.

Even in far more complicated board games such as Go (a more abstract game), often the best move is the first one that comes to mind. But strong players such as Lee Chang Ho have declared to read more than 100 moves ahead to verify it. As a medium experienced player (7 years) I usually don't read more than 15 moves ahead.

I only find it natural that on a smaller board with far more restrictions (such as the boardgame chess), this is probably even more the case than in Go (where the board is 19x19 area and almost every spot can be played).

For more info about go: http://en.wikipedia.org/wiki/Go_(game)