RuolinZheng08 / renpy-chess

A chess GUI built with Ren'Py, python-chess, and Stockfish. Version 2.0 of https://github.com/RuolinZheng08/renpy-chess-engine
https://r3dhummingbird.itch.io/renpy-chess-game
MIT License
74 stars 14 forks source link

Consider making chess engine plugable #10

Open devdanzin opened 3 years ago

devdanzin commented 3 years ago

Allowing alternative chess engines, like pure Python Sunfish, could make it easier to target iOS support (cf. Figure out how to add Stockfish engine for iOS since there's no download) and maybe running as HTML5.

This makes more sense if renpy-chess becomes a library (cf. [Wishlist] Separate standalone / demo and library), as users would be able to evaluate engine chess ranking, portability, completeness, etc. to suit their desired gaming experience. One example would a simple chess puzzle game where only move validation is necessary: no need to include stockfish for that (cf. Check OS compatibility and use the correct Stockfish binary.

If there's interest, I can submit an exploratory PR once we agree on a basic design.

RuolinZheng08 commented 3 years ago

It's plausible to make a minimal renpy-chess library if developers are okay with Sunfish's restrictions on promotion moves:

Sunfish supports castling, en passant, and promotion. It doesn't however do minor promotions to rooks, knights or bishops - all input must be done in simple 'two coordinate' notation, as shown in the screenshot.

Sunfish probably doesn't support draw-claiming in the case of a Threefold Repetition, etc.

Not sure how well-documented Sunfish's API to interact with the board is, but please feel free to explore it as you wish.

RuolinZheng08 commented 3 years ago

Another good takeaway from this is that, to support iOS and HTML5, we may use the MTD-bi search algorithm used by Sunfish when there is no Stockfish binary for the platform the coding is running on.