Page 13 of 14

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

Re: 3D Chess 2K18

Posted: Fri Jan 10, 2020 7:39 pm
by Pegaz
Totally agree.
If this great piece of code gets its equally compact chess engine, it will be one of the biggest events in the Spectrum homebrew scene in the last couple of decades.

Re: 3D Chess 2K18

Posted: Sat Jan 11, 2020 8:52 am
by arkannoyed
Very kind of you to say so :) I’ve been in awe of Alex’s ChessKelet development for a while now. In fact, what he’s achieved way outshines my efforts, but remains a massive inspiration and guiding light for my future developments. The reason I keep on with the squashing of C2k18 is that as I find ways to implement the logic for the playing part, I sometimes have to alter the display code. That sometimes gives rise to new ideas and ways of achieving the same end, thus saving the odd byte here and there. I’m sure the core display engine will creep down towards -500 bytes eventually. Only 3 bytes to go!!!! The more saved there leaves more for the game and gui which has to all cram into -1k.

Re: 3D Chess 2K18

Posted: Sat Jan 11, 2020 10:13 am
by uglifruit
I'm amazed by what you've achieved here. When the whole finished thing eventually clocks in at less than 1k, you should hold off on releasing it until you've made another 40 odd similarly amazingly small games that can all be loaded at once, with a front end to choose them. By my calculation it might be ready by the year 2100. ;)

Re: 3D Chess 2K18

Posted: Sat Jan 11, 2020 10:44 am
by arkannoyed
2100 is pushing it a bit. Chess has taken since about 1993 to get to where it currently is :D
I did adapt the routines that draw the chess board (well, the addressing part anyway) to be used as an isometric room builder, with a compressed block printing routine. That would allow for an isometric game in less than 1k.

Re: 3D Chess 2K18

Posted: Tue Jan 14, 2020 11:20 am
by arkannoyed
Quick question that someone might be able to answer for me, as I’m not in the vicinity of a speccy or emulator to test. When calling a routine from basic (rand usr etc) does using the alternative registers set (exx) cause issues upon the RET? Would the always need to be pushed prior to messing with and obviously have interrupts disabled?

Re: 3D Chess 2K18

Posted: Tue Jan 14, 2020 11:46 am
by uglifruit
The epic program I've just compiled:

DI
EXX
EI
RET

causes a hang on return to basic.

If that helps at all.

Edit:
DI
EXX
Ld hl, bc, de, a with some arbitrary numbers
EXX
EI
RET

Gave me a "c nonsense in basic" but did return

Re: 3D Chess 2K18

Posted: Tue Jan 14, 2020 12:02 pm
by Ast A. Moore
Yes. You need to save HL’ and restore it before returning to BASIC.

Re: 3D Chess 2K18

Posted: Tue Jan 14, 2020 1:22 pm
by arkannoyed
Just HL’ ?

Re: 3D Chess 2K18

Posted: Tue Jan 14, 2020 2:02 pm
by Ast A. Moore
Well, IY, too, obviously, since it holds the base address for all the system variables. But as far as prime registers are concerned, yes, just HL’.

Re: 3D Chess 2K18

Posted: Tue Jan 14, 2020 7:52 pm
by arkannoyed
No need to worry about iy. But being able to use one of the alternative register pairs for addressing instead of Ix may give the possibility of saving a few bytes.