ianfab / fairyground

playground for Fairy-Stockfish in the browser
https://fairyground.vercel.app/
GNU General Public License v3.0
20 stars 5 forks source link

Variant specific graphics #41

Closed dpldgr closed 8 months ago

dpldgr commented 9 months ago

Enable variant specific mapping of piece letters to piece graphics.

vercel[bot] commented 9 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fairyground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2023 8:06pm
dpldgr commented 8 months ago

@ianfab I think this PR might go some way to resolving issues #5 and #28. The files theme-variant-*.css basically act as a pieceToCharTable, and allow the correct graphics to be displayed (in the preview variant capablanca shows the correct graphic for piece letter A, as does variant amazon).

ianfab commented 8 months ago

Thanks. To my understanding the main benefit of this feature is that it allows for more concise customization per variant because it only requires to specify a diff and not a completely new set as with the current custom themes in the config.

@yjf2002ghty What's your opinion on this?

dpldgr commented 8 months ago

Thanks. To my understanding the main benefit of this feature is that it allows for more concise customization per variant because it only requires to specify a diff and not a completely new set as with the current custom themes in the config.

In a sense it allows you to extend the piece sets with new pieces. The A piece I created for amazon is the perfect example. The way things need to be done now, the end user would need to manually change to a new piece set that has been created for the variant. With this PR, the developer/admin specified pieces are automatically loaded without needing to manually change piece sets and playing variants becomes a more seemless experience for the end user.

yjf2002ghty commented 8 months ago

I think this is a good way to load variant specific images for "merida" and "cburnett" provided by server without creating a completely new set.

For client side image selection ( #5 ), this is not the solution. We need to add a graphical interface that allows end users to change the images and save them.

ianfab commented 8 months ago

Yes, that was also my thought, it is a nice convenience feature for development, but it does not really add a new feature for users. However, I realized maybe I just slightly misunderstood the intention, and this is just the starting point to later replace the variant argument by a user (sub-)theme selection but reusing this exact mechanism. E.g., having a dropdown with something like "amazon", "archbishop-chancellor", "hawk-elephant", etc., and allowing the user to disambiguate the letter-image association using his selection. For the user this would be much easier but slightly less flexible than a per letter image selection.

Either way it is a useful improvement. Please just run the formatting, then I will merge it.

dpldgr commented 8 months ago

I think this is a good way to load variant specific images for "merida" and "cburnett" provided by server without creating a completely new set.

Using my variants as an example, I use this feature to remap the letters for pieces that had been invisible when using meridaand cburnett. It's not as playable as using my own custom graphics, but it's better than not seeing pieces at all, and might be a more familiar stepping stone for some players.

For client side image selection ( #5 ), this is not the solution. We need to add a graphical interface that allows end users to change the images and save them.

Yeah, it doesn't completely solve #5, but the method of remapping piece letters can form the basis for a user selectable image mechanism.