Jump to content
IGNORED

Chess


Andrew Davie

Recommended Posts

For posterity, here is the very first "game" played against the computer.

What I'm really looking at here is the human player move selection process. I have a bit of time overflow when the piece is flashing, so ignore that. But basically the flow is very good - move the cursor, select a piece - it flashes - move the cursor, select a square - the piece moves - and the computer selects a (random) move. A few odd things, for one the human king appears to have no available moves. I'll have a look-see at that very soon. Anyway, this video made just a minute or two after the move selection code started working. I think it works very well. Still to do - mark the squares to which a piece can move.
 

  • Like 6
Link to comment
Share on other sites

Here's the prototype of move-marking. After selecting a piece to move, the board is populated with dots/markers where that piece can move to. Currently they stay there until you move. However, I'm thinking firstly they will be an option in the game so they only show if you turn them on. But secondly, I think they should just display for a few seconds and then disappear.

 

Next on the plate (aside from cleaning up the timing/glitches) is allowing cancellation of a move. That's simple - just click on the same square again and the piece will stop flashing.
 

  • Like 1
Link to comment
Share on other sites

It is looking better and better! 

 

As far as the markers for possible moves go, having a way to turn off the feature would be good, but I don't see an advantage to having them fade away after a few seconds if they are enabled. 

 

Also, is there any way to increase the contrast between the light and dark piece colors?

  • Like 1
Link to comment
Share on other sites

7 minutes ago, Karl G said:

It is looking better and better! 

 

As far as the markers for possible moves go, having a way to turn off the feature would be good, but I don't see an advantage to having them fade away after a few seconds if they are enabled. 

 

Also, is there any way to increase the contrast between the light and dark piece colors?

No, not really.... there are very few options for increasing the contrast.

This is because "dark" colours are made from colour A+B, and light colours are made from colour A+B+C

So, C is the only difference. And colour C is the square colour (BLUE)... which generally needs to be darkish.

If I increase the brightness of C, the board becomes much brighter but the contrast increases... sort of.

It's all very incestuous.  I'll see what I can do before I finish the thing.... but it's not an easy ask.

 

Link to comment
Share on other sites

Here's a binary.

 

Move the "selection cursor" around the board with the joystick.

It pulses green when over a piece that you can move.

Press the button to select the piece OR....

HOLD the button to select the piece and display all available moves for the piece.

After button release, move the cursor to the destination square.

The cursor will be green when it is over valid squares.

 

 

chess_20200210.bin

  • Like 4
Link to comment
Share on other sites

41 minutes ago, Random Terrain said:

Is there a way to un-select a selected piece yet? Also, can you hold on a piece that is already selected in case you forgot your legal moves?

Un-select - not yet, but it will be simply clicking the destination square as the start square.

The process for your "also" will be to un-select and select/hold.  That is, if you have already released the initial press.

You can hold the initial press (to see the legal moves) for as long as you like.

 

  • Like 2
Link to comment
Share on other sites

5 hours ago, Voxel said:

Will there be an option to start as black?  I can see you've worked hard with your colour schemes but...

would there be a black and white display option too?  Thanks in advance.

Yes, I plan to implement as much of legal chess as I can.

I may skip the 50-move and repeated move draw, but other than that, it will be chess.

 

If you mean, "black pieces" and "white pieces", then no.  Unless you can find three colours A,B, C which when mixed in these combinatioms #1(A with B) and #2(A with B and C) you get "black" and "white". The point being, the colours of the pieces are NOT independent. They are made from the same 3 colours (as are the squares on the board). There are three colours (+black) TOTAL. And the black/white pieces each MUST be made of at least two of those three colours.

Link to comment
Share on other sites

Still on a quest to make the UI as intuitive as possible.

I changed things slightly, so that if you HOLD the button to show the available moves, when you release the button then you're back to choosing which piece you want to move. Previously it acted as if you had already decided that was the piece to move and you were "locked in" to moving that piece.  Now you can move to a piece, HOLD (1/4 second or so) to see the moves, let go, move to the next piece, HOLD to see moves... etc.  I still have to put in the "exit" from having selected a piece - that is, choose the start square as the destination square to "cancel".

 

I'm going to rework the visuals of "show me my available moves", so that any opposition pieces are removed from the board first before the "move marker" is placed in their square. Currently the marker is drawn "over the top" and it doesn't work, mostly.

 

Currently not working, but should be -- castling, en-passant.  These are failing, I think, because the flag bits for these moves are being stripped off somewhere. Shouldn't be too difficult to fix. 

 

