Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 15:19 19 May 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 3 of 6    
Author Message
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 923
Posted: 06:54am 04 Oct 2022
Copy link to clipboard 
Print this post

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
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3589
Posted: 08:57am 04 Oct 2022
Copy link to clipboard 
Print this post

A simple stack usage bar graph... requires RC5 or later

'changes to monitor STACK usage (require picomite 5.07.05RC5 or newer)
settick 200,showstack

dim bar$=space$(8)
dim i:for i=1 to 9:bar$=bar$+chr$(127):next 'font 8, chr$(219) in other fonts

sub showstack
 local a%,b%
 a%=mm.info(stack)
 a%=a%-&h2003f800  'stack info from matherp
 a%=a%/1000 'value 9...2'
 if a% < 4 then
   b%=rgb(red)
 else
   b%=rgb(greeN)
 end if
 text 280,220,mid$(bar$,a%,9),,,,b%
end sub
'end of stack monitor changes ----------------------------------------

Edited 2022-10-04 18:59 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8605
Posted: 09:05am 04 Oct 2022
Copy link to clipboard 
Print this post

But remember the stack usage subroutine uses stack

Best is to capture the stack level in a variable and then output it in the main program where stack usage is at its lowest
Edited 2022-10-04 19:07 by matherp
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3589
Posted: 10:05am 04 Oct 2022
Copy link to clipboard 
Print this post

  matherp said  But remember the stack usage subroutine uses stack

Best is to capture the stack level in a variable and then output it in the main program where stack usage is at its lowest


May be unavoidable with my skill set. If you place monitor code at fixed locations in the main code, you need know where. The settick interrupts at (for the main program) random moments. Agreed, the settick interrupt is an layer extra, using stack.

If I knew exactly at what line of the code stack usage was most, I would place the monitor there... But it is too complex without a tracing tool. Candidates would be "in-check" and "eval_". Mostly "eval_", but it calls lots of other "eval_..." functions.
So best would be to place a monitor in all of those.

I will look at that tonight...
PicomiteVGA PETSCII ROBOTS
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 414
Posted: 12:49pm 04 Oct 2022
Copy link to clipboard 
Print this post

Hi,
I suspect that it will be necessary to make big significant changes to make any noticeable difference, ie to be, being able to do, an extra level of search.

My understanding is that the only relevant depths from the point of view of the computer would be 1,3,5,7..... because I think levels 2,4,6.... are effectively the computer calculating what it predicts you the opponent will do, so to make any difference to the strength of play we would need to get to a depth of 6 or 8 or.....

As for speed I think it'll be necessary to get some compiled C as a Csub in there to speed it up, my suspicion is that any MMBasic (or any interpreted)  version on such lowly hardware is going to be equally as slow, but without any hard information I have no idea. :-)
Regards Kevin
 
bar1010
Senior Member

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

  Bleep said  Hi,
I suspect that it will be necessary to make big significant changes to make any noticeable difference, ie to be, being able to do, an extra level of search.

My understanding is that the only relevant depths from the point of view of the computer would be 1,3,5,7..... because I think levels 2,4,6.... are effectively the computer calculating what it predicts you the opponent will do, so to make any difference to the strength of play we would need to get to a depth of 6 or 8 or.....

As for speed I think it'll be necessary to get some compiled C as a Csub in there to speed it up, my suspicion is that any MMBasic (or any interpreted)  version on such lowly hardware is going to be equally as slow, but without any hard information I have no idea. :-)
Regards Kevin


Note that Tom Kerrigan’s original TSCP Chess which is available for download on his website was written in C.  Both the source code and executable are available.
 
bar1010
Senior Member

Joined: 10/08/2020
Location: United States
Posts: 197
Posted: 01:40pm 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


Those graphics are very nice for board size 160x160 pixels.
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 414
Posted: 02:25pm 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


Hi Martin,
If you can get them into the same arrangement as this bmp file, it is 240*40 the image info says it's 1 byte per sample with 3 channels, which means I assume 24 bits per pixel, we could look at incorporating them, you can use the standard range of PicoMiteVGA colours if you like, the black and white shaded background could be a problem, because of lining up the shading when they are put on the board, but if you put an extra empty 'black' & 'white' square on the end we can give it a go, so eventually 260*40, if you stay with 'black' & 'White', or 240*40 if colour.

SmallPieces.bmp.zip

Regards Kevin.
 
Volhout
Guru

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

This is going to be a true community project....
Wauw... great !!

pico is limitted but sure it is challenging.... And we like that.
PicomiteVGA PETSCII ROBOTS
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 414
Posted: 02:57pm 04 Oct 2022
Copy link to clipboard 
Print this post

  bar1010 said  
Note that Tom Kerrigan’s original TSCP Chess which is available for download on his website was written in C.  Both the source code and executable are available.


