Jump to content
IGNORED

Chess


Andrew Davie

Recommended Posts

4 hours ago, Gray Defender said:

I was able to load it with my Unocart, although it does make some atarivox babble when the program starts up.  I attached what it looks like on my crt.  Not as much contrast as I would like, but I could try to adjust the TV settings...

20200418_101829.jpg

Thanks for the picture. The game relies on colour saturation rather than contrast, really. To me this picture looks quite washed out and too bright. I'd be turning down the brightness, and increasing colour saturation if you have those controls.

I did say the AtariVox babbled :). -- it's quite fascinating, actually, right on the edge of something you think you should be able to understand.

 

Link to comment
Share on other sites

38 minutes ago, Gray Defender said:

This is much better in all ways.  It was difficult to get a good image due to flickering visible on camera but I thought this one came out nice.  From the Atari 2600 Jr. Composite...

 

_DSC3493.JPG

 

Gorgeous. The flickering is from the TV and interaction with the camera/phone update rate, and possibly even with fluorescent lights if you have any of those - the game itself has zero flickering going on.  But, it's a lovely picture.  On a suitable TV it sure looks nice.

 

Link to comment
Share on other sites

Spent some hours trying a game against Video Chess.  So as not to be accused of any bias against Video Chess, it got to go first as white and it got to play on Game 5, so it had a clear advantage.  This is how the game played out...

 

Move Video Chess Game 5 AD Chess chess20200419_3ply_quiescent#2_5ply
  White Black
1 Pawn D2-D4   Pawn E7-E6  
2 Knight G8-F3   Bishop F8-B4  
3 Knight B2-C3   Knight B8-C6  
4 Pawn E2-E4   Bishop B4-A5  
5 Bishop F1-C4   Bishop A5-B4  
6 Bishop C1-F4   Bishop B4-A5  
7 King E1-G1 Castle (Rook H1-F1) Knight G8-F6  
8 Knight F3-E5   Bishop A5-C3 Knight capture
9 Pawn B2-C3 Bishop capture Knight F6-E4 Pawn capture
10 Queen D1-F3   Queen D8-H4  
11 Knight E5-C6 Knight capture Pawn D7-C6 Knight capture
12 Queen F3-E4 Knight capture Bishop C8-D7  
13 Queen E4-E5   Pawn B7-B5  
14 Queen E5-G7 Pawn capture Rook H8-F8  
15 Bishop F4-H6   Queen H4-E7  
16 Queen G7-F8 Capture Rook/Check King E8 Queen E7-F8 Queen capture
17 Bishop H6-F8 Queen capture King E8-F8 Bishop capture
18 Bishop C4-B3   Rook A8-D8  
19 Rook F1-E1   King F8-G7  
20 Rook A1-B1   Pawn F7-F5  
21 Bishop B3-E6 Pawn capture Pawn F5-F4  
22 Bishop E6-B3   Rook D8-E8  
23 King G1-F1   Rook E8-D8  
24 Rook E1-E7 Check King G7 King G7-F8 checked
25 Rook E7-F7   Pawn A7-A5  
26 Rook F7-F4 Pawn capture Pawn B5-B4  
27 Rook F4-F3   Pawn B4-C3 Pawn capture
28 Rook F3-C3 Pawn capture Bishop D7-F5  
29 Rook C3-C6 Pawn capture Rook D8-D4 Pawn capture
30 Rook C6-C7 Pawn capture Rook D4-D2  
31 Rook C7-C5   Bishop F5-G6  
32 Pawn F2-F3   Pawn A5-A4  
33 Bishop B3-A4 Pawn capture Bishop G6-F7  
34 Pawn A2-A3   Bishop F7-D5  
35 Pawn C2-C4   Bishop D5-F7  
36 Pawn F3-F4   King H8-G8  
37 Pawn F4-F5   Bishop F7-H5  
38 Pawn F5-F6   Bishop H5-E2 check King F1
39 King F1-E1 Checked Rook D2-A2  
40 Rook C5-C7   Bishop E2-G4  
41 Rook B2-B8 Mate King G8      

 

Edited by Voxel
  • Like 2
Link to comment
Share on other sites

1 hour ago, Voxel said:

Spent some hours trying a game against Video Chess.  So as not to be accused of any bias against Video Chess, it got to go first as white and it got to play on Game 5, so it had a clear advantage.  This is how the game played out...

