3D Chess 2K18
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Some movement, in realtime;
I like the way it speeds up when there are fewer pieces on the board, like Space Invaders!
This isn't speed optimised in terms of the copy routines. Interestingly, because the original builds straight to the screen, and contention plays its part, building to a buffer, then copying to the screen hardly adds any extra time at all!
This is using a combined copy and clear routine thats fairly efficient. It copies a byte of the buffer to the screen and then writes a '00' to the buffer for when the board is build next.
Using the optimised block copy/clear routines is bigger and more complex, and actually not much faster. If space allows, this method could be unrolled to increase the speed a little more. Currently only uses 38 bytes.
I like the way it speeds up when there are fewer pieces on the board, like Space Invaders!
This isn't speed optimised in terms of the copy routines. Interestingly, because the original builds straight to the screen, and contention plays its part, building to a buffer, then copying to the screen hardly adds any extra time at all!
This is using a combined copy and clear routine thats fairly efficient. It copies a byte of the buffer to the screen and then writes a '00' to the buffer for when the board is build next.
Using the optimised block copy/clear routines is bigger and more complex, and actually not much faster. If space allows, this method could be unrolled to increase the speed a little more. Currently only uses 38 bytes.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
In case anyones interested, below is the flexible Copy/ Clear routine. By just altering the number of LDD/ LD (BC),A instructions to fill a sensible amount of free space, the routine has the ability to speed up if there are free bytes still available. Nothing complicated. BC trails one byte behind whats being copied from the buffer to the screen, so it can be cleared afterwards.
Could be anywhere from 18 bytes up to a whopping 18447, which there would still be room for if I allowed buffering besides the screen too. I have some code that builds it to whatever length you choose, and thats only 27 bytes.
Code: Select all
copy_clear:
xor a
ld de,57ffh
ld hl,0d7ffh
ld bc,0d800h
cc_lp:
ldd
ld (bc),a
ldd
ld (bc),a
ldd
ld (bc),a
ldd
ld (bc),a
bit 6,h
jr nz,cc_lp
ret
Last edited by arkannoyed on Wed May 08, 2019 10:15 am, edited 1 time in total.
Re: 3D Chess 2K18
Oh nice, that's pretty clever. Great way to make use of the normally useless BC register during LDI/LDD copies.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
I know, the BC register just gets wasted in most cases. Nice to make it work for a change. I actually tried the routine fully unrolled to 18k and its quite fast!
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Well I guess I must've been inspired by Liverpools epic comeback last night. I have just saved a further...
7 bytes
Making my little beauty just 505 bytes!
Thats a 1.37% saving
Actually I spotted a stupid repetition and a way of sharing a byte in the graphics data. I can't recall saving a full 7 bytes in one go for a very long time
No graphics changes in appearance whatsoever. I guess that now brings it perilously close to another milestone of 500 bytes, though it might as well be 100 bytes away, as I don't know where I can save any more. I do find myself uttering those very words far too often though, and proving myself wrong again and again!
Graphics data is now just 210 bytes!
7 bytes
Making my little beauty just 505 bytes!
Thats a 1.37% saving
Actually I spotted a stupid repetition and a way of sharing a byte in the graphics data. I can't recall saving a full 7 bytes in one go for a very long time
No graphics changes in appearance whatsoever. I guess that now brings it perilously close to another milestone of 500 bytes, though it might as well be 100 bytes away, as I don't know where I can save any more. I do find myself uttering those very words far too often though, and proving myself wrong again and again!
Graphics data is now just 210 bytes!
Last edited by arkannoyed on Wed May 08, 2019 11:57 am, edited 1 time in total.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Oh hang on, no, my mistake, can't count what with all the excitement!
504 bytes!
504 bytes!
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Bit cheaty, but by swapping the order of some of the graphics data I can use the first byte of it as the jump vector at the end of the main routine, thus saving another byte.
503 bytes
503 bytes
Re: 3D Chess 2K18
I need replace the board 2colors from black-white to texture-white.
If i enter poke 53484,255[enter] the board will be colored into white+black.
If i enter poke 53484,170[enter] the board will be colored into white+gray(bin1010101).
Can you give me, address of poke and value?(at means cheats code)
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
I don't exactly understand, however, are you asking if it is possible to have White/ Grey board instead of White/ Black? If so, yes, it could be re-written to do that, as that is part of the functionality of the Graphical User Interface. That will not be as simple as just poking one address to a different value unfortunately. The square plotting routine has to be re-written.
Is it because you want to make some weird video of it?
Is it because you want to make some weird video of it?
Re: 3D Chess 2K18
Yes, i cannot ~different between board_black_color and black_pieces(turn, queen,king).
Last edited by d2010 on Thu May 09, 2019 3:12 pm, edited 2 times in total.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
When I've integrated the GUI, you should be able to just set BIT 7 of all the board squares and when you build it, they will all be grey, ok?
Re: 3D Chess 2K18
Yes,yes **arkannoyed wrote: ↑Thu May 09, 2019 2:51 pm When I've integrated the GUI, you should be able to just set BIT 7 of all the board squares and when you build it, they will all be grey, ok?
I do not need exactly grey-color, I need any texture (BIN 101001010), or (BIn 1100110011) of board-color-black.
The texture is mix 11--00-pixels inside the byte...i replay to you at PM.
First Step you. make easiest tasks , send to private message...
Second Task,only if you can make texture-board-game.
then you inject hard-task.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
......anyone?d2010 wrote: ↑Thu May 09, 2019 3:20 pmYes,yes **arkannoyed wrote: ↑Thu May 09, 2019 2:51 pm When I've integrated the GUI, you should be able to just set BIT 7 of all the board squares and when you build it, they will all be grey, ok?
I do not need exactly grey-color, I need any texture (BIN 101001010), or (BIn 1100110011) of board-color-black.
The texture is mix 11--00-pixels inside the byte...i replay to you at PM.
First Step you. make easiest tasks , send to private message...
Second Task,only if you can make texture-board-game.
then you inject hard-task.
Re: 3D Chess 2K18
Maybe I'm wrong, but I think he wants any kind of checkered pattern, instead of solid black fields on board.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
I just about got that much, but all this talk of Cheats and pokes! This is a highly tuned piece of procedural graphics work, that doesn't poke well!
Shaded squares will be available further down the line. More testing and experiments are being conducted at the moment, along with saving more bytes from the core.
Shaded squares will be available further down the line. More testing and experiments are being conducted at the moment, along with saving more bytes from the core.
Re: 3D Chess 2K18
Yes, that's the case for Chesskelet: DEFB board setup. With my routine, I was trying to give some ideas, but Arkannoyed has something at least as small as that routine.Einar Saukas wrote: ↑Fri May 03, 2019 12:51 pmI know.arkannoyed wrote: ↑Fri May 03, 2019 12:20 pm A DEFB is all ok from an assembler point of view for a one off game, but to copy 32 bytes of data and clearing the board would still be bigger. As its going to be replayable, it needs a board reset routine.
I was suggesting DEFB for chesSkelet only, since it doesn't clear the board and it's not replayable.
Re: 3D Chess 2K18
That would be super-lovely. I totally respect 1K Chess. If anyone sees my chesSkelet website you can read that I think it's nearly impossible what he did with the 80's infra. Now, with emulators and all we can run programs 100 times per hour and see. I can't imagine how much time it would have taken for me to do chesSkelet in such conditions.Einar Saukas wrote: ↑Fri May 03, 2019 5:38 pm On another subject...
The classic 1K Chess by David Horne was never intended to be the SMALLEST POSSIBLE chess. It was the opposite. The author was trying to PUT AS MUCH CONTENT AS POSSIBLE (full chess rules, good AI, etc) within the memory limitations of the original 1K ZX81.
David Horne wasn't saving bytes to make his program smaller. He was doing it so he could have enough room to improve AI logic, for instance.
Nowadays there are several even smaller chess programs (I mentioned a few here at the time). They are all certainly impressive, but their AI is typically so bad they are not fun to play.
Your 3D chess will never be smaller than those existing 2D versions anyway. Therefore I see no point in just adding a simplistic AI to the code you already have. Instead, I suggest your goal should be achieving the BEST POSSIBLE chess game in exactly 1K. Which means supporting 100% of chess rules, and the smartest possible AI you can fit.
It seems both chesSkelet and David Horne's 1K chess play better than others. I would first play a few rounds between them to compare AIs, then use the best players as starting point to implement yours...
If you need any input from me to run those games, let me know.
Re: 3D Chess 2K18
You are Roger Jowett AICMFP.d2010 wrote: ↑Thu May 09, 2019 3:20 pmYes,yes **arkannoyed wrote: ↑Thu May 09, 2019 2:51 pm When I've integrated the GUI, you should be able to just set BIT 7 of all the board squares and when you build it, they will all be grey, ok?
I do not need exactly grey-color, I need any texture (BIN 101001010), or (BIn 1100110011) of board-color-black.
The texture is mix 11--00-pixels inside the byte...i replay to you at PM.
First Step you. make easiest tasks , send to private message...
Second Task,only if you can make texture-board-game.
then you inject hard-task.
Re: 3D Chess 2K18
I thought the same for a moment when I saw his wierd video for the first time, but I still wanted to hope.
At some point he had to come here, it was simply inevitable...
It's important that arkannoyed focuses on real challenges, not on gray board fields.
Later, when everything is done, he can do the SamCoupe port, especially for Roger.
At some point he had to come here, it was simply inevitable...
It's important that arkannoyed focuses on real challenges, not on gray board fields.
Later, when everything is done, he can do the SamCoupe port, especially for Roger.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
@d2010, is this what you wanted?
Re: 3D Chess 2K18
Actually, that doesn't look half bad.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
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.
Shouldn’t be too hard to implement, as it’s only masking and can be swapped by changing 1 byte.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
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?
- Metalbrain
- Microbot
- Posts: 107
- Joined: Thu Feb 15, 2018 2:14 pm
Re: 3D Chess 2K18
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.
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: 3D Chess 2K18
Perfectly safe. Go ahead.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?
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.
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.