shlomif / PySolFC

A comprehensive, feature-rich, open source, and portable, collection of Solitaire games.
http://pysolfc.sourceforge.net/
GNU General Public License v3.0
453 stars 100 forks source link

Restrict cardset/tiles use by the game type to avoid mixing them up #16

Closed jan-kleks closed 3 years ago

jan-kleks commented 7 years ago

For example, if you play "Klondike" and you change "Cardset..." to "Tiny cardsets" -> "Crystal Mahjongg", the cards would turn into mahjong tiles. Also, each game in "Playable Preview" would be previewed with mahjong tiles. It is possible to mix up this way any other types of cards and tiles as well. I think there should exist restrictions on which game can use which cards or tiles, so that choosing, for instance, Hanafuda cards when playing Matrix games would be impossible. What is more, I have found out that even if you don't change any settings, and you launch a card game first, each mahjong game will be previewed with playing cards in "Playable preview".

BTW, restarting PySolFC does not help, you have to "select" a solitaire again (e.g. from the game list) to fix a wrong card/tile type on the table.

shlomif commented 7 years ago

On Wed, 12 Apr 2017 09:45:20 -0700 Jan Kleks notifications@github.com wrote:

For example, if you play "Klondike" and you change "Cardset..." to "Tiny cardsets" -> "Crystal Mahjongg", the cards would turn into mahjong tiles. Also, each game in "Playable Preview" would be previewed with mahjong tiles. It is possible to mix up this way any other types of cards and tiles as well. I think there should exist restrictions on which game can use which cards or tiles, so that choosing, for instance, Hanafuda cards when playing Matrix games would be impossible. What is more, I have found out that even if you don't change any settings, and you launch a card game first, each mahjong game will be previewed with playing cards in "Playable preview".

BTW, restarting PySolFC does not help, you have to "select" a solitaire again (e.g. from the game list) to fix this.

sounds like a good idea. Not a high priority for me personally but I can imagine other people may be affected.

--

Shlomi Fish http://www.shlomifish.org/ List of Networking Clients - http://shlom.in/net-clients

Satan condemned Hitler for a million years of writing XSLT. — http://www.shlomifish.org/humour/bits/facts/XSLT/

Please reply to list if it's a mailing list post - http://shlom.in/reply .

hairspring commented 7 years ago

Perhaps make it not impossible (after all, there may be someone weird out there who likes it that way) but at least a warning?

Not a high priority for me either. I think it goes near the end of the wish list.

jan-kleks commented 7 years ago

@hairspring Thank you for this comment! Some of these mixed-up combinations seem really ridiculous, and more like a bug than anything else. Well, we can analyze these combinations and see if there is actually something interesting. After filing this bug, I found out that someone made a mahjong which you play with French cards (BTW, it might be a nice idea for a new PySol mahjong tile-set if one simplified the cards even more).

However, for a typical user who mostly switches between French-card solitaires and mahjong (I guess these are the most popular solitaire games), it would be really strange to see cards as mahjong tiles in "Playable Preview".

An alternative to the warning would to bury the option "Allow for mixing different cards/tile-sets" deep in advanced settings.

joeraz commented 3 years ago

Okay, I thought I had commented on this, but I guess it slipped my mind. I actually dealt with a piece of this one for 2.12.

Regarding the fact that users can mix up cardsets and games, the game would deal, but would not properly recognize the cardset being different. As such, it may treat cards as being different than what the actual suit and rank on the card would indicate.

To give an example, a Tarock deck contains an extra rank between the Jack and Queen for the Cavalier or Knight. If one was to try using a Tarock deck to play classic Klondike, it would not properly recognize the difference in the number of ranks - the ace through queen of the first suit will be recognized correctly, but that king would really be the ace of the second suit, because the game is expecting 13 ranks, not 14. For all but very few games, this would make them virtually unplayable.

There has always been an error message built into the code that would indicate that a cardset is incompatible with the game, though until 2.12, it would only appear under one very specific, and very rare, circumstance. I've updated the logic so that this error would appear when switching cardsets normally. If there is any interest in being able to mix and match cardsets despite the obvious errors, I can make the error more of a warning, and add some verbiage to it indicating that "using an incompatible cardset could make the game unplayable".

As far as the preview goes, I plan to fix that too, but changing the cardset there would require loading the new cardset, which would cause delays. I could also look into just loading one cardset of each type at the start, but this would make the game load slower. I'll need to figure out a good, efficient way to handle this.

joeraz commented 3 years ago

After experimenting, I realized that the loading time for the new cardsets is not as problematic as I originally thought. Performance can still be improved, but I've successfully set up playable preview to use the correct cardsets. Closing this as complete.