Page 13 of 14

Re: 3D Chess 2K18

Posted: Fri May 10, 2019 7:44 pm
by ZXDunny
Actually, that doesn't look half bad.

Re: 3D Chess 2K18

Posted: Fri May 10, 2019 8:29 pm
by arkannoyed
I know right?! Maybe he’s onto something! Option maybe?
Shouldn’t be too hard to implement, as it’s only masking and can be swapped by changing 1 byte.

Re: 3D Chess 2K18

Posted: Mon May 13, 2019 3:54 pm
by arkannoyed
As far as general use is concerned, is it safe to use the R register? i.e. if I'm utilising it to store BIT 7, which in R remains unchanged as far as I can see, would that interfere with anything like attached peripherals that I'm not aware of?

Re: 3D Chess 2K18

Posted: Mon May 13, 2019 3:59 pm
by Metalbrain
AFAIK bit 7 of register R is perfectly safe to be used. Jonathan Smith (aka Joffa) did use it as a flag in several of his games.

Re: 3D Chess 2K18

Posted: Mon May 13, 2019 4:04 pm
by Ast A. Moore
arkannoyed wrote: Mon May 13, 2019 3:54 pm As far as general use is concerned, is it safe to use the R register? i.e. if I'm utilising it to store BIT 7, which in R remains unchanged as far as I can see, would that interfere with anything like attached peripherals that I'm not aware of?
Perfectly safe. Go ahead.

Re: 3D Chess 2K18

Posted: Mon May 13, 2019 4:09 pm
by arkannoyed
Good, shame its a 2 byte instruction though! :x

I've utilised it to hold the status of the current square being printed to set the mask that shades it or leaves Black etc. The whole process has added 21 bytes to the routine, however it works nicely and with no messy writes to memory addresses as was the case in the earlier attempts.

Now to make a final decision as to whether the piece selected to move will raise up or have a great big arrow pointing at it. Not really much in it in terms of size to graft into the routine, probably slightly less for making the piece float in the air.

Re: 3D Chess 2K18

Posted: Mon May 13, 2019 5:01 pm
by arkannoyed
Amazing how quickly all this extra stuff eats into the spare bytes. Whereas there was 520 available, thats already dropped to 434 now that all of the visual extras are in. That might improve a little once I've tweeked a few things though.

Re: 3D Chess 2K18

Posted: Mon May 13, 2019 10:28 pm
by djnzx48
arkannoyed wrote: Mon May 13, 2019 3:54 pm As far as general use is concerned, is it safe to use the R register? i.e. if I'm utilising it to store BIT 7, which in R remains unchanged as far as I can see, would that interfere with anything like attached peripherals that I'm not aware of?
There's nothing wrong with using the full register either (if you don't write to it too much). If there are no interrupt routines running and you've run out of registers, it's sometimes possible to use R as an automatically incrementing loop counter.

Re: 3D Chess 2K18

Posted: Tue May 14, 2019 9:59 am
by arkannoyed
I have experimented in the past using it as a counter, but I've no need to use it for anything cleaver in this production at the moment.

I could perhaps use the EXX set for something, but to save them all (or whichever I need to use) would be a bigger overhead.

Re: 3D Chess 2K18

Posted: Wed May 15, 2019 10:00 am
by arkannoyed
Isn't it great when you change something that you think will have the desired effect, but then it turns out to achieve something quite different and unexpected. I added 3 bytes to try and alternate the squares select bit so that they showed grey, however this happened, which looks amazingly effective!

Image

Re: 3D Chess 2K18

Posted: Wed May 15, 2019 10:11 am
by djnzx48
That's pretty cool. How does it look with the ULA colour ramping thing enabled?

Re: 3D Chess 2K18

Posted: Wed May 15, 2019 10:18 am
by arkannoyed
Do you mean the one from our friend d2010?

He'd probably get quite excited by all that shading going on! :lol:

I'm not sure its entirely practical as a workable option, but certainly a surprise as I still can't entirely figure out why its doing it :oops:

Oh, and by the way, the White pawn at the Left most end of the line is raised as its the selected piece. I have changed from 8 lines in that example to 16 lines as it gives a much clearer indication of whats selected.

Re: 3D Chess 2K18

Posted: Wed May 15, 2019 10:44 am
by Ast A. Moore
arkannoyed wrote: Wed May 15, 2019 10:00 am which looks amazingly effective!
Hmm. I’m not sure about this. It’s too fuzzy and distracting. :? I’d stick with the good-old black and white.

Re: 3D Chess 2K18

Posted: Wed May 15, 2019 10:55 am
by arkannoyed
Oh I will be sticking with the traditional simple look, but if space allows, there may be options available if they're simple enough to add into it. The more functionality available, the more impressive it'll look hopefully.

Re: 3D Chess 2K18

Posted: Wed May 15, 2019 10:58 am
by djnzx48
arkannoyed wrote: Wed May 15, 2019 10:18 am Do you mean the one from our friend d2010?
Well no, I was referring to this: https://www.worldofspectrum.org/forums/ ... ce-demo/p1

