3D Chess 2K18

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
Mike Davies
Microbot
Posts: 106
Joined: Mon Nov 13, 2017 10:11 am

Re: 3D Chess 2K18

Post by Mike Davies » Wed Jun 27, 2018 3:11 pm

arkannoyed wrote:
Thu Jun 21, 2018 3:37 pm
Something like this;

Image
Oh nice, Reti - Alekhine, Baden Baden, 1925, after ...Rxe3!
1 x

User avatar
arkannoyed
Dizzy
Posts: 88
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Thu Jun 28, 2018 1:15 pm

Indeed it is, very well spotted sir! It shows that the graphics are clear enough to see whats going on when the board is well populated.

I don't know whether its the heat this week, but other that squeezing the data down to 289 bytes, everything else I try and improve or fix just fails miserably. I can usually visualise the mechanics of a system pretty well, and with some fiddling, get a routine that does what it needs to. However, I'm trying to improve things on 3 fronts all at once, which is perhaps a mistake.

1. The standard line Model builder is 38 bytes but I've a version that so nearly works at about 28 bytes.
2. The Get Data routine builds each line bytewise from the graphics data as opposed to BIT-wise previously, however, the addressing just isn't doing what it should in all instances....Frustrating!!!
3. I've very nearly figured out an auto-masking system that will get rid of the need to place each bit from a line separately on screen. Obviously that would give a quite spiffing speed improvement, and early indications are that it would be smaller too.

If everything comes together as intended, it would almost qualify as a version 3 as its so dramatically different. Size could be anywhere from 620-650 bytes.
0 x

Joefish
Manic Miner
Posts: 252
Joined: Tue Nov 14, 2017 10:26 am

Re: 3D Chess 2K18

Post by Joefish » Thu Jun 28, 2018 1:54 pm

The graphics look really good, but I'm no chess nut, and I struggle to make out what's going on in that crowd shot.
What I'd suggest for clarity is a simple 8x8 aerial view in the top-left corner of the screen. This would also solve the user-interface problem as moves could be entered on the smaller character-based grid. I don't think it would detract from the aesthetic, and anyone playing the game seriously would probably prefer to see an overview as well.
1 x

User avatar
Mike Davies
Microbot
Posts: 106
Joined: Mon Nov 13, 2017 10:11 am

Re: 3D Chess 2K18

Post by Mike Davies » Thu Jun 28, 2018 2:21 pm

Also, I think the Kings and Queens are swapped in the above image. The king for either colour is the piece with a + at the top. The pieces on c4 and c7 look like the kings, but they are supposed to be the queens (which are sitting on g1 and g8, where the kings should be).
0 x

User avatar
arkannoyed
Dizzy
Posts: 88
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Fri Jun 29, 2018 2:59 pm

You are correct Mike, I'll alter that in the next update hopefully!

In the meantime, progress!!

It is mostly working. Just a small hitch to sort out with addressing, which just involves swapping a few things in the data. The data for the graphics is having to be re-compiled by hand to take account of a change made to allow even better compression, and making it simpler for the interpreter to read. This isn't a particularly quick process, but the Graphics data has now dropped to 279 bytes. Considering Version 1s graphics data was 382 bytes, its quite a remarkable slimming down!

I do have the irritatingly complex data reading routine down to a more sensible size at 55 bytes, though it still has a considerable scope to be smaller I think by over 15 bytes.

So currently, Version 2 is coming in at around 648 bytes!

As soon as its all operating nicely, I'll post pics 8-)
0 x

User avatar
arkannoyed
Dizzy
Posts: 88
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Sat Jun 30, 2018 10:25 pm

With a little inspiration, I’ve come up with an additional layer of compression that finally drops the data to probably just under 256 bytes. This then allows easier faster addressing as you might imagine. The pieces are currently build up line by line. The new method maps which lines belong to which pieces. This allows me to remove several repeated lines and though the map data is a new addition separate to the graphics data, it supersedes the current piece data table, also hopefully allowing easier decoding too. I’m not sure yet, but there may now be a real possibility of breaking the 600 byte barrier with a little more effort. Once upon a time I was amazed to have broken through below 1kb!!
0 x

User avatar
arkannoyed
Dizzy
Posts: 88
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Thu Jul 05, 2018 2:39 pm

A quite extreme amount of changes to the code structure and decoding have been experimented with for a couple of weeks, and I think I'm just about there. Still a minor decoding fault, but it runs and bloody fast too. By no means all of the intended changes and ideas have been implemented yet, so it is currently bigger than I hope it will eventually be.

The entire graphics data is now at 251 bytes (version 1 was 382!).

So as it stands, very nearly fully operational, its 612 bytes!

There are a few quick and dirty workarounds just to get a few things going as intended, which will improve with age no doubt. It is now perilously close to breaking the -600 bytes barrier, which even I'm astounded by.

As soon as its fully fixed, I'll post a video, then hopefully some source too.
3 x

User avatar
arkannoyed
Dizzy
Posts: 88
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Mon Jul 09, 2018 9:16 am

Finally! After identifying a few silly mistakes and oddities in the code, the bugs have been squished to the point where it runs all ok;

Image

Looking fairly quick, though it will improve. The delays have been trying to figure out the correct decoding of the graphics data. I tend to encode the graphics, then code something to decode that format, and as I go along, often find optimisations, or better methods of encoding that make the decoder faster or smaller. The graphics data is 256 bytes now, making addressing possible with low byte INCs only, saving a few T-states along the way.

Several parts are due for improvement now that the mechanics of the system have been figured out, so expect quite a few bytes to be shed soon, which is why I'll not post any source yet. Inefficient source is just not pretty!

Current size 620 bytes!
3 x

User avatar
arkannoyed
Dizzy
Posts: 88
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Mon Jul 09, 2018 11:56 am

Already now down to 618 bytes!

EDIT: now 615 bytes. ;)
2 x

User avatar
arkannoyed
Dizzy
Posts: 88
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Tue Jul 10, 2018 10:39 am

I'm sure everyones long since lost interest in this now :shock:

However, its making steady downward progress towards sub 600 bytes.

Now at 609 bytes
1 x

Post Reply