Jump to content
IGNORED

Chess


Andrew Davie

Recommended Posts

 

7 hours ago, Voxel said:

 

All the pieces look on horrified at the resulting abomination, (to the left of the cursor).  I've not seen this before.

Chess20200409Q_3ply.bmp 956.79 kB · 10 downloads

This forum does not recognise/understand "bmp" format files. If you convert to/use JPG or probably GIF, then your screengrabs will show up inline.

  • Thanks 1
Link to comment
Share on other sites

7 hours ago, Voxel said:

The game decides to capture my king.  So with that handicap out the way I keep playing.

 

Bravely, the forces loyal to the monarch fought on until death.

 

I think I'll have to spend some time working on detecting endgame situations. I have been thinking about it, and don't think I should have too much trouble getting it working soon. It's not so much difficult, as much as "difficult to do efficiently". Every bit of code I put in, because it runs during the search, actually runs many many times (like, 25000 times). So it slows things down. I need to consider carefully how to implement things.

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I have fixed the pawn promotion issue. Here's a couple of binaries to play/test.

 

chess20200412_4ply.bin

chess20200412_3ply.bin

 

Little bastard beat me again. I'm going to have to put in cheat modes...
 

Edited by Andrew Davie
  • Like 1
  • Thanks 1
  • Haha 2
Link to comment
Share on other sites

I'm finding that the your engine is using the most mobile piece in it's arsenal to exploit any weakness in defence on my part, before I have time to fully develop my line.  Looking for a solid response.

 

I've used this to bait the queen a couple of times, but most often it knows...

 

It's an interesting strategy, as my Queen is looking on while her opposite is turning standard chess practice on its' head.  I'm sure some Master, would have a better response.

 

 

Link to comment
Share on other sites

14 minutes ago, Voxel said:

I'm finding that the your engine is using the most mobile piece in it's arsenal to exploit any weakness in defence on my part, before I have time to fully develop my line.  Looking for a solid response.

 

I've used this to bait the queen a couple of times, but most often it knows...

 

It's an interesting strategy, as my Queen is looking on while her opposite is turning standard chess practice on its' head.  I'm sure some Master, would have a better response.

 

 

Thanks for those comments. These are in line with my experience; it is very difficult to establish a plan because it's quite happy to piece-for-piece, and always seems to find the killer move (the only one, mind) that destroys your traps. I'm happy enough with how it's playing, but I hope it's going to get much better.

Also, it's not using an opening book. I'm not a big believer in such things; they take away from the "skill" of the engine.

 

 

Edited by Andrew Davie
Link to comment
Share on other sites

Unsatisfied with the plain and indistinguishable garb provided by the royal palace, and feeling rather under-appreciated because their monarch always seemed to be out having fun on the town, and in better garb to boot, the black soldiers donned their new designer outfit...  "It makes us look so... dark...", they opined to each other... "and handsome!". All agreed. "Wake me up when she's dead.", one said, "... the bitch!"

564289169_ScreenShot2020-04-12at10_12_05pm.thumb.png.229aee6202f21722fcd3cd6a0c854941.png

Edited by Andrew Davie
Link to comment
Share on other sites

5 hours ago, Andrew Davie said:

Also, it's not using an opening book. I'm not a big believer in such things; they take away from the "skill" of the engine.

You've mentioned this before, which explains the non-standard play, which makes this engine harder to predict.  It's like the German Blitzkrieg!

 

I can remember there were chess games who would be inclined to follow there algorithms and give a standard book opening move resulting in predictable play for a large percentage of their games.  Not so for this one, I have attempted multiple games following a standard opening and cannot guarantee this engines' algorithm would follow a set pattern (it comes close).

Link to comment
Share on other sites

8 hours ago, Andrew Davie said:

Little bastard beat me again. I'm going to have to put in cheat modes...

 

Isn't this how Joshua started?  and the next thing you know it is playing Global Thermonuclear War against some punk kid

 

Gallery: Famous Intelligent Computers from Television and Film ...

 

 

 

A little chess program grew into this:

Obama Demands SCOTUS become Rubber Stamp for his Policies

 

 

  • Like 3
  • Haha 1
Link to comment
Share on other sites

2 hours ago, Voxel said:

