Jump to content
IGNORED

Chess


Andrew Davie

Recommended Posts

A couple of forward-steps.

 

The video shows a few things. Firstly, note the new "available move" shape.  Almost little balls.

 

Secondly, this is a test position to allow me to demonstrate...

a) pawn promotion now working in 3E+

b) preventing "castling across check" now implemented.

 

 

In particular, the board is setup so the white king/rook are in a potential position to castle.

But in this setup the castling should be prevented by that bishop.

 

You can't castle whilst in check, nor can you castle if either of the two squares the king crosses are in check. The bishop can also be positioned to attack the king or either of the two squares between king and rook and the program will not allow castling.

When I hold down "show moves" initially, you see the king-moving-two (i.e., castling) is not available. This is good, because one of the squares the king crosses, as noted, is in check.  Then I capture the bishop with the queen. King's "path" no longer in check. Now I "show moves" and the castling (two-square move) is available. This is demonstrating that you can no longer castle if the king is in check, or if the squares the king occupies during the castling (and after) are in check.  In the end the implementation of this was very cheap and just a few lines of code.
 

 

Also in the video, I do a simple pawn promotion to queen to show that's working properly.

 

I just have that pesky en-passant move to fix, and we'll be good to play against other chess engines without coming to a dead-stop because of unimplemented or incorrectly implemented stuff.

 

 

chess3E+20200517_3PQ6.bin

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

49 minutes ago, Andrew Davie said:

Fortunately, only those who want to see this pattern will actually see it.

 

is there anyway to slow down the think bars a little, or would that slow down the actual thinking?

 

I never got past programming in basic and the last time I did that was in the early 80s, so don't always understand how these things are linked, especially with memory constraints.

Link to comment
Share on other sites

On 5/16/2020 at 5:18 PM, Al_Nafuur said:

v14 in my UnoCart fork with 3E+, for those who dare:

https://github.com/Al-Nafuur/UnoCart-2600/releases

 

Because i don't have an UnoCart, not tested on real hardware and without any warranty!!! So only try, if you know how to reflash v13 with ST-Link

