Jump to content
IGNORED

Chess


Andrew Davie

Recommended Posts

The board looks somewhat retro with the rounded look, surprised you kept the cursor square.

 

Will you be allowing us to edit the board setup to play scenarios, an option that would also allow us to get around en-passant if not implemented.

Link to comment
Share on other sites

1 minute ago, Voxel said:

The board looks somewhat retro with the rounded look, surprised you kept the cursor square.

 

Will you be allowing us to edit the board setup to play scenarios, an option that would also allow us to get around en-passant if not implemented.

 

Board customisation will be very late in the piece. So, don't hold your breath.

En-passant will be implemented.

 

  • Thanks 2
Link to comment
Share on other sites

I setup MAME emulator and found the ROM for Fidelity Electronics Chess Challenger 10 (CCX), from 1978.

 

I played with CCX on Level 3, against my program 3-ply quiescent-6

 

Destroyed!  It was a really interesting positional game at the start, but my program was relentless in attack, and won easily. I didn't write down the moves, but did many screenshots starting in the midgame, when it looked interesting. One oddity - because CCX swaps rotates square notations when playing white, I had to figure out the from/to. But I got it right. In other words, you can't rely on what you see on the CC screen. You have to number your columns right-to-left (A on right), and squares from top to bottom (1 on top).

 

So, CC's first move (as white) was D7-D5 or somesuch.  Anyway, ignoring that oddity -- was fun to see how it went.

Both had about the same thinking time.

 

346928768_ScreenShot2020-05-04at1_55_13am.thumb.png.7dec2e2bb7fade5946898593ecc10dc4.png

 

End position shown (+last computer move, D6-F8, which was after CCX resignation).

Game took about an hour and a half. You can see the huge material and positional advantage at the end.

 

Early on, though, the midgame was quite even and extremely busy...
 

1882968475_ScreenShot2020-05-04at1_13_39am.thumb.png.e8517532a79318cbb7508d460cce053a.png

 

Overall I really enjoyed this, particularly as it became clearer that "I" was winning!

The zip file contains the screenshots I did during gameplay. The video is just these screenshots being flipped through one by one. You can get some idea of the gameplay, though it's not perfect....

 



 

vsCC10_20200504.zip

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

2 hours ago, Andrew Davie said:

One oddity - because CCX swaps rotates square notations when playing white, I had to figure out the from/to. But I got it right. In other words, you can't rely on what you see on the CC screen. You have to number your columns right-to-left (A on right), and squares from top to bottom (1 on top).

CC10 can play as white (just press EN to have it make the 1st move) or black, either from the top or bottom of the board. I had to figure out the exact keys to get it to the bottom since it differs a little from CC7 which I'm more familiar with, but for CC10 to play as white, from the bottom, you have to press

 

1) DM

2) PB 

 

Then it will make it's first move from the bottom of the board as white :) 

 

 

  • Thanks 1
Link to comment
Share on other sites

15 hours ago, Andrew Davie said:

I expect the 6-ply to take about a day per move

Are you wanting anyone to test the 6-ply version on real hardware? I couldn't promise a whole game, but it might be interesting to see how long it takes for 1 move.  ?

 

How many plys would it take for it to require 7.5 million years to calculate the next move? Or how many until the heat death of the universe comes first?

Link to comment
Share on other sites

4 hours ago, Karl G said:

Are you wanting anyone to test the 6-ply version on real hardware? I couldn't promise a whole game, but it might be interesting to see how long it takes for 1 move.  ?

 

How many plys would it take for it to require 7.5 million years to calculate the next move? Or how many until the heat death of the universe comes first?

 

No test needed, thanks. I played some of a game and have a reasonable idea. In any case, hardware will be the same speed as Stella.

 

If you take average move at 3ply to be about 30 seconds, and the alpha-beta branching at 8, then it is examining 8^3 moves in 30 seconds. That's 512/30 = 17. Let's say 20.  It's probably a bit better than that, I dunno. So, in 7.5 million years? That's how many seconds.... 171882000000000 which /20 is 8594100000000 moves.  At the given branching of 8, then that would be log(8)8594100000000 ply. I make that 14-ply.

 