You've mentioned this before, which explains the non-standard play, which makes this engine harder to predict.  It's like the German Blitzkrieg!

 

I can remember there were chess games who would be inclined to follow there algorithms and give a standard book opening move resulting in predictable play for a large percentage of their games.  Not so for this one, I have attempted multiple games following a standard opening and cannot guarantee this engines' algorithm would follow a set pattern (it comes close).

I feel reasonable in my view that for most video game enthusiasts, this engine would give them a quick, fairly challenging, and enjoyable game of chess. Once I throw in the AtariVox insults it will have personality. It already has a certain feeling of relentless aggression.

  • Like 1
Link to comment
Share on other sites

6 minutes ago, Andrew Davie said:

I will try my very best to have it speak one or two quotes from that movie :)

It would be nice to have a few quotes for each scenario and depending on its' (winning) state it can select a pattern of quotes to fit a profile or at random from a selection for a given incident.

 

I would really like to have it beat me and then say "How about a nice game of chess?" for the irony!

  • Like 1
Link to comment
Share on other sites

On 1/27/2020 at 10:16 AM, Andrew Davie said:

I was thinking about the very few Atari games I've done over all these years - just mostly lots of demos. But the games - all "puzzlers", really.  Qb, of course, which is an "action puzzler" but then Boulder Dash - another action/puzzler, and Sokoboo - a pure puzzler. And now Chess. I don't think there's a large audience for puzzle games, in general. 

I agree that the 2600 scene is not very popular with puzzles games. I enjoy them; I think many famous can be created/ported such you've done with Sokoboo. Please keep the good work.

 

  • Like 1
Link to comment
Share on other sites

I've now got the detection working for checkmate and stalemate.

It's functional in the tree search, and allowing the player to mate/stalemate via the UI.

What's not working is when the computer checkmates/stalemates the player.


But that should be a relatively simple task now - I just "pretend" it's the computer doing the move, fire off a 2-ply "choose best move", and it will return with the appropriate flags set. Then I switch back to the human and I know what's what. This will also remove in-check moves from the "show me available moves" that you get when you hold down the button.

Here's a short video of the test-bed showing mate (red) and stalemate (green) being detected...
 


 
  • Like 3
Link to comment
Share on other sites

5 hours ago, fdr4prez said:

Are you planning to have a splashscreen for each end of game scenario?

No, I will have large text overlaying the game board.  Such as "CHECK!", "CHECK//MATE", "STALE//MATE" etc.

I've already written most of the display system for this text.

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I've spent quite some time going round and round in circles, so to speak, trying to tweak the alphaBeta search.  Very complex and messy because of the recursive nature of the code. Anyway, I basically "chucked a wobbly" as they say down here in Oz, and decided that since it was actually a negamax algorithm (although I didn't know it when I wrote it), I'd start afresh and actually implement negamax properly.

Well, I've done that. It's not quite working perfectly yet, but it is traversing the tree as expected and selecting moves. Very very very quickly. Just early figures, but in version #0 alphabeta sort of negamaxy search (RIP, we will miss you) the search could do 3ply in about 4 seconds, 4ply in about 20 seconds and 5ply well let's say about 10minutes.  The new, much more efficient negamax search is showing promising (but possibly erroneous!! :) we shall see) stats of 3ply in 1/2 second, 4ply in 5 seconds, 5ply in 25 seconds, 6ply in 130 seconds, and 7ply (!!!!!!) in 9.5 minutes.

These are almost too good to be true - but they are increasing exponentially as expected. I just need to trace through it and fixup a few errors in the move selections. But, fingers crossed.  A 5ply game should be quite challenging to most humans.

 

Maybe in the next few days I'll be able to show the negamax search operational! 

 

 

OK, I got it working pretty quickly, much to my surprise. I'm just that good :PIt's weird because it has a totally different "feel"/personality to the previous search. I think the previous search had some subtle bugs so it took more risks, was more aggressive, just sort of went for it.  Interestingly there is one particular sequence of moves both this new search, and the old one, seem to just play terrible moves. There must be some logical reason, but I have yet to analyse it.

I haven't got any of the checkmate/stalemate detection in this new version yet. One thing I did put in was a bit of random noise at the very bottom of the tree, so it will play slightly differently every time, provide the position allows.