Thanks alot! Merged, fixed and released on Github as v14 (https://github.com/DirtyHairy/UnoCart-2600/releases/tag/v14).

 

IMG_0051.jpeg

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

3 hours ago, Keatah said:

The new shaded "possible-move" dots are cute. Can they be made a more contrasting color? Or is there a hardware limitation?

Other combinations are possible, but due to the split-nature of pixel colours over 3 lines, the one used now seems to be the best.

 


 

Link to comment
Share on other sites

4 hours ago, D Train said:

is there anyway to slow down the think bars a little, or would that slow down the actual thinking?

 

Technically yes. Practically no.

 

The reason I'm not going to worry too much about this is because the thinkbars are drawn without a valid TV frame. That is, the number of scanlines per frame, as such, being fed to the TV is effectively infinite. There are no control signals for the TV to "lock on" to, to start/end a frame. Just a whole bunch of scanlines. So, the TV will display as many as it possibly can (and this varies from TV to TV) and then start afresh, effectively rolling the picture. This varies from TV to TV. This means that what is one thinkbar pattern on one scanline will almost certainly be a totally different one/phase on the next "frame", and that will also be different from one TV to another. I simply have no control over what the TV will look like.  Therefore, though I can slow down the thinkbars easily enough, what really happens is that those diamonds you see become longer vertically, and it doesn't take much to destroy the impression there's a pattern there. Then the thinkbars just become (almost) vertical lines which are jumping randomly on the screen. It's really not worth putting much/any effort into this. It's just an optional visual to show the game is thinking still, and is only incidental.

 

  • Like 1
Link to comment
Share on other sites

11 minutes ago, D Train said:

ah, ok.  I *think* I understand what is going on there.

 

thank you for the response!

 

Trying to think of an analogy...

Imagine a looped roll of paper with the diamond/dot pattern on it. Say it's on a belt sander... It is on a looped roller in other words.

So, you have a camera to take pictures of the paper as it whizzes past the lens.  Each time you take a photo, that's what you see on your TV.

So now, imagine we have no idea how fast the belt sander is going. For each person it runs at different speeds...

Firstly, you don't see the same pattern from picture to picture - you essentially see somewhere random on the paper roll.

Secondly, it's different for each person doing this - because their belt sander is running at a different speed.

 

So that's a loose analogy of what the thinkbars are like on a TV.

And now, your question "is there any way to slow down the thinkbars a little" comes down to "what happens if I change the pattern drawn on the roll of paper" -- and the answer to that is... not much.  What each person sees will have a different visual to what they had originally, but it's still driven by unknowns (the speed of the paper whizzing by the lens). And still, you have a semi-random hodgepodge of disconnected "pictures" that are not continuous from one picture to the other, as they are just pictures of (essentially) random spots on the paper roll, played one after the other.

 

 

  • Like 1
Link to comment
Share on other sites

30 minutes ago, Keatah said:

I see concepts for  homebrews based on toilet paper and zoetropes.

it's how kids played video games in the 1860s

 

combat featured trench warfare and gattling guns pulled by mule teams.

 

it was slower than tanks shooting each other and spinning in circles, but much more gruesome.

Link to comment
Share on other sites

Just now, D Train said:

ok, that basically matches up with the image in my head.  thanks!

OK, good. Now add to that, that the sander is in fact constantly (and rapidly) changing the speed at which it is running while you are taking pictures. If you imagine that instead of all-at-once, your camera actually captures the picture sequentially from top of image to bottom, over 1/60th of a second, and the speed of the sander is running faster/slower as it's capturing the picture.  Vertical lines will be stretched/shrunk, visually, depending on the speed of the sander at any particular part of the picture capture.

 

  • Like 1
Link to comment
Share on other sites

Looks like I'll be able to release an en-passant-capable version tomorrow. Just a few things to fix up. Here's a video showing a test position with en-passant in action for both human, and computer.  The animation works for me, and logic seems correct.

Also, a slightly more contrasty "show move" dot to check out.

 

  • Like 5
Link to comment
Share on other sites

13 minutes ago, Andrew Davie said:

Looks like I'll be able to release an en-passant-capable version tomorrow. Just a few things to fix up. Here's a video showing a test position with en-passant in action for both human, and computer.  The animation works for me, and logic seems correct.

Also, a slightly more contrasty "show move" dot to check out.

 

 

 

Today I learned, TIL, a special chess move called "en-passant" .  Thanks and nice work Andrew...

Link to comment
Share on other sites

18 hours ago, Karl G said:

The update worked for me, too. Thanks guys! 

 

 

IMG_20200517_1914161.thumb.jpg.61b937f6ae09fb1e779ee700080572ce.jpg

 

Hey Karl G, can you please take a photo of your CRT screen while running one of the 20200515 releases (post# 730)?  I want to compare how the white pawns look in that release to the one that you are running in the photo above.  Thanks!

 

Link to comment
Share on other sites

3 hours ago, NostAlgae37 said:

Hey Karl G, can you please take a photo of your CRT screen while running one of the 20200515 releases (post# 730)?  I want to compare how the white pawns look in that release to the one that you are running in the photo above.  Thanks

Sure thing. I'll do that shortly-ish. 

Link to comment
Share on other sites

4 hours ago, NostAlgae37 said:

 

Hey Karl G, can you please take a photo of your CRT screen while running one of the 20200515 releases (post# 730)?  I want to compare how the white pawns look in that release to the one that you are running in the photo above.  Thanks!

 

Here's the 5-15 version. Any differences are subtle. 

 

IMG_20200518_1832406.thumb.jpg.f045338cc8b240fe00df28d92894dfe3.jpg

 

 

Link to comment
Share on other sites

17 hours ago, Andrew Davie said:

Looks like I'll be able to release an en-passant-capable version tomorrow. Just a few things to fix up. Here's a video showing a test position with en-passant in action for both human, and computer.  The animation works for me, and logic seems correct.

Also, a slightly more contrasty "show move" dot to check out.

 

 

Very cool I can't wait to play this version! :)

 

The flipped squares are back - I was just about to play the latest release with the new BS scheme but noticed the squares are reversed again; interestingly they were reversed in the last couple of pics posted, but I didn't notice until I sat down to play. 

 

Link to comment
Share on other sites

2 hours ago, Mr SQL said:

Very cool I can't wait to play this version! :)

 

The flipped squares are back - I was just about to play the latest release with the new BS scheme but noticed the squares are reversed again; interestingly they were reversed in the last couple of pics posted, but I didn't notice until I sat down to play. 

 

Yes, they keep flipping. Annoying. I think I've fixed it now.

 

  • Like 1
Link to comment
Share on other sites

I thought I'd throw in a few bugs for this version, just because I see to be really good at doing that. If you start a game and the background turns green or red, then for some reason moves aren't being generated.  Just start again, it should be OK. For some other reason I think the computer's castling is broken - computer seems very reluctant to castle, so there's that. Let me know if you ever see it castle!

 

Now the good news. I have installed en passant, and although this is very untested and early days, it's there, and hopefully will work.

 

Second good news - you can now swap sides. Whenever it's your turn to move, and you're actually in the process of moving the cursor around to select a piece to move, well THEN you can hit SELECT, and you will immediately swap sides. The computer will immediately start choosing a move for (what was) your side.  After computer has moved, of course, you respond using the other colour. If the computer has just moved and its piece is blinking, you have to stop the blinking (press any direction) to get into your "select move" mode, and THEN you can swap sides (SELECT).

To start a game as black, all you need to do is start the game, and press/release SELECT.  Unfortunately, a "feature" of doing this is that the computer will choose what's probably the worst possible first move.  Just spotted that. Something to do with the "seed" values for pruning, I think. Will fix soon.  After the first move it selects reasonable moves.

 

Note that SELECT is ALSO used when the computer is thinking, to force it to make an immediate move. Don't worry, though - these don't clash because the game waits for you to release the SELECT in both cases, before proceeding.

 

Couple of versions to play with - 3PQ6 and 4PQ6, with - as I said - bonus bugs.

I've fixed the square colours once again. This time I've nailed them down so they're unlikely to shift again.

 

I have about 10% confidence that en-passant is working perfectly - but it takes so long to test, I'm just putting this one out there and we shall see, over time, how it goes.  It worked in my test positions, but getting it in a real-world situation isn't exactly easy.

 

chess3E+20200519_4PQ6.bin chess3E+20200519_3PQ6.bin

Edited by Andrew Davie
  • Like 2
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...