3D Chess 2K18

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

No rest....another -4 bytes this time shaved off the base part, and surprisingly, well in my opinion anyway, makes it look better.

Now at 547 bytes = 508

Image
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

I am interested to know if the source makes an sense to anyone perhaps more familiar with source code listings?

I generally comment mine extremely badly or not at all. I'm probably not alone in the fact that when you write something, it reads just fine to you without lengthy explanations. I do appreciate however, that the older I get, the more helpful the comments are when I revisit some past projects.

If any parts do need further explanation, then I will oblige of course.
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

.TAP file to load and mess with.

https://dl.dropbox.com/s/ud9urfxww0giq7 ... a.tap?dl=1

Small 'cheat' added in the basic loader to swap the White king and queen for now. Will be fixed very soon, promise! :D
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: 3D Chess 2K18

Post by Ast A. Moore »

arkannoyed wrote: Fri Feb 15, 2019 3:17 pm when you write something, it reads just fine to you without lengthy explanations. I do appreciate however, that the older I get, the more helpful the comments are when I revisit some past projects.
In my case, if I don’t comment everything like I’m explaining to a child, I tend to forget what I do in about a week if I’m lucky. Usually, though, I can’t recognize my own routines and optimizations about two days later, if I don’t comment them.
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
KayBee
Drutt
Posts: 17
Joined: Thu May 31, 2018 3:14 pm

Re: 3D Chess 2K18

Post by KayBee »

This is stunning arkannoyed. If I could have two wishes, they would be:
1. Tie Peter Jennings 1k MicroChess to this beautiful interface.
2. tie the infamous 1k ZX chess to this beautiful interface.

I wish I wish.

KB
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

Thanks.

Actually, all this is currently is a board display engine. It’ll display the results of any chess program provided the pieces have the correct codes and it’s based upon a 64 byte board. An interpreter interface could also be used to substitute piece codes though. I will be moving on to the actual game logic eventually. A few more ideas to save more space first though!
AndyC
Dynamite Dan
Posts: 1388
Joined: Mon Nov 13, 2017 5:12 am

Re: 3D Chess 2K18

Post by AndyC »

I'm sticking with my earlier assertion that this is witchcraft. Any sufficiently advanced technology is indistinguishable from magic after all.

The mind boggles at how you've done so much in so little. Genuine genius.
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

Fascinating read about Peter Jennings development of Microchess. The hand coding process is still alive in my case! I may well take a few pointers from the way it evaluates moves too.
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

One change I am considering is to move all the pieces up 1 line to show more of the square it sits on. This would help with the GUI I’m considering. Any thoughts?
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

AndyC wrote: Tue Feb 19, 2019 7:05 pm I'm sticking with my earlier assertion that this is witchcraft. Any sufficiently advanced technology is indistinguishable from magic after all.

The mind boggles at how you've done so much in so little. Genuine genius.
Well the source code is there, have a go at deciphering it. It is surprisingly straightforward. It’s far simpler than when it was 924 bytes.
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

KayBee wrote: Tue Feb 19, 2019 2:09 am This is stunning arkannoyed. If I could have two wishes, they would be:
1. Tie Peter Jennings 1k MicroChess to this beautiful interface.
2. tie the infamous 1k ZX chess to this beautiful interface.

I wish I wish.

KB
Peter Jennings talks about a program being a piece of art. I totally get that, that’s what I’m creating, it becomes more beautiful the smaller it gets. It’s approaching a very pure state now.
User avatar
Pegaz
Dynamite Dan
Posts: 1209
Joined: Mon Nov 13, 2017 1:44 pm

Re: 3D Chess 2K18

Post by Pegaz »

arkannoyed wrote: Tue Feb 19, 2019 7:46 pm Fascinating read about Peter Jennings development of Microchess. The hand coding process is still alive in my case! I may well take a few pointers from the way it evaluates moves too.
I completely agree.
Today I've been testing a great KIM-1 emulator on c64 and Jennings Microchess on it.
It's not easy to make moves with his notation, it has its own shortcomings, but it's still an impressive piece of code.
Lots of information about this old MOS Technology computer, Microchess and other KIM-1 software, here:
https://www.floodgap.com/retrobits/kim-1/
KayBee
Drutt
Posts: 17
Joined: Thu May 31, 2018 3:14 pm

Re: 3D Chess 2K18

Post by KayBee »

I love the purity of Microchess, but to me it's interface (notation) obfuscates the play. When I play it I have to mentally translate. It is much better with a VT-100 terminal.

As for moving the pieces up, I agree, at least 1 line. Really amazing.

KB
KayBee
Drutt
Posts: 17
Joined: Thu May 31, 2018 3:14 pm

Re: 3D Chess 2K18

Post by KayBee »

I mentioned ZX chess because I love the way it cycles through the possible moves, and with actual pieces it would be a fascinating visualization of the engine at work.