I'm a bit in two minds about this. It's lost personality. Anyway, moving on - I need to get quiescence in because it desperately throws pieces to be taken to avoid larger pieces to be taken. Also, when I got it in check, it decided to reply by putting me in check. Logical - king for a king - but that's just not on!

So, a few steps backwards... quiescence, check detection, loss of "personality". But a few forward - negamax search, increased speed (alpha beta pruning is obviously working here, and it clearly wasn't in my earlier implementation), some variation/randomness in gameplay. I can put some personality back by refining the evaluation, I hope.

Video shows the system just a few minutes after it started working. So, pretty much the first game.

Truth be told, I get all excited when something starts working, and rush to share... and things aren't always what I think they are. I thought it was doing 7 or 8 ply, but in reality I had a 2x bug in my ply counter. Oh dear!

But anyway, attached is a 4 ply version to play with. This has a random (up to 64/100ths of a pawn value) jiggle in the evaluation at the leaf nodes of the tree/search, so it should choose somewhat different moves and be a little adventurous but easier to beat.
 

 

 

chess20200415_4ply_NEGAMAX_63.bin

Edited by Andrew Davie
  • Like 1
  • Thanks 2
Link to comment
Share on other sites

                       

4 hours ago, Andrew Davie said:

This has a random (up to 64/100ths of a pawn value) jiggle in the evaluation at the leaf nodes of the tree/search, so it should choose somewhat different moves and be a little adventurous but easier to beat.

Please don't compromise the engine.  I hope the code is optimised to win, but that manual settings will be added to offset it's winning ability only.

 

Interesting video.  In some ways the game seems to have gone back a little, as you said.  I'll be waiting patiently for those routines to be added to hopefully give it back... the bitch!

 

I've played a couple of quiick opening moves it's quite methodical in play and makes for a nice relaxing game.  The Queen took some enticing to leave her spot.  It's clearly a different engine, would be interesting to see this engine against the last one.

Link to comment
Share on other sites

On ‎4‎/‎12‎/‎2020 at 8:13 AM, Andrew Davie said:

Unsatisfied with the plain and indistinguishable garb provided by the royal palace, and feeling rather under-appreciated because their monarch always seemed to be out having fun on the town, and in better garb to boot, the black soldiers donned their new designer outfit...  "It makes us look so... dark...", they opined to each other... "and handsome!". All agreed. "Wake me up when she's dead.", one said, "... the bitch!"

564289169_ScreenShot2020-04-12at10_12_05pm.thumb.png.229aee6202f21722fcd3cd6a0c854941.png

 

I understand that you are trying to improve the color contrast of the "black" pieces, but honestly I think that the overall shape and appearance of the black pawns looked much better in the older screenshots (like back in post #395, for instance).  I don't really see the recent changes as an improvement, actually I think that now the pawns for each color look more disparate in shape and less symmetrical.  Just my 2 cents worth.  :ponder:

 

Link to comment
Share on other sites

15 minutes ago, NostAlgae37 said:

 

I understand that you are trying to improve the color contrast of the "black" pieces, but honestly I think that the overall shape and appearance of the black pawns looked much better in the older screenshots (like back in post #395, for instance).  I don't really see the recent changes as an improvement, actually I think that now the pawns for each color look more disparate in shape and less symmetrical.  Just my 2 cents worth.  :ponder:

 

 

I value feedback, thank you. I do agree with earlier comments, though, that the pawns were very difficult to distinguish. Although I personally liked the black pawns' difference, perhaps the slight compromise shown in this screenshot is an improvement for you?

1414531200_ScreenShot2020-04-15at1_10_27pm.thumb.png.0a634816608d534e286fa034275ef292.png

Link to comment
Share on other sites

My 2c worth...

 

I like the tops of the pawns being a bit dimmer.
Gives them a slightly 3D look (like the top of a shaded sphere).

 

The random element is a good thing.
Technically, it makes it play a weaker game.
But if we find a sequence of moves that win then we can replay those moves to win anytime - as boring as that would be.

A self learning AI would learn and avoid those moves in the future but of course we understand that is another level of difficult above the current target.
A slight random element is a good fall back to prevent repeatable play.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...