Coder Social home page Coder Social logo

ianfab / fairyground Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 5.0 10.05 MB

playground for Fairy-Stockfish in the browser

Home Page: https://fairyground.vercel.app/

License: GNU General Public License v3.0

JavaScript 30.54% CSS 42.78% HTML 24.23% Shell 1.82% Batchfile 0.63%
chess-variants fairy-stockfish nnue wasm

fairyground's Introduction

Introduction

I am Fabian Fichter, a software developer in bioinformatics, mainly experienced with Python and C++, with focus on algorithms, data analysis, and automation. I very much enjoy playing abstract strategy board games, especially chess and related games, and developing open source software for them.

My current main open source project is Fairy-Stockfish, a chess variant engine playing on top level at a large variety of chess-like games and being used on several chess and chess variant websites, such as lichess.org and pychess.org. Also see the Fairy-Stockfish github organization.

Projects

Fairy-Stockfish

Chess (variant) data analysis

Technologies

Python C++ C Java SQL JavaScript TypeScript

VS Code Pycharm IntelliJ Vim

Git Hg Linux AWS Postgres MongoDB

fairyground's People

Contributors

dpldgr avatar gbtami avatar ianfab avatar rainrat avatar thearst3rd avatar yjf2002ghty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fairyground's Issues

Wrong animation when a king moves into a castling square without castling

So, chmess is this trivial variant where the king moves over two squares instead of one. When I tried to play this on fairyground, I noticed that playing Kg1/8 or Kc1/8 when the corresponding rook hasn't moved will move the rook as if I had castled for a split second before putting it back on its home square. I couldn't get the effect to happen consistently if castling was illegal but I think that if castling in the direction of the move is legal, the effect will reliably trigger.

For completeness, this is what I added to the variants.ini I imported:

[chmess:fischerandom]
king=k:K2

EDIT: I just realised that the author might have intended the king's move to be nDnA instead. That's irrelevant to the issue, but I felt the need to say it. The same bug happens if you use that move too.

2023-12-22.00-46-40.mp4

Start game messes up coordinate mapping

Sometimes after clicking "Start game" the coordinate identification seems to be messed up as can e.g. be seen by right clicking on the board, making it impossible to move properly. Any zooming or scrolling either before or after clicking "Start game" seems to fix it. Potentially an interference with hiding of elements on start of game?

Amazon Chess

Amazon chess replaces queens with amazons, which are queen-knight hybrids. In Fairyground, there is a preset of amazon chess. However, the amazons are displayed as archbishops, which may be due to the fact that the names of both start with "a". As archbishops are quite common in fairy chess variants, displaying archbishop-seeming amazons may be quite misleading. I have not checked other variants' archbishops, but most of those are very likely correct. Could these amazons be displayed in another way? (pieceToCharTable)

Add "Settings: [nodes]" option to Advanced Analysis page.

It'd be nice to be able to specify a number of nodes per move (mapping to uci "go nodes" under the hood) in the advanced options for fairyground. That would enable games of a more consistent quality to be played/generated as the engine's search isn't effected by how loaded or fast a processor is.

Add move disambiguation

In case of ambiguous user input (e.g., a7a8q/r/b/n) add dropdown/selection for disambiguation. How does this work in chessgroundx?

Betza Notation Working Inconsistently

[cannonshogi:shogi]
shogiPawn = -
soldier = p
dropNoDoubled = -
cannon = u
janggiCannon = a
customPiece1 = c:mBcpB
customPiece2 = i:pB
customPiece3 = w:RpRFpA
customPiece4 = f:BpBWpD
promotedPieceType = u:w a:w c:f i:f
startFen = lnsgkgsnl/1rci1uab1/p1p1p1p1p/9/9/9/P1P1P1P1P/1BAU1ICR1/LNSGKGSNL

Why can't I do 1.Ic5 with this definition?

Support duck/walls

As Winboard is broken for Atomicduck, I tried to use fairyground, but realized it's not supporting duck yet, so opening the issue to document the enhancement request :D

Is binary engine loading function needed?

Most modern offline chess GUIs can load binary engines, while online websites uses WASM instead due to browser security restrictions. Fairyground can be either deployed online or offline, where offline versions can use Node.js as its backend to load binaries. But for online deployed versions like Vercel, this isn't possible. I made a simple try before #26 is merged --link, and it proved that engine loading function can work on offline versions (Tested on Windows Edge Browser). I don't know whether such functions that need a backend in order to work are suitable to be added to Fairyground, as users are unable to get a quick try on it from Vercel. If it is not suitable, I will no longer consider these features that require a backend.