Nice breakdown! I think the 4-ply may do better, level 5 is gives Video Chess 10-12 minutes to move, I think it goes deeper than 3 moves ahead on 5.

 

  • Thanks 1
Link to comment
Share on other sites

2 hours ago, Voxel said:

Spent some hours trying a game against Video Chess.  So as not to be accused of any bias against Video Chess, it got to go first as white and it got to play on Game 5, so it had a clear advantage.  This is how the game played out...

 

Move Video Chess Game 5 AD Chess chess20200419_3ply_quiescent#2_5ply
  White Black
1 Pawn D2-D4   Pawn E7-E6  
2 Knight G8-F3   Bishop F8-B4  
             

 

 

Thanks for that!  To be clear, you played a level that is allowed 10-12 minutes per move? Video Chess is quite the accomplishment.

I'm going to have to put some smarts in that evaluation algorithm sometime and see how that spices things up. But first I'm going to get all the other mechanics as good as I can. Then it will be time to put some "thinking" in.

  • Thanks 1
Link to comment
Share on other sites

Just now, NE146 said:

Re: thinking time on the VCS, would it affect either game if they were run in Stella for example, and increasing the emulation speed under video options to 1000%? i.e. To decrease waiting time?

Nice idea, but the UI becomes totally unusable for my game when run at super-speed. I can't see an on-the-fly way to change stella emulation speed, so unless you could do this, then I don't think this would work.

Link to comment
Share on other sites

24 minutes ago, NE146 said:

Re: thinking time on the VCS, would it affect either game if they were run in Stella for example, and increasing the emulation speed under video options to 1000%? i.e. To decrease waiting time?

 


 

 

Stephena says it will speed everything up

 

curious if someone would give it a try

 

He says that the input would also be increased, so it may make it harder to move.

 

Link to comment
Share on other sites

Have you ever seen the movie "The Incredibles" where the boy was in a foot-race and he was trying to win but not win so incredibly well that people would notice he's a superhero?  Thats what my chess program has been doing. More to the point, it tries very hard to beat the opponent, without ACTUALLY beating the opponent. It will make every effort to win but NEVER take an opportunity to win.

Ha!  Bizarre, but a consequence of the recent code I put in to handle check, and backing out so the previous ply would know it was an illegal move. Whoops!  I guess this kind of invalidates the Video Chess comparison - but not really. The comparison was against the engine in its current state, bugs and all.  But anyway, I need to find a way to handle check that is compatible with the negamax and quiescent code.

Meanwhile, I now have illegal moves no longer available for the player. Or, mostly. I've been holding off on this until I found an efficient way to handle it. It's done by a scan, just after all moves are generated, so see if any of the capture moves are capturing a king. Then I set a flag. This is fairly efficient because the move list is sorted, with capture moves first. And now that's in/working, I can extend it to work for castling. Basically, the king when castling will "cross" two squares. I'll have two vars (king1, king2) which are normally 0, but when castling, these are set to the squares the king crosses. And the move gen code which scans for capture of a king can see when those vars are non-0 and do a scan for any moves with those as destination squares. If so, then just like being in-check, a flag is set to indicate the previous move was illegal.

This is a relatively efficient way to do things, I think.

Meanwhile, I'm under pressure to find a better way to handle the check stuff in-game. I've disabled it now and it readily performs checkmates against me in test scenarios. When I gave it two queens and a king against my king before, it found it impossible to win. Now it readily either checkmates or stalemates me. I'm really just dealing with fringe/edge cases. A stalemate is effectively "take the king on the next move" sort of thing. I have a bit of tinkering to do. Frustrating.

  • Like 2
Link to comment
Share on other sites

8 hours ago, Andrew Davie said:

To be clear, you played a level that is allowed 10-12 minutes per move?

Before I started the game to confirm what I was doing I referred to the manual.  Game 5 is 3minutes 15 seconds, which I deemed more than satisfactory.

8 hours ago, Andrew Davie said:

I'm going to have to put some smarts in that evaluation algorithm sometime and see how that spices things up. But first I'm going to get all the other mechanics as good as I can. Then it will be time to put some "thinking" in.

Please can I make a request.  When the engine has finished it's rather nice animated move, can the cursor be positioned from where the piece moved and that the moved piece flashes.  I could easily miss which piece has moved when pitting two engines together, if I happen to get distracted during the movement made.

 

The game was very much evident as between two different game styles.

 

