1K Real Chess for ZX80

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: 1K Real Chess for ZX80

Post by Moggy »

A quick update Stefano.


Played two games with the 35 version the first game I won easily in less than 20 moves, the second game was much better and the logic seems to anticipate its opponents moves very well.
The time taken with moves is about the same as the ZX81 "STRONG" version and again is very good.

Two points I would raise.

1) Blacks opening move needs to follow some kind of book opening or a proper answer to my opening move.
Its opening move every time is kings rook pawn one space no matter what move I make and I feel this needs looking at.

2) I tried en passant but it would not allow the move and I am not sure if this is a bug or more my lack of understanding of the conditions that allow en passant, I may be applying the move incorrectly.


This is excellent work Stefano and I will try some games with version 4a tonight.


Regards.

Moggy.
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: 1K Real Chess for ZX80

Post by Moggy »

Some more games played tonight and after some study I have to say 4ply is definitely the stronger of the two games.

35 is seems to want to go all out to capture pieces at the risk of losing its own pieces whereas 4ply plays a more thoughtful game and seems to be thinking much further ahead and so is much harder to beat.

For example in one game with 35 with both players down to pawns and king only it was happy for me to get a pawn all the way down the board to exchange for the queen just so it could capture another pawn. I suspect 4ply would not allow that.

In conclusion both games are well coded with 4 ply the better of the two and play fine on real ZX80 with ZXpand and also plays just as well on a plain ZX80 loaded from tape.

The flashing cursor is excellent and cursor movement easy to read and I like the two-press key system to make the opponent move and also suggest a move for your pieces and now all it lacks is better logic for opponents opening move.

This is splendid work Stefano for which I thank you very much and hope you are proud of your achievement as this conversion cannot have been easy. :ugeek:


Regards.

Moggy.
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: 1K Real Chess for ZX80

Post by marste »

I tested the en-passant and it is working. The way is the usual one: you take the piece you want to move and put it in the destination square! If it happen to discover a strange situation (this or another) please report it and I'll investigate!

Good to know that alfa-beta version is stronger! Anyway regarding the promotion misjudgment it is probably depending on the fact that the evaluation of the gain/loss is done one ply later, and so easily a move can sits behind the "horizon" of the engine (a human cannot understand well a complex situation but easily spot a strait sequence of pawn moves that for the engine anyway are too much in the future)... This and some other evaluation deficiencies are depending on the size limitation: and I should note that this is an "extreme" program, and until now on 1K ZX81 was already considered "too much" to have the complete chess ruleset and two ply (in fact a very limited version was considered already a big achievement), while this engine have in addition underpromotion, castling, en-passant, multiple ply, alfabeta pruning, an "easy" point&move interface and even less bytes with this "manual run" flicker free version on ZX80! ;)

Anyway I didn't really understand if the program was at least beating you sometime, as it is happening with me! :mrgreen:

Even if it's unbalanced, I want to test it against the 16K chess programs (on similar time controls)!... If not winning at least make a decent resistance! :o

PS: there were other chess programs on ZX80 or just on ZX81?
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: 1K Real Chess for ZX80

Post by Moggy »

Hi Stefano.

Can en passant only done from the first rank as in FIDE rules or anywhere on the board at anytime? I only ask as I'm sure some of the 16k ZX81 programs allowed the move at anytime and anywhere on the board

I seem to remember one chess program for the ZX80 but it never sold very well maybe because of the ZX81 coming onto the scene. It was bigger than 1k and I cannot remember its name but will try and seek it out and get back to you.

You mention playing the ZX80 against the 16k ZX81 games. I sometimes set 2 ZX81's up against each other or against the spectrum so I will play the ZX80 against one of my ZX81's using different chess programs and see the result.

I am not the strongest player and most of the games against the ZX80 are usually stalemate when I sometimes make some clumsy errors! The 35 version is the one I can sometimes beat.

As I said before the interface is nice and easy to use and with a better opening move for black I would say this is a great achievement in 1k and I never get bored playing it.
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: 1K Real Chess for ZX80

Post by Andy Rea »

en passant ( in passing) is a quirky rule and to understand it fully you have to be aware that many many moons ago the pawn could only advance 1 square at a time EVEN on it's first move, later when the rule to allow 1 or 2 square advance for a pawns first move, the en-passant ( in passing ) was introduced so that the pawn that previously would have only been able to advance 1 square (into the 6th rank, black pawn moving) and could be captured by a white pawn waiting in the 5th rank, now if that same black pawn moves to the 5th rank instead without the en-passant rule he would avoid capture, however with en-passant if white wished to still capture the black pawn he may do so en-passant BUT it must be on the following move, failure to do so means than en-passant is not valid in any subsequent moves against that black pawn. En-passant is only from whites perspective moving from 5th rank to 6th rank diagonally behind the captured black pawn, and from blacks perspective moving from the 4th rank to the 3rd rank diaginally behind the captured white pawn.

edit: it is also not a valid en-passant if the black pawn moves 1 square, and then white does not capture, then black pawn moves again 1 sqaure so alongside whites pawn, white CANNOT do en-passant, the pawn to be captured has to have made a 2 square advance.

anyway i'm sure you have googled it by now...

