Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 20:47 22 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: TSCP Chess

     Page 4 of 7    
Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4219
Posted: 08:23pm 04 Oct 2022
Copy link to clipboard 
Print this post

Hey guys, before you get excited about the 3D chess board....
The framebuffer requires 38.5k RAM. With the low setting we have now, this will barely fit (44k free). All the extra graphics (sprites, variables etc...) must fit in 5k.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Rickard5

Guru

Joined: 31/03/2022
Location: United States
Posts: 463
Posted: 11:58pm 04 Oct 2022
Copy link to clipboard 
Print this post

  Martin H. said  Good Morning bleep and Volhout,

I ve done some Pixelwork this morning, so here is my Checkboard for the Pico,
I tried to get it as small as possible so the Board is only 160x160 Pixel




If you mind, you might use it in your Pico Translation

board.zip



PERFECT !!!!! JUST PERFECT
I may be Vulgar, but , while I'm poor, I'm Industrious, Honest,  and trustworthy! I Know my Place
 
Rickard5

Guru

Joined: 31/03/2022
Location: United States
Posts: 463
Posted: 01:46am 05 Oct 2022
Copy link to clipboard 
Print this post

OK I Apologize for the Rant , especially since I am a Useless POS programmer with no Skill to contribute, but <Rant> Speaking as a Chess Player, Who Ever was incharge of the Chessmaster project was obviously not a Chess Player. as a chess player the 3d Isometric view of the chess board hurts my brain so bad I BEG random people on the street to hit me over the head with a Lead Pipe. the 160x160 chess board by Martin H. is so super Awesome!!! it's so close to the standard Staunton Chess Graphics used in all the Chess Tournament, Books and Magazines. </rant> again I apologize, I realize I have the LEAST Right to speak up, because I have the least to offer in developing this project, but since Bar1010 Blessed up with TSCP Chess for the Color Maximite 2, I have spent a lot of time Playing Chess. right now TSCP is just a little better than me which is perfect it's not so hard that I give up or so easy I get board with it, and these are just my opinions as a chess player
Edited 2022-10-05 11:48 by Rickard5
I may be Vulgar, but , while I'm poor, I'm Industrious, Honest,  and trustworthy! I Know my Place
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2133
Posted: 02:55am 05 Oct 2022
Copy link to clipboard 
Print this post

@Bleep
"not sure why the green colour is showing on the pieces, I thought they should be just black and white?"

Did you use Paint? That and one or two other picture editors don't set the the colour pallet correctly. for them any 1 bit image is B&W but .BMP supports 24 bit foreground and background colours. A different editor may allow you to change the pallet. I use a Hex Editor to change the values in the BMP file header.
 
bar1010
Senior Member

Joined: 10/08/2020
Location: United States
Posts: 197
Posted: 03:34am 05 Oct 2022
Copy link to clipboard 
Print this post

  Rickard5 said  OK I Apologize for the Rant , especially since I am a Useless POS programmer with no Skill to contribute, but <Rant> Speaking as a Chess Player, Who Ever was incharge of the Chessmaster project was obviously not a Chess Player. as a chess player the 3d Isometric view of the chess board hurts my brain so bad I BEG random people on the street to hit me over the head with a Lead Pipe. the 160x160 chess board by Martin H. is so super Awesome!!! it's so close to the standard Staunton Chess Graphics used in all the Chess Tournament, Books and Magazines. </rant> again I apologize, I realize I have the LEAST Right to speak up, because I have the least to offer in developing this project, but since Bar1010 Blessed up with TSCP Chess for the Color Maximite 2, I have spent a lot of time Playing Chess. right now TSCP is just a little better than me which is perfect it's not so hard that I give up or so easy I get board with it, and these are just my opinions as a chess player


If you would like to contribute to the TSCP Chess project, there are things that you might be able to do that do not involve programming.  For example, if you could post additional new style chess pieces graphics in BMP format with both light and dark pieces each with light and dark square backgrounds that would be nice.  I could utilize BMPs that have squares 90x90 pixels or 115x115 pixels.  Also, if you could include many “fairy” chess piece types in the BMP files that would be good, then might be able to create additional chess variants.  Camels, Wildebeests, Zebras, Amazons, Nightriders, Eagles, Lions, Couriers, Man, Jesters, Princes, and Cannons are examples of “fairy” chess pieces used in variants.  For example, a BMP with the regular six piece types would have 24 square areas, four for each piece type.  Variants that have a board with more than eight ranks would need to have board squares smaller than 90x90 pixels to fit on screen.  Perhaps 75x75 pixels or 60x60 pixels board squares would be good for 10x10 or 12x12 square boards.
Edited 2022-10-05 13:44 by bar1010
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 08:37am 05 Oct 2022
Copy link to clipboard 
Print this post

  Volhout said  Hey guys, before you get excited about the 3D chess board....