I'd like to add that Video Chess played a very by the book game.  I have no idea what chess knowledge is in it but it plays very safe calculated moves.  It had one clear advantage seen in the early stages of the game where it knew to castle early on, develop its' pieces and connect the rooks.  That's a text book opening.  This early development served it well later in the game against the version of chess played.  I should add that Video Chess was not quick in making moves (even move 17 - Queen capture was thought about).

 

As for Chess (chess20200419_3ply_quiescent#2_5ply), it played a very direct game.  Moves 5 (Bishop) and move 10 (Queen), show how this engine thinks.  When you see those diagonal moves from these pieces it has a plan.  I found this current engine now mobilises minor pieces like Bishops and Knights first.  It has an inclination to sacrifice Bishops for Knights, and is very happy to exchange pieces.  It still moves the queen early and tends to save the Rooks for later.  I understand this is still at alpha, not having all functions implemented so it's game can only get better.

 

I shall look forward to this game putting on its' super hero suite, as there are other games I would like to play this against.

Link to comment
Share on other sites

2 hours ago, Voxel said:

Please can I make a request.  When the engine has finished it's rather nice animated move, can the cursor be positioned from where the piece moved and that the moved piece flashes.  I could easily miss which piece has moved when pitting two engines together, if I happen to get distracted during the movement made.

That's an excellent suggestion. I, too, have missed which piece has moved regularly. I've made the change in this new version. There's a double-flash after the computer makes its move, which I hope to get rid of soon. But you can see what you have requested is implemented, and I think it works quite well. Thanks.
 

 

 

 

chess20200419_UI.bin

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

I really like that from/to indication. I've put the same thing in for the player, too. Seems to work.

Here's a minor update with that change, and a longer gameplay video, just because I can.
This is getting close to the version I'll "submit" for the @ZeroPage Homebrew show. I don't think I'm going to be able to fix up all of the issues with "in check" and what to do there. The user's move selection, though, is now correct - except for castling in check - so that's a plus.

 

 

Things to note in the video -- the "from" square is now highlighted at the start of any move.

When castling, both the king move and the rook move have the start square highlighted but as the rook moves last, it is the rook that does the flashing.
 

chess20200419_UI2.bin

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

I'd like to enquire about your thoughts on the implementation of best line played last go, being carried over as a strong candidate in the search for the next move.

5 hours ago, Andrew Davie said:

Have you ever seen the movie "The Incredibles" where the boy was in a foot-race and he was trying to win but not win so incredibly well that people would notice he's a superhero?

I'm following on from your line above, but having the engine think of a worse case scenario to it's moves and be prepared to play them.

 

So engine searches, and says I'm going to play this great move. Engine makes move.  Engine also looks ahead and sees humans' next possible best moves in reponse and says here are a few.  I'll remember them as possibilities (only the worst case scenarios it might need to deal with).  Human moves.  Engine then picks up the stored tree with moves and says, human went with that move, I'll see if it matches any of the ones stored.  If it matches the engine searches the next series along that tree in addition to any others in its' algorithm for other pieces on the board for its' next move candidate. It would see when the tree is exhausted and null it so as to not persue it further.

Link to comment
Share on other sites

29 minutes ago, Karl G said:

I like the new move indicator quite a bit. Since you are enjoying pictures of the game on CRT, here is mine running on my modded Jr hooked up to a tiny 9" Sony Triniton TV. 

 

IMG_20200419_1240261.thumb.jpg.9fe5f26738b045b2bb668e5857f3bf83.jpg

Thanks for that. Beautiful. I think the tiny colour TVs just work the best for this sort of graphics.

Here's an interesting aside. By now you're familiar with the pieces and they probably look all pretty easy to recognise.

Turn your TV (or the picture!) upside-down and see how much, much more difficult they are to recognise.

 

Link to comment
Share on other sites

6 minutes ago, Andrew Davie said:

Turn your TV (or the picture!) upside-down and see how much, much more difficult they are to recognise.

Huh. It didn't that much more difficult to me. I guess maybe my brain's pattern recognition software is slightly different. :)

Link to comment
Share on other sites

Just played against the latest engine - it is moving really fast is this the 4ply version? The UI is really smooth, it did well at first then seemed to be moving to fast/not going enough moves deep to be 4x I think.

 

I took a pic on my cell - have to figure out how to get it off of there again now - it looks like I have brighter artifact colors than Carl and Gray Defender, likely due to RF and no composite mod.

 

