Discuss Scratch

birdracerthree
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

amaanshayaan wrote:

How do you put a scratch chess bot on lichess? From what I been testing, don't you have to host the bot on your computer and use the lichess api to get it on the website?
What do you mean when you say “use the lichess api”? Does lichess support engines made on Scratch?
amaanshayaan
Scratcher
17 posts

Scratch Chess Engine - Game of Kings

Oh its the python api made to integrate engines into lichess bots. https://github.com/lichess-bot-devs/lichess-bot
birdracerthree
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

amaanshayaan wrote:

Oh its the python api made to integrate engines into lichess bots. https://github.com/lichess-bot-devs/lichess-bot
Doesn’t that require Python code? I think a Scratch engine would have to be converted into a different language to make it run on Lichess.
amaanshayaan
Scratcher
17 posts

Scratch Chess Engine - Game of Kings

Yeah that's why I'm asking how people are giving lichess links.
birdracerthree
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

amaanshayaan wrote:

Yeah that's why I'm asking how people are giving lichess links.
You have to put the game into Lichess and import.
amaanshayaan
Scratcher
17 posts

Scratch Chess Engine - Game of Kings

Oh ok
Thecrugamer444
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

removed–please don't advertise anywhere except Show and Tell

Last edited by spectre_specs (Nov. 12, 2023 15:09:57)

S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

@ArnoHu

I've been looking around, and it looks like Killer Moves seem to be the next logical step. I'm wondering how to get the killer moves “back” in the move orderer, as well as the “replacement scheme” for the killer moves.
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

S_P_A_R_T wrote:

@ArnoHu

I've been looking around, and it looks like Killer Moves seem to be the next logical step. I'm wondering how to get the killer moves “back” in the move orderer, as well as the “replacement scheme” for the killer moves.

I keep a list with four killer-moves entries per ply, least-recently-used ordering, and if they can be applied on the current board, give them a score of 80 centipawns plus the index of their index in the list, so most recent kill-move goes first: https://github.com/ArnoHue/scratch/blob/6ad676160f6031eafcae15df52567f927f773a4e/chess/Engine.scratch#L5040

Storing killer-moves:
https://github.com/ArnoHue/scratch/blob/6ad676160f6031eafcae15df52567f927f773a4e/chess/Engine.scratch#L1921
https://github.com/ArnoHue/scratch/blob/6ad676160f6031eafcae15df52567f927f773a4e/chess/Engine.scratch#L2000
https://github.com/ArnoHue/scratch/blob/6ad676160f6031eafcae15df52567f927f773a4e/chess/Engine.scratch#L5040
S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

S_P_A_R_T wrote:

@ArnoHu

I've been looking around, and it looks like Killer Moves seem to be the next logical step. I'm wondering how to get the killer moves “back” in the move orderer, as well as the “replacement scheme” for the killer moves.

I keep a list with four killer-moves entries per ply, least-recently-used ordering, and if they can be applied on the current board, give them a score of 80 centipawns plus the index of their index in the list, so most recent kill-move goes first: https://github.com/ArnoHue/scratch/blob/6ad676160f6031eafcae15df52567f927f773a4e/chess/Engine.scratch#L5040

Storing killer-moves:
https://github.com/ArnoHue/scratch/blob/6ad676160f6031eafcae15df52567f927f773a4e/chess/Engine.scratch#L1921
https://github.com/ArnoHue/scratch/blob/6ad676160f6031eafcae15df52567f927f773a4e/chess/Engine.scratch#L2000
https://github.com/ArnoHue/scratch/blob/6ad676160f6031eafcae15df52567f927f773a4e/chess/Engine.scratch#L5040

Thanks! I feel like after the Killer Moves, I'm just going to have to add the dreaded Transposition Table lol
S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

I've noticed that GoK's killer moves are updated with the “item (depth) of best move”, does this mean that if a beta-cutoff happens, it logs the current moves (which will be best), or the last best move?
S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

I just implemented Killer Moves into White Dove, and the results so far look amazing! I've been looking at GoK a lot, and I've just realised, it updates the progress bar and best move even with Warp Timer off! How does GoK achieve this?

(I also just released WD v5.1, featuring the “Killer Moves”, and also adding promotions to the PGN export feature {e - to toggle export} )