KB
User avatar
Pegaz
Dynamite Dan
Posts: 1209
Joined: Mon Nov 13, 2017 1:44 pm

Re: 3D Chess 2K18

Post by Pegaz »

KayBee wrote: Wed Feb 20, 2019 3:04 pm I love the purity of Microchess, but to me it's interface (notation) obfuscates the play. When I play it I have to mentally translate. It is much better with a VT-100 terminal.

As for moving the pieces up, I agree, at least 1 line. Really amazing.

KB
Yes, its very difficult to play that way, its literally necessary to have a code table and translate every move to its notation.
However, for a computer from 1976, this is a remarkable achievement.
I played Lander for KIM-1 yesterday, only 6 characters on display, but still pure fun. :)
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

Though I had to add 1 byte, which I can tell you caused untold personal turmoil, I then saved one elsewhere, so still at 547 bytes, and now prints everything 1 line higher to show more of the square beneath thus;

Image

Not a massive difference, but it'll make itself apparent more when the GUI is up and running. I'm looking at a few other areas of the code too so that additional functionality can be added in with less of an effort later.
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: 3D Chess 2K18

Post by dfzx »

arkannoyed wrote: Thu Feb 21, 2019 12:15 pm Not a massive difference...
Is that not identical to the image you posted on 15th Feb?
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: 3D Chess 2K18

Post by dfzx »

dfzx wrote: Thu Feb 21, 2019 3:02 pm
arkannoyed wrote: Thu Feb 21, 2019 12:15 pm Not a massive difference...
Is that not identical to the image you posted on 15th Feb?
Ah, you've reused the URL so the older image is in fact the new one as well. :)

Just looking at the line of black pawn bases, it looks like they alternate up and down a pixel. It looks slightly odd to my eye.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

dfzx wrote: Thu Feb 21, 2019 3:06 pm
dfzx wrote: Thu Feb 21, 2019 3:02 pm Is that not identical to the image you posted on 15th Feb?
Ah, you've reused the URL so the older image is in fact the new one as well. :)

Just looking at the line of black pawn bases, it looks like they alternate up and down a pixel. It looks slightly odd to my eye.
Indeed, my mistake, I did reuse the url and replaced just the file. Silly me!!

The anomaly regarding the bases looking like that is just being on a black or white square. Also they’re masked so perhaps that gives an odd look too. I can assure you they’re the same level relative to the square.

Took over an hour to figure a way to move them up 1 line and not use an extra byte!!
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

The code as it is now feels finally pretty much as optimised as it can be aside from any new ideas I manage to come up with to reduce it further. So at last I’ve begun looking at adding the functionality to select and move the pieces. At first this will be purely human input, but will allow for properly ironing out any potential difficulties with making an eventual computer evaluating system making moves for itself. Plenty to cram into 477 bytes! :P

I think it just about runs fast enough to allow for square and piece selection to be on-board rather than a keyboard input. Chances are the building will happen off screen and then it’ll be copied from a buffer. Otherwise animating certain things will look clumsy. Speed isn’t an essential ingredient and I think I can add in some easy to use functions without them being memory hungry. Need to leave a few hundred bytes to have some chess logic in there for a suitable playing experience I guess!
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

Experimental Piece test no.1

Image

A little slower than I'd hoped, but this is using very small copy and clear routines which could be unrolled a bit to speed up.
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

Obviously you'll only get to choose from either Black or White pieces as available selection to move on a given turn, which will only give a maximum number of 16 pieces to cycle through. I have that working now and with a simple switch to select which colour. I also think to keep it as simple as possible, I'll just use maybe Space to scroll through and Enter to select the piece. Then it will keep the selected piece held up while the user selects the square to move to, again Space to move and Enter to select. Then a simple write 00 to the piece square and copy the piece to its newly selected position. Later there will be validation involved which will only allow you to select the squares that are possible to move to.

It does get a lot faster when there are fewer pieces on the board fortunately! :D
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

I did have board rotation working quite a while ago, which will also hopefully be incorporated. I think that was about 30 bytes-ish. That will help with square selection when there are more pieces crowding certain areas. There will also be an undo function as thats fairly easy to add too with a simple move stack system.
KayBee
Drutt
Posts: 17
Joined: Thu May 31, 2018 3:14 pm

Re: 3D Chess 2K18

Post by KayBee »

In an actual game, I would like to quickly choose the piece to move, may I suggest inverting the color of each piece as you go through your options? Once the piece is chosen, it rises, then I choose the destination square?
User avatar
arkannoyed
Manic Miner
Posts: 435
Joined: Mon Feb 05, 2018 9:56 am
Location: Northamptonshire

Re: 3D Chess 2K18

Post by arkannoyed »

I find that to be confusing, or is that just me? Inverting the colour surely makes it match the opposition? That’s actually not any quicker than raising the piece anyway. Still have to reconstruct the board for every change.

Once this gets a little further along I’ll release a demo to try then a decision can be made as to whether it’s ok to run with.
Post Reply