The framebuffer requires 38.5k RAM. With the low setting we have now, this will barely fit (44k free). All the extra graphics (sprites, variables etc...) must fit in 5k.

Volhout

ok, that is a chellange  
I squised the routin for drawing the Background to exact 900 Byte

MODE 1:w%=RGB(White):CLS w%:Colour 0
For y%=0 To 7: For x%=0 To 7:If (x%+y%)Mod 2 Then Pixel x%,y%,0
Next :Next :For y%=146 To 396 Step 8:For x%=8 To 624 Step 8:
Sprite 0,0,x%,y%,8,8:Next :Next :Box 0,0,8,8,,w%,w%
Triangle 8,146,72,146,8,402,w%,0:Triangle 568,146,632,146,632,402,w%,0
For y%=0 To 7:For x%=0 To 7:If Not ((x%+y%)Mod 2) Then
p1X%=(72-y%*8)+x%*(62+2*y%):p1Y%=146+y%*32
p2x%=(72-y%*8)+(x%+1)*(62+2*y%):p2Y%=p1Y%
p3X%=p1X%+(-8+x%*2):p3Y%=p1Y%+32:p4Y%=p3Y%:p4X%=p2X%+(-8+(x%+1)*2)
Triangle p1X%,p1Y%,p2X%,p2Y%,p3X%,p3y%,w%,0
Triangle p3X%,p3Y%,p4X%,p4Y%,p2X%,p2y%,w%,0
EndIf :Next :Next :Line 72,146,568,146:Box 8,402,625,12
Line 72,146,8,402:Line 568,146,632,402
For x%=0 To 7:Line 72+x%*62,146,8+x%*78,402:Next
For y%=0 To 7:Line 72-y%*8,146+y%*32,568+y%*8,146+y%*32
n%=8*(7-y%):Text 2+n%,32+124+y%*32,Str$(8-y%),,,,0,w%
Text 632-n%,32+124+y%*32,Str$(8-y%),,,,0,w%:Next
F$=String$(9,32):Text 40,420,"A"+F$+"B"+F$+"C"+F$+"D"+F$+"E"+F$+"F"+F$+"G"+F$+"
H",,,,0,w%

or we just use "Load jpg"  



cheers
 Mart!n
Edited 2022-10-05 18:40 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4219
Posted: 09:33am 05 Oct 2022
Copy link to clipboard 
Print this post

Hi Martin,

picomite is running out of variable memory. Not program memory.
So squeezing code is not yet in order. We should focus on data RAM since that is scarce.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 11:43am 05 Oct 2022
Copy link to clipboard 
Print this post

Ok,
I've now had some time to do the improved pieces properly.
I have tried the higher resolution bitmaps, but there is not enough RAM to even be able to load them, let alone do anything with them, so a Mode 1 screen is a no go, which means staying with Mode 2, so you can use colour if you want, within the usual PicoMiteVGA colour restrictions, ie 16 predefined colours.
This is how it looks on my screen currently, though there are problems, over which we have no control.



Volhout, I sent you a PM yesterday, can you check it please.
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 11:51am 05 Oct 2022
Copy link to clipboard 
Print this post

  bar1010 said  various chess assets.zip

Here are some chess assets that could be used for PicoMite or Color Maximite 2 chess programs.  Included is a data file with 960 different initial positions for Chess 960, four alternate opening book files, and a BMP file with twelve different piece types for both white and black pieces with both light and dark square backgrounds.


Hi Bar1010,
Thank you very much for the 'chess assets' files. :-)
We can certainly look at possibly using one of the larger 'book' files, though as you can see we are fairly ram limited, I wonder if it's possible to load the book for the preliminary moves, then unload it to free up ram, once it's no longer needed? I'll look into that. I'm assuming you have had some communication with Tom K. the same as we have?
Regards Kevin.
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 12:24pm 05 Oct 2022
Copy link to clipboard 
Print this post

  Bleep said  Ok,