Convert the code style to object-oriented style

Most of the code are written in process-oriented style, focusing on the FSF-WASM, ffish board and chessgroundx board. An obvious characteristic is that there are almost no class in the code, making it harder to maintain especially when the code becomes more complex. Switching to object-oriented style can make it easier to handle.

The framework or stack does not need to change as all functions are working well so far (including binary engine loading feature), and my approach is to split the frontend and the backend so that they can work on their own thus implementing some features that traditional GUIs does not support such as running engines remotely (requires SSH). PKG is enough for this.

Does clearing hash after every move reduce engine strength?

I am reviewing the code written before and noticed that currently the UI sends a clear hash command to in browser fairy-stockfish after every move. Does this reduce engine strength? If yes, I'll create a pull request to fix this.

This does not affect binary engines.

Add complete piece set

Add SVGs for all piece letters from a-z and from +a to +z for the standard themes (e.g., merida, cburnett) to have visible pieces for all variants.

perft box

The ability to do perft for the different variants and for the board position would be great and a great help for debugging lesser engines. As far as I can see there is no online platform that can do that (maybe only via quirky uci commands in https://fairy-stockfish-nnue-wasm.vercel.app/)

tx Gregor

Is it possible to see the evaluation of a position in analysis mode?

image
As you can see from the image I am analysing my own custom variant and I can see the best move but no +/- evaluation to say who's winning.

Also is it possible to show the best move arrow on the board so I don't have to look at the console because I'm quite slow with move notation.

cant chain camel or zebra moves

[chain:chess]
customPiece1 = M:C0
startFen = rnbqkbnr/pppppppp/8/8/8/8/8/4M3 w kq - 0 1

if u replace it with a knight move, customPiece1 = M:N0, then it would work properly and look like this
image
but if u use a camel or zebra then it has no moves

Dobutsu lion in pocket pieces

I removed "k" (king) from starting FEN in variants having capturesToHand() to construct pocket pieces, but Dobutsu uses "l" (lion).
We can remedy this minor cosmetic issue exposing variants king piece in ffish.js/pyffish in the future.
https://i.imgur.com/fIlfyIf.png

Support selection of image per piece

Allow to customize themes by selecting from a predefined set of images (at least) for custom variants in order to disambiguate which piece is referred to by a given letter, either via the variants.ini or a UI selection.

Use pieceToCharTable

I think FairyGround should use the pieceToCharTable option with Merida-like versions of the XBoard piece images. This would allow us to use whichever letters we want and still have the pieces be visible.

Custom King Movements

From what I have read, this is how we are supposed to create a custom king:

# You can define custom king movements in the same way you can define another custom piece.
# E.g., to make the king move like a centaur:
# king = k:KN

However, the king still moves like a king:

[avariant]
pieceToCharTable = RKrk
rook = r
king = k:KN
startFen = 4k3/8/8/8/8/8/R7/4K3 w - - 0 1

Am I doing something wrong? Or, may I ask, is this a legit issue?

End users cannot make ATAXX drops

Currently fairyground uses "[]" in the FEN to judge whether a variant has pockets & drops.
However on ATAXX, this is not the case. We do not have "[]" in the FEN but we can drop pieces on the 8 squares near a same color piece. Users cannot drop these pieces correctly and they can only move the piece, making it unplayable.
The solution for this is to check the game rule whether a variant contains ATAXX dropping type, which is related with this issue: #27

How to get necessary game rule information of a variant (like used piece id)?

I'm considering adding a "Board setup" part which allows user to set up the board graphically instead of using FEN, which might be useful for those non-expert users. However, I've looked at the export interfaces of ffish.js library, there is no function that can provide detailed information on the game rule such as used piece id characters (q, r, n, b, etc.) and the promotion relationship between pieces. There is also no function that can provide information such as castling, n-fold repetition (the half move clock value needs this), valid gating area (used in seirawan gating) and other necessary information for setup.

Is there any method to gather these information other than simply using trial-and-error method by changing the FEN and validate it or reading the content of variants.ini and process the game rule entries in it?

Visualize analysis output

In order for engine output to be more accessible, evaluations and moves should be parsed and displayed, e.g., using arrows, SAN, and formatted eval.

Show legal drops

Currently it's not supported to show how a piece is dropped. In some variants the droppable zone is not regular and is not easy to figure out.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.