Regards Andy

p.s anyone up for a game of chess ? i'm on Lichess
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: 1K Real Chess for ZX80

Post by marste »

The en-passant should be properly managed: as said just double-step on first move of every pawn allows it. Easy to test various combination with this "flexible" version moving appropiately both sides. Also manual moves are checked for legality, with the only exception for castling in which there is a simplified check (e.g. the rook or king might have moved before). In case of strange moves or error please report and I'll investigate (I think that some condition might still make the engine make very weak moves and so losing).
Moggy wrote: Mon Mar 26, 2018 10:46 pm I seem to remember one chess program for the ZX80 but it never sold very well maybe because of the ZX81 coming onto the scene. It was bigger than 1k and I cannot remember its name but will try and seek it out and get back to you.
Interesting, let me know, I'm curious to see it!
Moggy wrote: Mon Mar 26, 2018 10:46 pm You mention playing the ZX80 against the 16k ZX81 games. I sometimes set 2 ZX81's up against each other or against the spectrum so I will play the ZX80 against one of my ZX81's using different chess programs and see the result.
Doing this can you please post the moves and time taken on both side for each move? (it might help to improve! ;))
Moggy wrote: Mon Mar 26, 2018 10:46 pm I am not the strongest player and most of the games against the ZX80 are usually stalemate when I sometimes make some clumsy errors! The 35 version is the one I can sometimes beat.
As I said before the interface is nice and easy to use and with a better opening move for black I would say this is a great achievement in 1k and I never get bored playing it.
So seems that 4a is still unbeaten! :D Despite all limitations in my opinion the engine should be above 1200 ELO. Personally I think around 1400. The playing strenght will improve a bit when I'll implement the initial moving logic, but I should optimize size again on ZX80 to fit it with in the flicker free version!
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: 1K Real Chess for ZX80

Post by Moggy »

Hi Stefano.

Concerning other ZX80 chess I cannot remember the program name only the author who is called Philip Joy and used to write for Sinclair user magazine.

https://issuu.com/jasonwhite99/docs/sin ... 1_apr_1982

Page 65

When I post the games I will use the notation ZX81 chess uses, moves such as D7-D5 or E2-E4 for example for simplicity.

LATE EDIT.
Also is it possible to make a version with white at the bottom of the screen instead of the top as all the ZX81 games work this way and it is easier to follow on a real chess board?
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: 1K Real Chess for ZX80

Post by Moggy »

Not a very good start I'm afraid as the following shows.

ZX80 chess verses ZX81 chess 2
ZX80 plays white ZX81 plays black



ZX80........................................ZX81

G1-H3......................................B8-C6

H1-G1......................................G8-F6

G1-H1......................................D7-D5

H1-G1...12SEC............................C8-F5

G1-H1...20 SEC............................E7-E5

H1-G1...27 SEC............................F8-C5

G1-H1...40 SEC.............................0-0

H1-G1...40 SEC............................D8-D6

G1-H1...40 SEC............................C6-D4


At this point a figure 4 appeared 2 squares below white knights position then white refused to move at which point I felt it unnecessary to carry on given that whites moves did not make any sense. If I were to make whites opening move instead of allowing the ZX80 to do it I'm sure the game logic would come in at that point and move accordingly in answer to black but it seems leaving it to make the first move results in the rook just moving from H1-G1 and back again.

As posted earlier it would be easier to follow when playing the 81 if white could start at the bottom.


EDIT.

This game was played on a 1k ZX80 tape loaded game without the ZXpand it may be possible the ZXpand ROM I have fitted expects the ZXpand to be present or the tape may have been corrupted in some way as I have just started another game with the ZXpand fitted and the ZX80 is responding more as it should so will log and post the result of the game later.
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: 1K Real Chess for ZX80

Post by marste »

Yes, I think that the problem was about the strange ROM, since I never saw such behaviour.

Regarding the board orientation is not an easy thing since various logic about pawn and castling etc, but I'll put in the todo list. What anyway I can do now is providing a version in which the black is starting first, so effectively acting as white at the bottom. The mismatch between the two boards is in this case is the piece color, but this might be easier to match: your call. Attached the new version.

An interesting note: even without the initial move logic, since the way the move logic works, the white at the bottom will play a completely different game than the white at the top, and in particular for example the piece at the bottom will not move the tower too much but advance pawns! ;)

Good for timing, but can I ask you the favor to keep track also of the opponent (in this case ZX81 Chess 2) move time? (so to better evaluate engine strenght)

Thank you and happy chess! :)
Attachments
1kRealChessZX80ff-4a-DEBUG-BLACKSTART.o
(945 Bytes) Downloaded 190 times
Last edited by marste on Wed Mar 28, 2018 8:30 am, edited 2 times in total.
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: 1K Real Chess for ZX80

Post by marste »

PS: if the opponent engine make use of a movebook, in order to level the playing field you can manually setup the starting position to the end of some known opening, and let play both engines once as black and onche as white!
here some examples:
http://www.mark-weeks.com/aboutcom/aa05l17.htm
https://thumbs.dreamstime.com/z/collect ... 511052.jpg
collection-chess-openings-14511052.jpg
Post Reply