I've now had some time to do the improved pieces properly.
I have tried the higher resolution bitmaps, but there is not enough RAM to even be able to load them, let alone do anything with them, so a Mode 1 screen is a no go, which means staying with Mode 2, so you can use colour if you want, within the usual PicoMiteVGA colour restrictions, ie 16 predefined colours.
This is how it looks on my screen currently, though there are problems, over which we have no control.



Volhout, I sent you a PM yesterday, can you check it please.


Hi Kevin,
looks very nice...
If you wish, I can create a colorised Tileset.

now I just have to learn chess  

Cheers
 Martin
Edited 2022-10-05 22:26 by Martin H.
'no comment
 
bar1010
Senior Member

Joined: 10/08/2020
Location: United States
Posts: 197
Posted: 01:35pm 05 Oct 2022
Copy link to clipboard 
Print this post

  Bleep said  
  bar1010 said  various chess assets.zip

Here are some chess assets that could be used for PicoMite or Color Maximite 2 chess programs.  Included is a data file with 960 different initial positions for Chess 960, four alternate opening book files, and a BMP file with twelve different piece types for both white and black pieces with both light and dark square backgrounds.


Hi Bar1010,
Thank you very much for the 'chess assets' files. :-)
We can certainly look at possibly using one of the larger 'book' files, though as you can see we are fairly ram limited, I wonder if it's possible to load the book for the preliminary moves, then unload it to free up ram, once it's no longer needed? I'll look into that. I'm assuming you have had some communication with Tom K. the same as we have?
Regards Kevin.


Yes, I sent my zip file for TSCP Chess v2 to Tom Kerrigan via email.  He posted the zip file on his website.  He had indicated that he was okay with making modifications to TSCP Chess as long as he hosts the files on his website.  At some point, will be sending Tom another zip file for him to post TSCP Chess v3 on his website, but that might be months away.  All the coding changes for my Chess 960 variant have been completed.  Next will be testing it, then copying the program to make the Double Chess 960 variant which should be quite easy to modify.  Have thought about creating a few additional variants namely Colossus Chess with a 10x10 board which has two extra pawns, two extra knights, two extra bishops, and two extra rooks for each side.  And Metamachy with a 12x12 board with six additional piece types including Eagles, Lions, Princes, Camels, Cannons, and Elephants.  And also Wildebeest Chess with an 11x10 board with new pieces Camels and Wildebeests.
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 01:39pm 05 Oct 2022
Copy link to clipboard 
Print this post

Hi Martin,
Colour board & pieces would potentially be very nice thank you.
it needs to be the bmp file as I indicated before so 260x40 24bit with the last squares being empty, no pieces, exactly like the one you did for the 520x80, but 260x40 and whatever colours you are think best.
Regards Kevin
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4219
Posted: 02:12pm 05 Oct 2022
Copy link to clipboard 
Print this post

Hi chess addicts,

1/ Kevin's version can win a game. At max-depth=5 it took roughly 3 days to reach to this point, with a valid check-mate. Black (red) wins...



2/ Not sure if this would work, but in stead of using a large BMP file (260x40x4(24color+alpha)) with all the pieces, we might be able to use sprites. I mean real sprites. In our 160x160 field of 8x8 tiles, each tile on the board is 20x20. A sprite (16x16) would gently fit in the 20x20 tile. Using sprites would also require only 2x6=12 sprites, not 26 tiles we have now. (sprites can use black as transparent, or as black). The board would be drawn using BOX'es.
For sprites there is a sprite editor (at least for CMM2 and for CMM1). Not sure if one exists for the 16 colors of the pico. Maybe sprites consume less memory than the BMP will. Sprites use color numbers in the sprite definition file (1 char per pixel, using only 4 bits). Not sure how they are stored in RAM.
Edited 2022-10-06 00:18 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 03:10pm 05 Oct 2022
Copy link to clipboard 
Print this post

  Volhout said  Hi chess addicts,


2/ Not sure if this would work, but in stead of using a large BMP file (260x40x4(24color+alpha)) with all the pieces, we might be able to use sprites. I mean real sprites. In our 160x160 field of 8x8 tiles, each tile on the board is 20x20. A sprite (16x16) would gently fit in the 20x20 tile. Using sprites would also require only 2x6=12 sprites, not 26 tiles we have now. (sprites can use black as transparent, or as black). The board would be drawn using BOX'es.
For sprites there is a sprite editor (at least for CMM2 and for CMM1). Not sure if one exists for the 16 colors of the pico. Maybe sprites consume less memory than the BMP will. Sprites use color numbers in the sprite definition file (1 char per pixel, using only 4 bits). Not sure how they are stored in RAM.


