Thanks for playing it. I appreciate your time.
Yet another on line chess program
Very nice considering you made it in 48 hours.
Right now it moves super-quickly and misses two-move tactics, but given more time I think it would play much better.
I wondered about adding some human touches to the program. Problem is I still have to teach it about knights on the rim myself! It is on my short list though and should be in the mix within a day or so.
I'm trying to see how to make it look deeper into a position but the number of positions it needs to examine soon escalates - I'm looking into doing a 3 move search at the start and continuing with any potential exchanges. Next I'm hoping to then explore the best say 10 moves with a deeper search. Then reduce the number of moves again and extend the search yet again. I would then want to make the skill level dependant on the time it searches for. This is moderately difficult to implement so I'm holding off for the moment.
It is good fun writting these project though.
Mike
I played against it and I was down a pawn but in the endgame, it was just moving its king again and again instead of queening. It was fun and good job.
=D
I played the 48 hour and found it to be too fast!! The other problem I have with the game is that I can change level in mid-game, forcing the computer to play stupid moves, which shouldn't be allowed.
It is too good. I was well beaten.
You can change the level by just clicking the "brain" in the bottom right. Level 1 practically throws it's pieces to you. Perhaps level 2 or 3 might provide a challenge though.
I played the 48 hour and found it to be too fast!! The other problem I have with the game is that I can change level in mid-game, forcing the computer to play stupid moves, which shouldn't be allowed.
It should wait a minimum time of a second before replying and it's move should be highlighted on screen plus there's a little description of it's last move near the "brain" image. You can see all the moves played by clicking the "history" pawn and it will put a little star next to the level if the user has taken back moves or changed the level etc. At the end of the day though it's up to the user what they want to do.
I'll be the first to admit it plays some pretty dumb moves even on the highest level at times. I'm trying to correct this now.
I like it, it doesn't destroy me like the other ones. I could even leave the record at 1-0 : ). it seems to have some trouble with the ruy-lopez exchange variation on level 5.
I've updated the end game evaluation so now it should push passed pawns, put rooks behind them and get the king to the centre. This should make it a bit more purposeful at the end. It also avoids putting knights on the rim. Few other small changes. Version should now say d9.1
Thanks for playing it by the way - I appreciate the feedback.
I played it and found myself beaten, so just played it out to see how it would checkmate me. I ended up losing my few remaining pawns and just had my king. It kept piddling around and finally promoted a pawn to queen. But instead of mating me, it stalemated when I couldn't move my king any more.
Played a single game. The program played ok I think although it did not follow the opening principle of not moving pieces more than once ;)
I'm impressed with how much you have done in such a short time.
Quite weak but moves very quickly. It's not really built for your strength I'm afraid - I'd say a 1700 should easily be able to beat it at present but it's gaining in strength every day.
The program played ok I think although it did not follow the opening principle of not moving pieces more than once. This is something I'm trying to fix at the moment.
But instead of mating me, it stalemated when I couldn't move my king any more.It's a shame you don't have the game history (just click the pawn outside the board with the "h" on it) and then I could find out why. Can you remember a rough idea of the position or what pieces it had to work with? It has neither an opening book or an endgame database so it has to work with generic rules.
Played a few more games on lvl 6-7-8-9
The program seems a bit too eager to exchange pieces even when behind in material.
Would you consider to autogenerate a pgn file after each game?
Very nice job! Although I could beat it on level 9, with only one take-back after the game was already decided and I was no longer paying attention. (I outplayed it tactically in the middle-game, grabbing two Pawns, so that it was even won before it started playing like an idiot in the end-game.) I would have posted the game, if I only knew how to copy-paste it after it appears when I click the Pawn. Trying to select it makes it immediately disappear, however...
I suppose you use a fixed-depth full-width search (as deep as the level number) followed by a capture search, right?
To improve it, you could consider making it play by node count rather than given depth. That way you can prevent the dramatic drop in strength in the end-game, where it starts to move instantly on a level where it thinks several moves per minute in the middle-game.
You could also try null-move pruning: when you still have to search N ply deep from a given node, but, giving the turn to the opponent, he cannot refute you in N-3 ply, consider the previous move refuted. That often gives a dramatic improvement over a fixed-depth search.
Another way to make it less naive in end-games would be to reward really hefty bonuses for Pawns on 6th and 7th rank. (Like make a Pawn on 6th worth 1.8, and one on 7th 2.8 nominal Pawns.) Then at least it will see some danger in advancing passers, even when the actual promotion is still outside the horizon.
does it learn from defeats or play randomly in the opening? : It has a small random influence throughout the game (to stop things getting boring) with a larger random influence added during the opening. It won't play moves it sees as mistakes but it will vary between what it thinks is ok moves.
you are a java ninja to have written this in 48 hours. Watch for double attacks and other tactics : the first running program that played chess (like my 10 year old) took 2 days but I've been on it for 9 days now. Writting programs should be treated as an adiction.
I would have posted the game, if I only knew how to copy-paste it after it appears when I click the Pawn : Sadly the only way you can copy the notation is with Alt & Print Scrn. This is a failing on my part but I haven't worked out how to display copyale text. It's on my list.
You could also try null-move pruning : Errr? I'll have to try and find something on this. Is it like alpha beta pruning? I just tried keeping the best moves at one level and then searching deeper with the best moves. Then repeating this until it runs out of time. I was hoping for a huge jump in strength and sadly it played worse! It was also quite complicated so now I'm faced with either debugging the code, seeing if the idea was flawed or just deleting that section 
Another way to make it less naive in end-games would be to reward really hefty bonuses for Pawns on 6th and 7th rank : It gives a moderate bonus to passed pawns and should try and push them but obviously it didn't.
I put it with my favorites : Glad you enjoyed it 
I've recently (last week) created a chess program. It's still very early days in it's development but I was wondering if anyone could give it a quick game and offer some constructive feedback (missing features, user interface, things I'm missing when evaluating a position, etc). It plays pretty quickly as it currently doesn't look that far ahead.
48 hour chess
Mike