chess_20200210b.bin

  • Like 3
Link to comment
Share on other sites

Well, here's a pleasant surprise. When programming C64 and other machines, it was common practise to put timing bars on the screen. But with the '2600 because ALL of your on-screen time is devoted to drawing the screen, timing bars didn't make sense. Or at least, I thought so. But I had a bit of an idea - why can't I put colour changes (BG timing) in the vblank area?  Well, because the screen is off... basically. But what... what if the screen ISN'T off?  So, turn on the screen early - nothing else changes - and now I can see a great visual indication of how long bits of code are taking. You can see it in the green banding at the top of the display - the green area is "USED" processing time. I never want that green area to go below the top of the visible screen display.  This is going to help heaps! Don't know why I didn't think of this before.
 

  • Like 5
Link to comment
Share on other sites

Thanks for getting back to me.

 

The colours are great for day light.  Sometimes I play with the lights off, a black and white option helps.

 

Will revert to the colour setting on the TV for a black and white option.  It's just easier when it's on the B/W switch.

 

Interesting watching the machine thinking in the last video.

 

Link to comment
Share on other sites

8 hours ago, Voxel said:

Interesting watching the machine thinking in the last video.

 

I think you might be mistaking the human selecting "show me my available moves" for the computer .. "thinking".

I haven't got to the AI/thinking part yet - all computer moves are randomly selected from available legal moves.

Still, that's enough to beat some player :P


However, if you're referring to the green timing bars - sorry for my misunderstanding you!

Edited by Andrew Davie
Link to comment
Share on other sites

Here's the new idea/concept for displaying available moves...

As before, press the button and hold (1/2 sec) on any of your pieces to display all moves for that piece. Most moves are shown as dots on the board, but captures are now flashed on/off.  I still have an issue with the pieces disappearing :P this is related to the EOR-draw. I simply have to make sure that I've drawn the piece an even number of times.  First draw (flash) erases. Second... redraws. So, currently the flashing loop isn't checking to see if it's odd or even, so occasionally the flashing pieces are left in an un-drawn state.

 

 

Edited by Andrew Davie
Changed the video (move marker different)
  • Like 6
Link to comment
Share on other sites

On 2/10/2020 at 5:31 AM, Andrew Davie said:

So, turn on the screen early - nothing else changes - and now I can see a great visual indication of how long bits of code are taking.

 

I did something similar while working on Stay Frosty 2.  For space savings we compressed the levels, but even with the ARM it was taking too long to decompress so I came up with this idea:
 

On 10/16/2013 at 1:04 PM, SpiceWare said:

I've been doing some more thinking and am going to first change it so the decompression runs during the display. Right now there's a single frame at the start of each level where nothing is drawn but the Horizon and score/lives.

post-3056-0-12313100-1381946159_thumb.png

 

I'm going to redo it so that after the Horizon is drawn the first jmp (EarlyHMjmp) will redirect to a new 6507 routine that sets the timer then calls the ARM to decompress the level. After that it'll wait for the timer to finish, then jump back to the score/lives kernel.

 

There should be plenty of time between Horizon and Score for the decompression to run. I can set it up for testing to change the background color before calling the ARM decompression routine, then change it back to black when done. That'll give us a visual way to see how long the decompression routines take.

 

It worked great. Stella doesn't emulate ARM processing time, so I recorded some examples and stepped thru the video to see the time.

 

Level 1:

decompress1.jpg

Level 11:

decompress11.jpg

 

Level 31:

decompress31.jpg

 

 

 

  • Like 3
Link to comment
Share on other sites

This version is 2P humans. In other words, take turns moviing white pieces, then black pieces.

I've fixed up the "show move" stuff - hold the joystick down. Pieces will flash if they can be captured.

I'm still having trouble with the "cancel move" - it's complex because I'm re-using the same piece of code for initial piece selection as for the final square selection. I may have to change that.  I've been going through the state-machine code trying to clean it up and make it more readable. I'll attach it just for fun, in case anyone wants a look-see at how it's working.
Still some minor time overflows when the pieces are flashing, and I have to get that "change your mind" thing fixed. Then find out why the castling and en-passant flags (preventing those moves working properly) are buggered. Then, maybe I better get the piece promotion for human player working. Thing is, when you get a pawn to the end - it remains a pawn :) !!  whereas the computer player was smart enough to promote to another piece. I need to have a think about some neat UI way to allow human to select. I may very well put a queen there, but flash her non-stop. If you press the button again, that's your selection - otherwise any joystick move cycles to the next option (knight, bishop, rook).  There may be situations, though (i'm not sure) where promoting to one of those may actually be an illegal move because of ... "check". Will have to have a think about that.