I hope to get the branching factor down to 4 or so. That would mean it would be searching 4^3 = 64 moves and take about 3 seconds for a 3-ply search. The corresponding ply depth for 7.5 million years would be log(4)8594100000000.  That's 21-ply.

 

With the coming efficiencies in the 3E+ version I think I could stretch this to 22-ply. Given 7.5 million years think time.

 

 

  • Like 2
Link to comment
Share on other sites

7 hours ago, Keatah said:

Just wondering why the blue squares are rounded off? They tend to look like checkers and don't seem that homogeneous. And they make the black squares look weird in an indirect way. I think they should have been left alone.

 

They started as a way to make the coming 3E+ version look different, but I liked them enough to retrofit to the 3E version.

I like them, it does give the board a retro feel.

 

Link to comment
Share on other sites

I played most of a game against Sensory Chess Challenger 8 (1980).  It was a fascinating and very tight game, marred by my game's decision to castle 'across' check, which is illegal. I setup the board to allow that, and continued. So, not a legal game, so to speak, but nonetheless the moves were tight and interesting. In the mid-game, my chess was extremely aggressive and it took everything SCC8 had to wiggle out of it. It was continually one move away from mating my program, but likewise mine was one move away from mating SCC8. I had no idea who would win, but I was hopeful, given that my game had managed to gain material and was something like a bishop up in late mid-game.  But then SCC8 seemed to switch into overdrive and once given a chance to attack, the game was up, so to speak. The SCC8 queen went rampant and caused mayhem in the late part of the game, up to the point where I goofed with the SCC8 board position and couldn't be bothered fixing it, so resigned on my proggy's behalf.

I played with SCC8 on level H4, which is rated as "advanced", being about 2 minutes per move. My game was playing on 4PQ8 and was probably taking a bit longer than SCC8 but it wasn't too bad.  

 

I now have something to aim for - consistently beat SCC8 on level H4. I know it's close.  I suspect that SCC8 has code that kicks in during a late-midgame/endgame situation, because my program definitely seemed to be having the better time of things, until that point. A very fun afternoon just watching them have at it.  If you enjoy chess, the video is worth a bit of a watch just to see two programs fairly evenly matched pull out unlikely save after unlikely save.

Sensory Chess Challenger 8 (White) vs. "chess20200504_4pq8" (Black)

 

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

So, having reviewed lots of links on computer chess and in particular the strengths of the chess computers of the '80s, I got to thinking "what are my goals?".  This would allow me to set a roadmap, so to speak. Where to from here.  I thought I'd jot down some of these goals so that I can come back to them in a year or two (hopefully) and see how we did.

1. It's never going to be a competitive program in today's chess world. Don't even try.

   -> an ARM implementation would thrash my 6502 implementation. So it's definitely a "back in the day" thing.

2. It's supposed to be a fun game for the average player on the VCS (in the day).  So, what are the goals there...?

   -> challenging for the average player. Not the world's best chess engine

   -> soundly defeat Video Chess, though!

   -> relatively fast making moves

   -> funny (speech)

   -> modern '2600 graphics techniques

3. What is my destination regarding the engine?

   -> convert to 3E+ bankswitch

   -> refine move sorting to get alpha-beta branching down to about 4 (8.5 currently)

   -> enable en-passant

   -> stop moving across check

   -> stretch goal - iterative deepening

   -> improve evaluation algorithm (midgame/endgame variants)

4. UI

   -> title screen

   -> menu screen

   -> position adjust/setup

   -> switch sides

   -> different levels of play

   -> different "personalities" of play (and speech)

   -> speech!

5. Release

   -> will it be on cart?  possibly

   -> if so, will it be limited release (say, 50 copies, $X each).  Probably. I know people hate limited releases, but there appears to be zero benefit/motivation for me to do an unlimited release.

6. Timeline

   -> no timeline, no pressure. I'll do it (or not) as I feel like it.

 

 

 

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

I have seen that "computer chess" which is a revision of "video chess" has an ELO around 1000.

By that reckoning, and my estimate, I guess I should be beating video chess at this stage, all things being equal.

Time for a head to head, I guess.

 

Link to comment
Share on other sites

Well, I did a head-to-head against Video Chess. Very disappointing!

Video Chess was playing Level 5 against a 4PQ8 variant of my game.

