Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:01 30 May 2025 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 10 of 10    
Author Message
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 597
Posted: 07:21pm 20 May 2025
Copy link to clipboard 
Print this post

Hi Harm,
I have only tested the 320 version by setting
Option LCD320 on
I've just found in RC24 Peter seems to have disabled this for my display a ILI9488, I'll have to see why?
Anyway it still runs on my screen, which is a 480x320 LCD, just in the top left corner.
I can't think of any new functionality, maybe just give it a go with the new RC if you don't mind.
All of those bits are done using Print @, if that helps. Then the whole framebuffer is copied f, n.
Regards Kevin
Edited 2025-05-21 05:24 by Bleep
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4940
Posted: 07:05am 21 May 2025
Copy link to clipboard 
Print this post

Kevin,

When adding "MODE 2" as first command in the "chess320LCD.bas" it runs flawless on RC24 VGA unit. So the code is fine. I will look into it further, why it does not work on the ILI9341 in the Game*Mite.

Volhout
.
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4940
Posted: 08:39am 21 May 2025
Copy link to clipboard 
Print this post

Hi Kevin,

There is something different between 640VGA and 320LCD.
When white wins, 640VGA message is "White Mates".
However 320LCD says "Black Mates".

Any idea ? I think in the 320 version the red(black) and white tiles are swapped.
The white queen starts out on a black field... looks wrong.

Volhout
.
PicomiteVGA PETSCII ROBOTS
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 597
Posted: 09:20am 21 May 2025
Copy link to clipboard 
Print this post

Hi Harm,
I have a GameMite, so have wired it up.
I have found you need to set
OPTION LCDPANEL CONSOLE 7
Then it works fine, presumably this is required because I use Print @ ?
Regards Kevin
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 597
Posted: 09:26am 21 May 2025
Copy link to clipboard 
Print this post

  Volhout said  Hi Kevin,

There is something different between 640VGA and 320LCD.
When white wins, 640VGA message is "White Mates".
However 320LCD says "Black Mates".

Any idea ? I think in the 320 version the red(black) and white tiles are swapped.
The white queen starts out on a black field... looks wrong.

Volhout
.