Here is a breakdown pic from earlier discussion on the different atrifact colors available over NTSC from the patterns - I didn't find the crumpled paper pic with the 8 artifact colors but this one has 4 or 5, the emu is not showing them all I think:

SurfCity_NTSC_Image.jpg

SurfCity_BW_Image.jpg

  • Like 1
Link to comment
Share on other sites

Here's a version where I've tweaked the "position" tables a bit, the effect of which appears to improve the "urgency" for the computer to develop pieces and more particularly castle early, and indirectly connect the rooks. It's amazing what tweaking a few numbers can do to change the gameplay. These tables will undergo lots of refinement, but I thought I'd share the result of the first pass...

 

chess20200420.bin

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

10 hours ago, Mr SQL said:

I took a pic on my cell - have to figure out how to get it off of there again now

Two easy options - email to yourself, if you have email setup on your phone.

Or, install Dropbox on phone and your laptop, then just drop it in your Dropbox folder.

Link to comment
Share on other sites

Here is my first candidate version for playing/demo on the @ZeroPage Homebrew show this Wednesday.

It has a whopping 11-ply quiescence search (!!) although in testing I've only seen it go to 11-ply

The actual search is a mere 3-ply, so it's generally going to play moves quite quickly.

 

1) no en-passant moves

2) you can castle in/across check

3) no repetitive draw - consider if you get repetition YOU have to choose a different move (although the computer does have SOME randomness)

4) when all is lost, the computer accepts loss of its king and fights on. If you take the computer king before he takes yours, you win

 

Any feedback gratefully accepted!

 

 

 

chess20200420_ZPH_Candidate1.bin

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

On 4/19/2020 at 7:13 AM, Gray Defender said:

This is much better in all ways.  It was difficult to get a good image due to flickering visible on camera but I thought this one came out nice.  From the Atari 2600 Jr. Composite...

Here's a tip you can try to reduce flicker when taking pictures...

TV in front of a wall, preferably light in colour.

First, put a light/lamp behind your back, pointing "towards" the TV, but not directly at it.  The lamp highilghts the wall behind the TV. Rest of the lights in the room off. So, only the lamp giving illumination in the room. The camera sees the light reflected off the wall, and the image on the TV. You want to be able to shift your body to obscure some of the light heading towards the wall.  Now, as you point your cam to the TV, the exposure rate will automatically adjust, based on the light it detects. You want to now shift your body to change the background light the camera detects, so it increases or decreases its exposure time. You want the exposure timing to match a multiple of the frame rate. You should see this by reduction in flicker on the camera view/image. It sounds screwy, but actually works - at least for my mobile phones.  I figured this out when trying to take images of my mechanical TV's display, which has a frame rate of 12.5Hz.

 

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

17 hours ago, Mr SQL said:

Just played against the latest engine - it is moving really fast is this the 4ply version? The UI is really smooth, it did well at first then seemed to be moving to fast/not going enough moves deep to be 4x I think.

 

If it's moving fast, almost certainly 3-ply.

I plan to dynamically change the depth searched, based on the # nodes visited in the previous move cycle.

Link to comment
Share on other sites

18 hours ago, Voxel said:

I'd like to enquire about your thoughts on the implementation of best line played last go, being carried over as a strong candidate in the search for the next move.

I'm following on from your line above, but having the engine think of a worse case scenario to it's moves and be prepared to play them.

 

So engine searches, and says I'm going to play this great move. Engine makes move.  Engine also looks ahead and sees humans' next possible best moves in reponse and says here are a few.  I'll remember them as possibilities (only the worst case scenarios it might need to deal with).  Human moves.  Engine then picks up the stored tree with moves and says, human went with that move, I'll see if it matches any of the ones stored.  If it matches the engine searches the next series along that tree in addition to any others in its' algorithm for other pieces on the board for its' next move candidate. It would see when the tree is exhausted and null it so as to not persue it further.

 

Your thinking seems sound to me, but don't forget this is running on a very underpowered Atari 2600.  Even though I have extra ROM/RAM to play with, these come with significant penalties/limitations, particularly with this bank-switching scheme (3E).  What you are describing are the sorts of things that would make a lot of sense on a platform that has some decent memory and processing power :)
I don't think it's going to happen on this little effort, I'm afraid!  I'm really, really struggling to get anything new put in at the moment, due to being out of ROM space in the banks that I really need it in.

  • 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...