Feeling a bit like taking a break. Does anyone else find, during development, the stress levels start to skyrocket?  Something about obsession and creativity, I suspect. There have been occasions in the past I've sworn... "never again"... but here I am, giving birth to another child.
 



Also on my mind - if/when I ever complete this, what to do then. Part of me feels there' little point putting it on cartridge because... well, just a major pain to do and what's the point. Another part says "well, put it on cart so it's an official release, but do it yourself and maybe do 100 and then move on". Probably both of those are unpopular. But from my point of view, practically the ONLY satisfaction I get from my games is during development - after they're done (apart from, of course, the good feeling when people like them)... well, I haven't seen $ from Qb for years, I get nothing whatsoever from Boulder Dash for nearly a decade and even then it was small bikkies, and as to Sokoboo well that's not released and in the same boat. I'm waiting for return correspondence from the IP (or at least, trademark) owner on that one but am not holding my breath. I'm pretty sure that there's going to be some sense of entitlement for this game or any other. Maybe I just enjoy writing them - release the binary so people can enjoy playing them... and move on.
 

 

 

chess_20200212.bin

BANK_StateMachine.asm

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

I finally got the user interface state-machine working reliably. I had a helluva time and sometimes it's the simple things that get you. The issue turned out to be that my list of index equates into the state machine table skipped an entry, so when I thought I was vectoring to state #7, I was in fact vectoring to state #9 and all the subsequent mess and confusion that caused.

Anyway, that's fixed and now "cancel move" also works. Pretty easy to use. When you select a piece to move, it starts flashing. To cancel your move you simply select the piece again. I went back to the quicker moves for pieces, as I watched an earlier video and it looked much nicer.

I still have an occasional glitch (shown at end of video) where there appears to be a time overflow somewhere that causes some screen judder. It's a bit bizarre, and I'm not sure what's going on. It appears to be with the flashing of the pieces that you can take, though I can see no rhyme nor reason at this point. Will keep my eyes on that one. Also, I still haven't tackled why my sprites don't display properly left edge of screen. I never really did get into sprite positioning. I guess I'll have to get off my butt.

This version is player vs. computer because that's more fun even though the computer is using my patented "dumbest AI ever"... that is, random choice from available moves. Here are the bugs that I'm aware of...

 

* aforementioned sprite position error for left column of squares

* cursor is a random shade of green when you are selecting destination square

* aforementioned screen judder sometimes when showing available moves

* castling doesn't move the rook

* en-passant borked (these are flag-related)

* you can make illegal moves if you're in check

* there is no pawn promotion for human - it needs a UI way of doing it. Computer works fine.


I need to tackle those first, and then I think that's the UI basically settled. I need to do sounds, of course - seems like a perfect game to use the AtariVox with, so I guess I'll put that on the plate, too.  Once all the above are fixed, I guess I should move on to actual computer AI and get it playing properly.
 



Was thinking the other day, as I said, about releasing on a cart or not. I briefly toyed with the concept of selling the first cart for 1 cent, the second for 2 cents, the third for 4c, etc. That would be fun.. especially when we're around the 10th cart which would be, what, 1024 cents. $10, pretty damn cheap. But then, $20, $40.... and then people would complain.

On a more serious note, I was also thinking about the concept of Atari programming as "art". What's wrong with someone writing a game (ooh, let's pluck something out of midair... say a Chess variant)... and just releasing a few cartridges. Just like an artist makes an artwork, and releases a few prints of their work. Do we see those artists being criticised for doing just that?  I definitely see the things I write as much more a creation and form of art, than I do as a moneymaking project, or even as a game. They're my babies, created with passion and unbelievable amounts of obsession.





 

chess_20200213.bin

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

1 hour ago, Andrew Davie said:

On a more serious note, I was also thinking about the concept of Atari programming as "art". What's wrong with someone writing a game (ooh, let's pluck something out of midair... say a Chess variant)... and just releasing a few cartridges. Just like an artist makes an artwork, and releases a few prints of their work. Do we see those artists being criticised for doing just that?

I would certainly hope that no one here would criticize you for choosing not to make cartridges if that's not what you want to do. For the artist analogy, though, if the artist displays their works in a public setting, they shouldn't be too surprised if people who are impressed by their work inquire If they have any prints for sale. ?

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