It ended up as a clueless and aimless draw, with Video Chess one pawn ahead.

This was the ugliest, most formless, and error-riddled game I've seen the program play for a long time.

Clearly I have some work to do.  I'll have to come back to this, beating Video Chess convincingly is my goal.

It appears, based on the move times, that Video Chess might very well increase its search towards the end-game. It appeared to be taking longer (or at least, the same amount of time), whereas my program was getting quicker and quicker. Possibly the difference between time-based searching and depth-based searching. So there's another thing to look at.

This is one ugly game.

 

Video Chess (White) vs chess20200504_4pq8 (Black)

 

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

Thanks for sharing all the played games.

 

The last one with Video Chess, is interesting.  It shows how closely matched the two engines really are, though both having to contend with an opponent with a different style of play.

  • Like 1
Link to comment
Share on other sites

Presumably your engine speeds up when there are less pieces (kind of like Space Invaders when there is only 1 alien left).

 

Could you search another ply for every X pieces removed from the board?
And/or adjust quiescence for pieces removed.

Link to comment
Share on other sites

I'm making silly mistakes. See in the last video or two where the black (computer) pawns tend to stay at home plate?  This was unusual, and I tracked it down to an error in the evaluation function. In particular, I swap the board rows for black pieces, and use the white piece tables. This is logically OK, but I also thought, for some weird reason (hey, black pawns move DOWN and white pawns move UP... I need two tables for these). So I created a table for black pawn positions, and one for white pawn positions. And of course I put the highest values on the "rank 7" for the pawns, with decreasing values as the rows get closer to their home position. All well and good, except this is totally bogus. A black pawn is a white pawn when the rows are flipped. They have the same goal - get to the last row.  So what was happening was that pawns were being rewarded for being on their home row as if they were on row 7 and about to promote themselves. No wonder they didn't want to move!  For to move, would be to lose points in the evaluation. Significant points.  Well, that's fixed now - silly error, and we have a bit of pawn structure.

Edit: and yes, the game against Video Chess was deliberately NOT moving pawns the whole game.

Not making much of any progress on the 3E+ conversion. It's becoming "the impossible task". Might as well just accept that and take a few days break from it, just potter around and have fun with other things. Putting things into perspective, the game shown in the video is playing way beyond my wildest hopes when I started. A pure 6502 engine written from scratch - so I'm very happy with that. But I can see soo much more that can be done to make it harder, better, faster, stronger. Mhh.... More than ever, hour after hour, work is, over....
 


Two binaries attached - you know the naming conventions by now, I hope.

Short video of a 3PQ8 game... I had it at 300% speed in Stella just to make it quick.
It played quite well, considering - certainly an "enjoyable" if not technically "correct" game. It is sometimes nice to win easily, but not too easily. The moves were made relatively quickly, and given that - not too bad, really. Fun.
 

 

chess20200505_4pq8b.bin chess20200505_3pq8b.bin

Edited by Andrew Davie
Updated binary which places more importance on mobility. Give it a whiz!
  • Like 1
  • Thanks 2
Link to comment
Share on other sites

35 minutes ago, stepho said:

Presumably your engine speeds up when there are less pieces (kind of like Space Invaders when there is only 1 alien left).

Yes, very similar. Same principle.

 

35 minutes ago, stepho said:

Could you search another ply for every X pieces removed from the board?
And/or adjust quiescence for pieces removed.


Yes, but I'm thinking of another way to do it. I know how many moves are searched. I have a simple 3-byte counter for that. Although all positions are not equal, and listing moves in some take longer than others, for the main part I can average the time for generating moves and use the counter as an indication of time taken. I could use that counter to increase the plys searched.  That's one of the improvements I mention above.

 

 

Link to comment
Share on other sites

I've played a few games on 3PQ8 on that last version. Two of which I had an enjoyable, but somewhat baffling, forced mate against it. I think I've finally figured it out. Another goof by me.  The alpha-beta algorithm requires something of a "zero sum" such that evaluation of any position can be accurately measured against evaluation of any other position. We expect to simply be able to say "better" or "worse" based on the evaluation score. That seems pretty simple.


