determining a good move in chess

Hi everyone,

Firstly, thanks to those who offered advice with my RPG. Its finished (well,...its at a playable

state but now im bored of it), and now im busy making chess. I apoligize for the fact that this

particular question probably has little to do with Java itself other than the fact that im making

the game in Java. So if you're still willing to offer assistance I would appreciate it.

Ive completed the multiplayer version (human vs human) and am now busy with the AI for the human vs

computer. Im aware of various search algorithms using minimax, heuristics etc which I will use to

analyze the board and search for good moves aswell as thinking ahead. My problem is that I cant

think of any values to add to certain moves on the current board position so that the pieces will

move intelligently. I wont have much use for search algorithms to think 5 moves ahead if I cant even

determine a good move right now?!?

This is what I have so far:

Value of pieces which will assist in determining which piece to capture:

King: infinity

Queen: 9

Rook: 5

Knight: 3

Bishop: 3

Pawn: 1

Other move generation values:

pawn within 3 rows of getting promoted: value+=2

chance to castle/king: value+=2

Other than these few basic values I cant think of any others. At the moment only the pawns will move

and then every other piece will only move if it has the opportunity to capture another piece since

the game sees no more advanatage in moving a pawn than moving a bishop for instance. I need to have

more values which can indicate how good certain moves will be so that pieces will move even if they

aren't going to capture anything. At the moment im not looking into the future (ie: generating

children from moves and then analyzing those aswell). Im at the moment, merely wanting to determine

a good move with the current board position without thinking ahead. (which will come later).

As always,...much appreciated.

R

[2122 byte] By [RisseN] at [2007-9-30 11:03:39]
# 1

I can think of three more things:

1) What pieces are under threat. Bonus points for pieces that threaten more than one piece (ie, a rook in danger is 5 points, a knight in danger is 3 points, but if both a rook and a knight are in danger 12 points).

2) What pieces are you protecting from danger (ie, if a rook is behind a knight which is in the way of an opponents piece, the rooks get a score for protecting said knight).

3) How many pieces are threatening my piece.

Also, I'm sure that there are more than a couple open source projects with chess AI floating around the web that you can use as reference.

shmoove

shmoove at 2007-7-3 22:34:10 > top of Java-index,Other Topics,Java Game Development...
# 2

How about:

Territorial bonuses: eg. bonus for occupying territory near the center of the board.

Endgame bonuses: for reaching an endgame board position where you have an advantage or are guaranteed a win even though the game can't search any further down the tree. eg: Your king and two rooks against a lone king?

Combinations of pieces: for eg: one bishop in play=3, two bishops=7

Parmenion0 at 2007-7-3 22:34:10 > top of Java-index,Other Topics,Java Game Development...
# 3
Don't be ashamed to use and look for standard openings and to have responses prepared for them.
_Breakfast_ at 2007-7-3 22:34:10 > top of Java-index,Other Topics,Java Game Development...
# 4
Also, look for escape routes, and if they are also compromised: If a king is under threat by a rook, and one of the directions it can move puts it under threat by another piece (or even the same rook) for that matter, there's a bonus for that...shmoove
shmoove at 2007-7-3 22:34:10 > top of Java-index,Other Topics,Java Game Development...
# 5
Thanks for the replies so far from everyone. This is exactly the sort of stuff im looking for.R
RisseN at 2007-7-3 22:34:10 > top of Java-index,Other Topics,Java Game Development...
# 6

Hello,

I suggest you look at the chess program from one of the old Fred Fish disks.

ftp://ftp.cs.tu-berlin.de/pub/aminet/game/board/Chess.lha

I could beat ChessMaster about 1 in 3, but I never did beat this program.

You'll need a version of LHARC to unpack it, and you will have to decipher the

Intuition/exec calls, but it is quite small, and you may be able to get some good ideas from it.

Of course don't try to optimize it or you will be breaking all the "rules" ;)

(T)

tswain at 2007-7-3 22:34:10 > top of Java-index,Other Topics,Java Game Development...