Transitions between colours (especially black and white) look different on a real machine than on some emulators due to stuff going on in the ULA. I was just wondering whether this example would be particularly affected due to the stippling. Did you figure out what was causing it?

Some kind of textured board would be interesting, if there were enough spare bytes left over. Maybe some shading at the corners of the squares near one end of the board. And a border like in your original design would be very nice.

Re: 3D Chess 2K18

Posted: Wed May 15, 2019 11:12 am
by arkannoyed
Aaah, I see what you meant now. I've no real hardware readily available to test it on and no CRT TV anymore, but looks great on an Emulator!

If there was sufficient memory available, then any number of options for squares shading might be possible, but anything I might be able to add would have to be a simple addition to the masking code. I've a better idea now of what caused it, but its still a nice effect for the addition of just 3 bytes! :lol:

The shaded squares are controlled by a bit being set (currently BIT 7) of the board square. The contents of that square are stored in the R register, as that can hold BIT 7 continuously without being corrupted. if the square is solid black, then BIT 7 of R must be '0' and the subsequent test of the current square number must give a result that its a Black square (BITs 0 and 3 control this). If its a shaded square then the mask is set to 55h but inverted to AAh according to the flip-flop of BIT 0 of the line counter. Sounds complicated perhaps, but actually its fairly low level.

the strange shading happened when I attempted inverting BIT 7 of R, which was intended to make the square turn on/off, sort of flashing. However, the process needed to be done after each completion of the routine to make it work, whereas in a moment of early morning stupidity I plonked an inversion after each line pass.....I'll get my coat! :lol:

Re: 3D Chess 2K18

Posted: Wed May 15, 2019 12:05 pm
by Pegaz
arkannoyed wrote: Wed May 15, 2019 11:12 am Aaah, I see what you meant now. I've no real hardware readily available to test it on and no CRT TV anymore, but looks great on an Emulator!
Yes, you can test this ULA behavior with SpecEmu, which fully supports it, as well as some version of Spin.
In SpecEmu, you must enable Ula Artefact in the Display Option menu and you can see this four shades effects.
This old topic is very interesting to read.
As you can see, some didnt even believe that it was really possible on Spectrum, but Woody did a great job and managed to implement that ULA quirk into SpecEmu in just a few days. :)

Re: 3D Chess 2K18

Posted: Wed May 15, 2019 4:45 pm
by arkannoyed
I'm trying to decide upon the best balance between total direct access, i.e. with some sort of mouse type pointer, or cycling through the pieces as I've demonstrated before. Both seem to eat up memory, but they have to be in there to make it work. Heres a quick example of in progress, which uses Space to choose the piece, with Enter to select. Then followed by the same keys to choose the square to move to, which when the legal move checking is in there will likely show the available squares to move to and let you cycle through them with Space, then select with Enter. Not lightening quick by any means, but there are key areas in the routine that if space allows can be speeded up a fair bit.

Image

Re: 3D Chess 2K18

Posted: Sat Sep 28, 2019 3:57 pm
by KayBee
Image

On my chess device, I use 2 arrow keys to select the piece, which is more flexible than a single key for cycling. So, I suggest the 5 and 8 keys. I also have a pleasant -click- sound via small speaker.

Re: 3D Chess 2K18

Posted: Sat Sep 28, 2019 8:02 pm
by arkannoyed
Mmmmmmmm maybe, and a click might enhance things.

Re: 3D Chess 2K18

Posted: Sun Sep 29, 2019 1:09 am
by KayBee
In my opinion, you have some up with something special here, it is impressive immediately, regardless of size. If I could wish for one feature it would be to have a mode whereby you get to see the moves it is considering and rejecting. 1k chess for the ZX-81 does this. It is a fascinating thing to watch.

Re: 3D Chess 2K18

Posted: Sun Sep 29, 2019 10:15 am
by arkannoyed
Possibly a feature that could be optional. That’s actually not very difficult to implement, but could be a long process when a lot of moves are possible. Move generation is completely separate to the display and piece building part.

Re: 3D Chess 2K18

Posted: Tue Jan 07, 2020 12:28 pm
by arkannoyed
Afternoon all!

Been a while, but whilst I’ve a few days off I thought I’d try out a couple of ideas. However, as I was refreshing everything in my brain, I managed to save another byte on the display engine. Bit boring maybe, but it is now 503 bytes.

Re: 3D Chess 2K18

Posted: Tue Jan 07, 2020 4:25 pm
by arkannoyed
A coming together and shifting about of two other key routines (might) give the possibility of saving one or perhaps two more bytes too. More time tomorrow, so I’ll get my abstract thinking cap on. Sometimes it’s a case of looking at how things work from a different point of view, so as to figure out the clever methods. That’s why humans will always triumph over machines...even a Speccy!!! :D

Re: 3D Chess 2K18

Posted: Tue Jan 07, 2020 10:52 pm
by hitm4n
I think theres still some mystical wizardry going on here...