PanagiotisIatrou / chess-auto-bot

A bot for chess.com and lichess.org that automatically plays chess for you
MIT License
71 stars 26 forks source link

Add support for other engines (Lc0, Komodo, Houdini,...) and remember the path of engines #21

Open bphucc opened 1 year ago

bphucc commented 1 year ago

Hello, as the title said, can you add feature for integrating with other engines, I found this library that can communicate with lc0, you can follow up the code to implement the feature! https://pypi.org/project/chessEngines/

And every time I run the gui.py file, I have to configure the path to SF myself again, can you make a config.json (like cutechess or nibbler) that holds all the engines information as well as configurations, then when running the GUI, we have options to choose between engines parsed from config.json file, that would really convenient.

Thank you, this is a really nice and awesome project!!

PanagiotisIatrou commented 1 year ago

Hello @nguyenphuc241. Both ideas sound really great! Just for organization purposes, can you open a separate issue for the config file idea suggestion?

bphucc commented 1 year ago

Thank you for your reply, instead of using chessEngine library, you can use python-chess as it supports more engines, as I found chessEngine supports only SF and lc0, but python-chess can interact with all UCI/XBoard engines. For reference you can read their documentation here: https://python-chess.readthedocs.io/en/latest/engine.html

And I will create another issue about the structure of the config file idea suggestion.

Vaksoa commented 1 year ago

I agree, the python-chess library would be great to use in this project. It'd allow for so much more functionality and engine support! It's also really simple to get it started.

Example:

import chess
import chess.engine

# Create a board and an engine
board = chess.Board()
engine = chess.engine.SimpleEngine.popen_uci("path/to/engine")

# Analyze the board position for 10 seconds
info = engine.analyse(board, chess.engine.Limit(time=10))
print(info["score"], info["pv"])

# Close the engine
engine.quit()
kusayuzayushko commented 1 year ago

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) and you can actually follow its plans and learn from it or use as a copilot if set up at near your strength.