Last edited by S_P_A_R_T (Nov. 13, 2023 01:06:47)

birdracerthree
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

S_P_A_R_T wrote:

I just implemented Killer Moves into White Dove, and the results so far look amazing! I've been looking at GoK a lot, and I've just realised, it updates the progress bar and best move even with Warp Timer off! How does GoK achieve this?

(I also just released WD v5.1, featuring the “Killer Moves”, and also adding promotions to the PGN export feature {e - to toggle export} )
Why do you need the warp timer?
amaanshayaan
Scratcher
17 posts

Scratch Chess Engine - Game of Kings

What would be the optimal pawn position advantage chart that I could use for a beta chess engine? I am not sure where to distribute the points.
birdracerthree
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

amaanshayaan wrote:

What would be the optimal pawn position advantage chart that I could use for a beta chess engine? I am not sure where to distribute the points.
What do you mean “pawn position advantage”? Are you referring to piece-square tables?
amaanshayaan
Scratcher
17 posts

Scratch Chess Engine - Game of Kings

birdracerthree wrote:

amaanshayaan wrote:

What would be the optimal pawn position advantage chart that I could use for a beta chess engine? I am not sure where to distribute the points.
What do you mean “pawn position advantage”? Are you referring to piece-square tables?
Yep, sorry, I am new to the terminology. Also, does GOK have an opening book?
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

S_P_A_R_T wrote:

I just implemented Killer Moves into White Dove, and the results so far look amazing! I've been looking at GoK a lot, and I've just realised, it updates the progress bar and best move even with Warp Timer off! How does GoK achieve this?

(I also just released WD v5.1, featuring the “Killer Moves”, and also adding promotions to the PGN export feature {e - to toggle export} )

In noticed you can update the screen from run-without-screen-refresh custom blocks by broadcasting a message (without “wait”) and updating in the message handler.
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

S_P_A_R_T wrote:

I've noticed that GoK's killer moves are updated with the “item (depth) of best move”, does this mean that if a beta-cutoff happens, it logs the current moves (which will be best), or the last best move?

A move that caused a cutoff is stored in the killer moves list for that ply, or moves up the ranks it if is already there. And the move is - by definition - also the currently best move.
S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

S_P_A_R_T wrote:

I just implemented Killer Moves into White Dove, and the results so far look amazing! I've been looking at GoK a lot, and I've just realised, it updates the progress bar and best move even with Warp Timer off! How does GoK achieve this?

(I also just released WD v5.1, featuring the “Killer Moves”, and also adding promotions to the PGN export feature {e - to toggle export} )

In noticed you can update the screen from run-without-screen-refresh custom blocks by broadcasting a message (without “wait”) and updating in the message handler.

I've tried this, and it doesn't seem to be working for me, do I need a “wait () seconds block”?

Edit: I tried using the broadcast and wait block, and it doesn't seem to affect performance! Now every new iteration at depth 1 triggers a broadcast and wait of refreshing the progress bar, which also refreshes the “thinking best move”, and the eval bar!

Last edited by S_P_A_R_T (Nov. 13, 2023 22:25:25)

ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

S_P_A_R_T wrote:

ArnoHu wrote:

S_P_A_R_T wrote:

I just implemented Killer Moves into White Dove, and the results so far look amazing! I've been looking at GoK a lot, and I've just realised, it updates the progress bar and best move even with Warp Timer off! How does GoK achieve this?

(I also just released WD v5.1, featuring the “Killer Moves”, and also adding promotions to the PGN export feature {e - to toggle export} )

In noticed you can update the screen from run-without-screen-refresh custom blocks by broadcasting a message (without “wait”) and updating in the message handler.

I've tried this, and it doesn't seem to be working for me, do I need a “wait () seconds block”?

Edit: I tried using the broadcast and wait block, and it doesn't seem to affect performance! Now every new iteration at depth 1 triggers a broadcast and wait of refreshing the progress bar, which also refreshes the “thinking best move”, and the eval bar!

Sorry, I was not clear. I meant “Broadcast, but not BroadcastAndWait”. Yes, you need to invoke “Wait” after that, as is the case in GoK code. Back then BroadcastAndWait killed performance, but maybe the ST has fixed that since.

Last edited by ArnoHu (Nov. 14, 2023 04:22:27)

Powered by DjangoBB