Well, when I put in the "mobility" component, I thought "hey, I'll just add the number of moves to the evaluation".  The thinking was, white will add moves this ply, then black, the next ply, then white, etc., And it will all "even out".  But it doesn't. This breaks the fundamental "zero sum" concept, and the alpha-beta algorithm will bork because of it. I could probably add (my moves - opponent moves) at each ply, but I really don't have the opponent # moves easily (or accurately) available at that point.  So, it looks like mobility will severely hamper the alpha-beta pruning, as currently implemented. The game will play interesting, but ultimately flawed moves, and the last version can be discounted from any evaluation.

 

I can't recall if I had this mobility component active in the Video Chess challenge. I don't think so, but don't know for sure. In any case, there is probably grounds for another evaluation of the two against each other now that I've found some bugs/changes.

 

  • Like 2
Link to comment
Share on other sites

I did a rematch against Video Chess, and what a "remarkable" game.

 

In the end I called it a draw because neither side had any real interest in pushing an endgame. But my program was 5 pawns and a bishop against 3 pawns and clearly in a far, far better position. Only it knows nothing (yet) about endgames or goals thereof.  In particular, the king was still playing as if it were an opening, so hiding in the corner on the home rank, forbidden to come out. So it played effectively the whole of the game (particularly the endgame) without the king being involved in any way.

Early on, Video Chess got a pawn forward to attack a bishop/knight at the same time. Normally a disaster, but somehow and much to my amazement, my program not only saved the bishop and/or knight, but ended up winning the pawn at the same time. Still not quite sure how it pulled that one off!  Also of interest - my program was dead set keen to get a rook onto row 7 - normally a good strategy. But, it did it early on and soon became hemmed in - and the Video Chess king soon chased it down and killed it (in exchange for a knight). That, and a few exchanges, left Video Chess with a rook against bishop which would normally be the death knell for the bishop side. But my program was up on pawns, and I was thrilled so see it play very well indeed, and march the pawn down and promote it.  Interestingly the promotion was to a rook, of all things, basically because it knew that it would be exchanged/captured very next move. But that effectively became an exchange pawn for Video Chess's rook, and suddenly in the endgame, my program was 5 pawns and a bishop against 3 pawns.

But, given that my program's king steadfastly refused to move - coward king - the Video Chess clearly had an advantage in the endgame. But, after both engines waffling about a bit, with no result looking terribly likely, I called it - a draw.

It was a fascinating game to watch, and clearly the tweaks and fixes I've made to the evaluation routine have made a huge difference. Ignoring the king-coward thing, which I will fix shortly, I think perhaps my engine is now playing at a (slightly) higher ELO than Video Chess level 5.  They were both taking fairly similar amounts of time to make their moves.

 

 

Atari Video Chess (White) vs chess20200406_4pq8 (black)

 


The binary attached is the actual one used for the game in the video.
 

 

chess20050506_4pq8.bin

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

Here's where I'm at with the 3E+ conversion.

It's drawing an almost-correct screen, and it's stable.

 

1194381725_ScreenShot2020-05-07at12_29_43am.thumb.png.e9edda38875d28b2164bd79838cf0e09.png

 

This is most of the hard work done. It means I'm managing the bankswitch scheme properly, and have an effective and fairly simple way to manage the banks, and what I put where. It also means that the actual 3E+ code in Stella appears to be working properly, too. This is a fairly complex combination of RAM and ROM banks, with various copying between. There are a few more changes than I expected, converting from 3E to 3E+, but overall it hasn't been too much of a pain. It's going to make a big difference and make it easy for me to add lots more features.

I'm buggered if I know why the pieces are changing colour like that. It's a weird one and I've given up for the day.

 

 


It's a lovely day tomorrow
Tomorrow is a lovely day
Come and feast your tear dimmed eyes
On tomorrow's clear blue skies
If today your heart is weary
If ev'ry little thing looks gray
Just forget your troubles and learn to say
Tomorrow is a lovely day

 

 

  • Like 4
Link to comment
Share on other sites

43 minutes ago, Thomas Jentzsch said:

Glad you like 3E+. 

 

It would help if you let me know which features are really relevant and which are not or only minimal.

 

I don't know quite what you are asking here.

I'm happy to help, but I'm just using all 4 switchable areas, both as ROM and as RAM.

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