Hi Harm,
You are quite correct, the LCD colours are reversed, :-( I'll make it better!
Regards Kevin.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4940
Posted: 11:31am 21 May 2025
Copy link to clipboard 
Print this post

@Kevin,

LCD version that runs on a Game*Mite. Uses COM1 at gp16/gp17 since that is available on the edge connector.

chess320LCD_hdl2.zip

Now we only need to find a method to use the buttons to select a function or character.
I can imagine using the cursor buttons to navigate from chess board field to chess board field. Select by using "A" button, use "B" for "undo". And at the bottom have pre-fixed commands like "AUTO", "NEW", "SET PLY", "HELP".

We may even think about dropping the moves list, making the board bigger.

Volhout

P.S. too bad we use the framebuffer. It is 16 colors. It would be so good to use the 16 bit colors of the LCD to make a realistic chess board. Near photo quality. And then develop a small RP2350 PCB that directly plugs into the Game*Mite edge connector.

EDIT: new upload to fix a bug.
.
Edited 2025-05-21 23:48 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 597
Posted: 02:45pm 21 May 2025
Copy link to clipboard 
Print this post

Hi Harm,
I have used your improved Input function, in both LCD versions, it allows an extra line on the display, especially useful on the 320LCD, along with all the other changes/suggestions, including GP16,GP17, for GameMite.
Regards Kevin.

ChessClient.zip
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4940
Posted: 11:59am 22 May 2025
Copy link to clipboard 
Print this post

Hi Kevin,

1 bug fix: when a game lasts longer that 100 moves the coloring in VGA mode is not correct.

Sub moves_template
 ' Clear the moves
 Box 0,1,227,278,,,RGB(black)
 ' draw the outline
 Box 0,1,227,278
 'tiles
 TILE 0,0,RGB(green),RGB(black),29,24
 TILE 3,1,RGB(white),RGB(black),5,22 'TILE 2,1,RGB(white),RGB(black),5,22
 TILE 7,1,RGB(red),RGB(black),5,22
 TILE 17,1,RGB(white),RGB(black),5,22
 TILE 23,1,RGB(red),RGB(black),5,22
End Sub


1 suggestion for faster compacter code in the LCD clients. 1 simple INSTR function can replace the long SELECT CASE code.

If piece$<>"." Then

     s=instr("PpNnBbRrQqKk",piece$) 'replaces the SELECT CASE

     'Select Case piece$
       'Case "p"
         's=2
       'Case "P"
         's=1
       'Case "n"
         's=4
       'Case "N"
         's=3
       'Case "b"
         's=6
       'Case "B"
         's=5
       'Case "r"
         's=8
       'Case "R"
         's=7
       'Case "q"
         's=10
       'Case "Q"
         's=9
       'Case "k"
         's=12
       'Case "K"
         's=11
     'End Select

     Sprite write s,x*20+161,y*20,&B100
   EndIf


Regards,

Volhout
PicomiteVGA PETSCII ROBOTS
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 597
Posted: 12:05pm 22 May 2025
Copy link to clipboard 
Print this post

Hi Harm,
The Instr is very neat, I'll add it, I had noticed the colour error, but hadn't done anything about it yet, so I'll add that too.
Thanks Kevin.
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 597
Posted: 06:39pm 22 May 2025
Copy link to clipboard 
Print this post

Hi Harm,
I realised your input function didn't cope with back space, so I've updated it, I was also frequently getting double characters, so I addad a short Pause.
Function fr_input$(x,y)
 Local a$,start%
 start%=x
 Do
   Do :a$=Inkey$:Pause 100:Loop Until a$<>""       'wait for a key
   If a$=Chr$(13) Or a$=Chr$(10) Then Exit Do      '<CR>=we are done
   If a$=Chr$(8) Then                              'check for back space
    a$=" "                                         'blank last character
    Text x,y,a$
    If x>start% Then                               'not back at start of line
     Inc x,-(MM.Info(fontwidth))                   'move char position back
     fr_input$ = Left$(fr_input$,Len(fr_input$)-1) 'remove last char from string
    EndIf
   Else
    Inc x,MM.Info(fontwidth)                       'advance x position
    fr_input$ = fr_input$ + a$                     'build a string
    Text x,y,a$                                    'reflect on screen
   EndIf
   FRAMEBUFFER copy f,n                            'update screen
 Loop
End Function


I've replaced the 'Case' with an 'Instr' and also corrected the colour when over 100 moves, I have made it Green also, just for you. ;-)
Regards Kevin.

ChessClient.zip
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4940
Posted: 07:44pm 22 May 2025
Copy link to clipboard 
Print this post

Hi Kevin,

Forgot about the backspace...
I did not see double characters, I used console keyboard on the LCD version.
Maybe that is different from PS2 or USB. Anyway.. you solved all this.

Thanks,

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4940
Posted: 12:09pm 26 May 2025
Copy link to clipboard 
Print this post

Kevin,

After watching endless games played by TSCP chess, the thing that amazes me is that the end-game play is weak. For openings, there is an opening book. Mid game, when set to 6 deep or more, a strong game can be played. But the end game may not be detected by the engine, and it keeps valuing the center squares of the board as stronger positions to be in, where most end games are decided against the sides.

Result is that end games tend to drag on much longer than needed.

Volhout
PicomiteVGA PETSCII ROBOTS
 
EDNEDN
Senior Member

Joined: 18/02/2023
Location: United States
Posts: 131
Posted: 01:32pm 26 May 2025
Copy link to clipboard 
Print this post

@Volhout  

It is interesting that you mention the 'weak endgame' of TSCP chess.   As it turns out, all of the top chess engines have a weak endgame.   Stockfish, Deep Blue and Shredder all are noticeably weaker in the end game.

One tactic I use quite often when playing the computer is to try to get up a piece or several pawns.    And then trade material aggressively.    Pretty much, you don't need to worry whether a particular trade is strategic.   (Of course there are exceptions, but most trades are the 'correct' thing to do when up a few points against the computer.)

The reason this works so well is two fold.    First, with lots of material on the board it is much easier for the human player to miss a particular line of play and make a mistake.    But the big reason this is helpful is simple math.   In a standard board position just being evaluated on material, each player starts with

(8 Pawns * 1 points) + (2 Rooks * 5 points) + (2 Knights * 3 points) + (2 Bishops * 3 points) + (1 Queen * 9 points) + (1 King * 2 points) = 41 points

If for example you are halfway through the game and you are up a minor piece, the point values of the material on the board might be something like 20 to 17.   As you aggressively trade material you are subtracting the same fixed number from both the numerator and denominator of the ratio.    So the ratio might be 20/17 when the human first gets ahead.   And then 17/14 after a minor piece is traded.    And then 14/11 as another minor piece pair gets taken off the board.    And then 9/6 as the last rooks get removed.    The ratio starts shifting in size very fast as material is removed.
Edited 2025-05-27 01:30 by EDNEDN
 
     Page 10 of 10    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025