3D Chess 2K18
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Well, I've put a good few hours into trying to shave off more bytes in the past 2 weeks, but despite several useful optimisations and slight speed improvements, I've only managed to save one lonesome byte!
I'm working on several areas to try and just squeeze out anything that's wasted, but its become almost impossible.
Now at 584 bytes
I'm working on several areas to try and just squeeze out anything that's wasted, but its become almost impossible.
Now at 584 bytes
Re: 3D Chess 2K18
Well, maybe it's time to think about installing a engine.
That would be a complete masterpiece...
That would be a complete masterpiece...
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Not yet, I've still to lose -33 bytes. If I put the board initialising routine and data aside, that loses -39 bytes, so 584 - 39 =545
545 - 33 = 512 bytes!
Thats the goal!
545 - 33 = 512 bytes!
Thats the goal!
Re: 3D Chess 2K18
This is a worthy goal.
You obviously intended to overthrow the famous zx81 1k chess in terms of optimization and far better board, ofc.
You obviously intended to overthrow the famous zx81 1k chess in terms of optimization and far better board, ofc.
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Absolutely! I'm pretty sure ZX81 chess was 672 bytes actually, but though it displays little more than a bunch of letters representing the pieces, it does do a decent job at playing the game. I've studies the Disassembly at length for pointers!
If I can achieve something in 1k I'd be quite happy.
If I can achieve something in 1k I'd be quite happy.
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Getting nearer!
With some flashes of brilliance (maybe overstating a bit!) I've managed to quite easily save another 2 bytes that have long been annoying me!
Only 31 to go! Now at 582 bytes
With some flashes of brilliance (maybe overstating a bit!) I've managed to quite easily save another 2 bytes that have long been annoying me!
Only 31 to go! Now at 582 bytes
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Its all about the loops!
Saved another 2 bytes by collecting bytes recursively via a loop. Looks messy, but what the hell!
Now at 580 bytes
Saved another 2 bytes by collecting bytes recursively via a loop. Looks messy, but what the hell!
Now at 580 bytes
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Just when you though it was safe to look away.......another 4 bytes disappear!!! And a little bonus one too with a 2 byte jump
Now only 575 bytes
Now only 575 bytes
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Proof that it does still work!
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
...And with some cheeky byte sharing I've saved another byte
574 now!
574 now!
Re: 3D Chess 2K18
Sometimes you get so wrapped up in the coding that you fail to see the bigger picture. Can you spot what's wrong here
"He made eloquent speeches to an audience consisting of a few depressed daffodil roots, and sometimes the cat from next door."
- Einar Saukas
- Bugaboo
- Posts: 3158
- Joined: Wed Nov 15, 2017 2:48 pm
Re: 3D Chess 2K18
White queen and king starting at wrong position.
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
I know, work in progress, it will be sorted!!
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Fridays are always good for optimizing code!
Now 568 bytes
Now 568 bytes
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Finally re-written the other main line building algorithm and managed to save another 4 valuable bytes.
Possibly uninteresting, but now down to 564 bytes
Technically now only -13 to go!
Possibly uninteresting, but now down to 564 bytes
Technically now only -13 to go!
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: 3D Chess 2K18
Rewrite it into checkers.
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.
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Genius! 256 bytes easy!
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
...And -1 more byte
Now 563 bytes -12 to go
Now 563 bytes -12 to go
Re: 3D Chess 2K18
Does that include a fix for the incorrect start positions?
"He made eloquent speeches to an audience consisting of a few depressed daffodil roots, and sometimes the cat from next door."
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
The positioning is merely the way the board initialising routine works, in its current state, incorrectly. The board can be set to display anything manually. Once all the other optimising is done, I’ll work on that separately. As the bytes have continued to fall away, it became apparent that to achieve the goal of sub 512 bytes, the initialisation routine can’t be counted in that, otherwise I’ve still got to shift 51 bytes, which I seriously doubt possible. Even now, to achieve it I need to make a few careful graphical tweaks, as saving another 12 bytes from the routines is highly unlikely.
I do have a final idea waiting in the wings to try out, and if I can make it work, and if the decoding isn’t too heavy, then it could save probably -40 bytes from the graphics data. That’s still in the planning stage, but fortunately the code structure would allow for it to integrate without too much hassle.
When I rewrite the board initialiser it will hopefully be no more than the 39 bytes it is now. One reason for leaving it be for the moment is that other factors elsewhere might affect how it needs to operate. Once they’re finalised, then it can have some attention.
I promise I’ll post some properly commented source soon too!
I do have a final idea waiting in the wings to try out, and if I can make it work, and if the decoding isn’t too heavy, then it could save probably -40 bytes from the graphics data. That’s still in the planning stage, but fortunately the code structure would allow for it to integrate without too much hassle.
When I rewrite the board initialiser it will hopefully be no more than the 39 bytes it is now. One reason for leaving it be for the moment is that other factors elsewhere might affect how it needs to operate. Once they’re finalised, then it can have some attention.
I promise I’ll post some properly commented source soon too!
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
On a serious note, it could be done easily, just new gfx data and a suitable board initialising routine. Graphics currently 256 bytes, so probably possible in around 45-50 bytes max, total size no more than 350!
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: 3D Chess 2K18
Are you willing to put your bytes where your mouth is?arkannoyed wrote: ↑Thu Feb 14, 2019 6:30 pmOn a serious note, it could be done easily, just new gfx data and a suitable board initialising routine. Graphics currently 256 bytes, so probably possible in around 45-50 bytes max, total size no more than 350!
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.
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
You design the gfx then?! No more than 22 bits wide though! Then I’ll encode it.
Last edited by arkannoyed on Thu Feb 14, 2019 7:04 pm, edited 1 time in total.
- arkannoyed
- Manic Miner
- Posts: 438
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Or rip off the ones from draughts genius, even easier!
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: 3D Chess 2K18
I have a better idea: to rip off the base of your chess pieces.
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.