Hi Bar1010,
Yes I strongly suspect that the only real way of improving this is to compile up a version of TSCP which can be incorporated into a program as a CSub, I have no idea if that is even possible for such a relatively large body of code? such that the standard MMBasic is the front end and the compiled TSCP does the grunt work. The interface could be very simple, a 64 byte buffer, which is the board, then send to TSCP a move, along with a depth of search and a time limit, TSCP returns with either the move, or a updated buffer with the piece moved.
You might think that that won't help with memory requirements, except that every variable in MMBasic uses 64bits, and a quick look at TSCP source, every variable is either a char or an int, so 8bit or 16bit, so a huge memory saving especially when some of the arrays are large and two dimensional.
So for the moment 5 levels of search, is about the max and that takes approx 30mins, obviously you can reduce down to 3 levels of search, which is about 10mins I think, but this is probably highly variable on the state of the board.

Regards Kevin.
 
Martin H.

Guru

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

  bar1010 said  

Those graphics are very nice for board size 160x160 pixels.

well .. for PicoMite in Mode 1 (640x480x2), i think a Board 320x320 would be better,
so every Field is 40x40



40x40.zip


Cheers
  Mart!n
'no comment
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 414
Posted: 03:15pm 04 Oct 2022
Copy link to clipboard 
Print this post

Hi Martin,
I've just had a look at the manual, it says MMBasic can handle black and white bmp files, so presumably 1 bit per pixel.
As an experiment if you can produce a 520*80 version of the bmp in black and white, ie all the pieces as above, plus an empty black and white square, we can try using mode 1, higher resolution screen. I have no idea if the board and text can be made to fit, but it'll potentially be worth a try.
Regards Kevin.

you beat me to it, but it has to be the same layout as the smallpieces.bmp file.
Edited 2022-10-05 01:22 by Bleep
 
Martin H.

Guru

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

  Bleep said  

Hi Martin,
If you can get them into the same arrangement as this bmp file, it is 240*40 the image info says it's 1 byte per sample with 3 channels, which means I assume 24 bits per pixel, we could look at incorporating them, you can use the standard range of PicoMiteVGA colours if you like, the black and white shaded background could be a problem, because of lining up the shading when they are put on the board, but if you put an extra empty 'black' & 'white' square on the end we can give it a go, so eventually 260*40, if you stay with 'black' & 'White', or 240*40 if colour.

SmallPieces.bmp.zip

Regards Kevin.

Hi Kevin
here the small.bmp.
The Icons are arranged, as your template

---

---

small.zip

  Bleep said   x80 Image  

I ll do my verry best
Edited 2022-10-05 01:44 by Martin H.
'no comment
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 414
Posted: 03:51pm 04 Oct 2022
Copy link to clipboard 
Print this post

Hi Martin,
I also need the two empty squares, one black one white, either on the front or back of that bmp, so that it is 260*40. or even 520*80 if we try for the higher resolution.
Thanks.
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 414
Posted: 04:12pm 04 Oct 2022
Copy link to clipboard 
Print this post

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

 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 923
Posted: 04:17pm 04 Oct 2022
Copy link to clipboard 
Print this post

alter Mann ist kein D Zug  
old man isn't a speedtrain
so here with two empty Tiles


as 24 Bit bmp and also as 1 bit:

Large_24 and 1Bit.zip

had no time to test it on Pico but I am sure one will work in mode 1
'no comment
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 414
Posted: 04:24pm 04 Oct 2022
Copy link to clipboard 
Print this post

Thanks Martin,
There's no rush, we still haven't got permission from Tom the originator of TSCP to release it.
Regards Kevin.
Edited 2022-10-05 02:25 by Bleep
 
Volhout
Guru

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

Kevin,

I am not sure TSCP will finalize a game with itself.



Who ever is to play, a pawn can be taken....
No valid moves...hah...
Edited 2022-10-05 02:32 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 923
Posted: 04:34pm 04 Oct 2022
Copy link to clipboard 
Print this post

  Bleep said  Thanks Martin,
There's no rush, we still haven't got permission from Tom the originator of TSCP to release it.
Regards Kevin.


the Supreme discipline would be a 3D(like) view  but for this I have to draw all Figures as Sprites .. that will Take some time.
It would also have to user Framebuffer and Layer ...
(just for Inspiration)

Something like Chessmaster on the old Atari ST:



PS: Tried to load 24 and 1 Bit Image in Mode 1... 1 bit shows nothing (white) and  24 Bit Picture has some errors ..(MMBasic Version 5.07.05RC6)
But what works fine in Mode 1 is JPG Picture.

Large_JPG.zip

Cheers
Mart!n
Edited 2022-10-05 03:14 by Martin H.
'no comment
 
bar1010
Senior Member

Joined: 10/08/2020
Location: United States
Posts: 197
Posted: 06:37pm 04 Oct 2022
Copy link to clipboard 
Print this post

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.
 
     Page 3 of 6    
Print this page
© JAQ Software 2024