I dont know how you are setting the Tiles right now. If you/Kevin use Blit, then it is allready the Spriteroutin in MMBasic.
Without Layer, you just have to repaint the Background via the BOX command and then place the Sprite .. (will only work, if there is no Black part within the Sprite itselfe). So you would need. Then you only need half as many sprites (one of each).
Would not work for Mode 1. But for Mode 1 you can store the whole Object in a String..
1Bit per Pixel and use GUI BITMAP to place them on the screen. (You might need all 24 tiles *Object with Background*) but the use of memory should be much smaler
40x40Pixel = 5Bytes*40 = 200 Byte per Tile
24 Tiles 4800 Bytes for all Tiles + 2*200 Background (except you paint them with the Box command) would be 5200 Byte for the Whole Grafic-Stuff
Edited 2022-10-06 01:20 by Martin H.
'no comment
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 05:27pm 05 Oct 2022
Copy link to clipboard 
Print this post

Hi, Yes I'm using sprites, there is a possible saving if we can produce a set of white & black(or whatever) pieces, that were say 18x18 or 16x16 whatever you prefer, and use transparency, so that we would not need the current 2 full sets of pieces, both colours on both colourd squares, which is why we currently need 24, this would reduce the spirits to 12, just the two sets of pieces on plane black background I would suspect, and yes this would save a chunk of memory. You would need to specify what colour you wanted the squares to be, (to compliment your pieces colours) so that I can prefil the background before the sprite is placed. Remember you can only use the 16 predefined colours, no others.
If you do the same order as now, pawn, knight, bishop, castle, Queen, King, then repeat in second colour, I'll extract them from that, so 18x216 or 16x192.
Regards Kevin
Edited 2022-10-06 03:34 by Bleep
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4026
Posted: 05:43pm 05 Oct 2022
Copy link to clipboard 
Print this post

If you are truly desperate and an SD card is mandatory then have 1 file per piece/colour/combination and load the sprite on demand - only one in memory at any one time. You aren't writing an arcade game.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 06:07pm 05 Oct 2022
Copy link to clipboard 
Print this post

Hi Tom
  thwill said  If you are truly desperate and an SD card is mandatory then have 1 file per piece/colour/combination and load the sprite on demand - only one in memory at any one time. You aren't writing an arcade game.

Best wishes,

Tom

That was my thought for using the 3D chess pieces, also in B/W i would still prefer GUI BITMAP as it uses just one Bit per Pixel. For this, i have to create a .Bin File with all Tiles in, which the Program can read the Strings from.
Next todo would be load the large.Jpg file, scan it pixelwise and write the Bin File.
Not today but maybe tomorrow evening

Cheers
Mart!n


https://www.thebackshed.com/forum/uploads/Martin%20H/2022-10-05_030139_Large_JPG.zip
Edited 2022-10-06 04:09 by Martin H.
'no comment
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9087
Posted: 06:55pm 05 Oct 2022
Copy link to clipboard 
Print this post

For interest this is the chess code running in C on the Pico at 378MHz



So this is pretty much the maximum speed possible with the Pico

Your terminal program needs local echo on and there is no line editing


TSCP.zip
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 09:48pm 05 Oct 2022
Copy link to clipboard 
Print this post

Hi Peter,
Thanks for doing that, it's way faster than the basic version, as you might expect, I think 5 levels was taking about 30minutes.
Now we need to see if it is possible to have that as a callable routine from Basic to do a nicer board. :-)
Regards Kevin.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6764
Posted: 06:41am 06 Oct 2022
Copy link to clipboard 
Print this post



DEFAULT INTEGER
DIM array_call(6), array_move(3)

array_call = (piece, x_current, x_destination, y_current, y_destination, takeflag)
status = FUNCTION CHESS(array_call(), array_move())
piece_moved = array_move(1)
x_moved = array_move(2)
y_moved = array_move(3)

Drat - can't do it - out of FUNCTION names.
Perhaps taking MMBasic customization a little too far, eh?  ;)
Edited 2022-10-06 16:41 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
     Page 4 of 7    
Print this page
© JAQ Software 2024