IOKernel / Sangatsu

A barebone chess.com cheat
3 stars 5 forks source link

Add FIDE settings so the bot doesn't always play as Grand Master #15

Open SolsticeSpectrum opened 1 year ago

SolsticeSpectrum commented 1 year ago

Sometimes you just wanna be some specific rank and don't want to play as 3000 lvl player

It should intentionally loose some games

kusayuzayushko commented 1 year ago

There are settings in utils/game.py that allow you to limit the Stockfish engine's search depth, which is the number of moves it looks ahead. By default, it's set to 17 moves. However, limiting the search depth will not make the engine less skilled, it will only limit its ability to look deeper into potential moves during the game. Despite this limitation, the engine will still play at a high level and make precise calculations at the start of the search tree.

Instead, consider adding support for other chess engines like lc0, as an option. lc0 offers more human-like play and with different weights networks, it can emulate a wide range of human strengths from 1200 elo to 1900 (using Maia https://github.com/CSSLab/maia-chess) or even play hyper-aggressive gambit style (using MeanGirl https://github.com/dkappe/leela-chess-weights/wiki/Mean-Girl:--the-most-fun-leela-style-net).

SolsticeSpectrum commented 1 year ago

Btw stockfish devs say that anything bellow depth of 20 is not recommended. Even then the bot made a strange move where it could already checkmate the queen but it didn't

SolsticeSpectrum commented 1 year ago

There are settings in utils/game.py that allow you to limit the Stockfish engine's search depth, which is the number of moves it looks ahead. By default, it's set to 17 moves. However, limiting the search depth will not make the engine less skilled, it will only limit its ability to look deeper into potential moves during the game. Despite this limitation, the engine will still play at a high level and make precise calculations at the start of the search tree.

Instead, consider adding support for other chess engines like lc0, as an option. lc0 offers more human-like play and with different weights networks, it can emulate a wide range of human strengths from 1200 elo to 1900 (using Maia https://github.com/CSSLab/maia-chess) or even play hyper-aggressive gambit style (using MeanGirl https://github.com/dkappe/leela-chess-weights/wiki/Mean-Girl:--the-most-fun-leela-style-net).

So running maia actually wasn't too hard. Just build lc0, add .pb to bin with the lc0 executable, in game.py change the engine from stockfish to lc0 and set DEPTH to 0 (they say you have to) and then you can happily play maia. Thank god IOKernel didn't choose to make his own framework that would for example only work with stockfish.

Using mean girl should be just matter of putting the .pb into bin instead of maia

SolsticeSpectrum commented 1 year ago

@IOKernel You might wanna add configurations to use lc0 and maia or mean girl. However people on Linux have to build it themself so add some handling where it opens the wiki if lc0 is not in bin

https://github.com/LeelaChessZero/lc0/blob/master/README.md#building-and-running-lc0

The reason why Linux users have to build it themself is mainly the libraries like cuda or cudnn when you have older GPU But apart of that it is relatively easy to switch engines and models

SolsticeSpectrum commented 1 year ago

By the way chess.engine have configs for Hash and Skill. I am not sure what those do.

SolsticeSpectrum commented 1 year ago

@kusayuzayushko You seem to know a lot in this regard I just found how to use tablebases and opening books in this chess library for Python. What tablebases and opening books would you suggest for maia?

kusayuzayushko commented 1 year ago

@kusayuzayushko You seem to know a lot in this regard I just found how to use tablebases and opening books in this chess library for Python. What tablebases and opening books would you suggest for maia?

syzygy-tables for 3,4,5,6 pieces, specifically WDL without DTZ. Have to google for a torrent file to get them all in one place.

SolsticeSpectrum commented 1 year ago

@kusayuzayushko You seem to know a lot in this regard I just found how to use tablebases and opening books in this chess library for Python. What tablebases and opening books would you suggest for maia?

syzygy-tables for 3,4,5,6 pieces, specifically WDL without DTZ. Have to google for a torrent file to get them all in one place.

Actually I was told to not use tablebase if I want to still have human like play. Instead I should only use opening books. What opening book would you recommend for Maia to keep somewhat human like gsmeplay?