Giter Site home page Giter Site logo

tomin1 / patience-deck Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 2.0 1.18 MB

Patience Deck is a collection of patience games for Sailfish OS based on GNOME Aisleriot.

License: GNU General Public License v3.0

QMake 0.64% QML 23.58% C++ 66.67% Scheme 0.63% Shell 3.31% Python 4.38% C 0.80%
sailfish-os solitaire-game

patience-deck's People

Contributors

tomin1 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

poetaster jsehv

patience-deck's Issues

Locking screen leaves cards dragged

Locking screen while dragging cards leaves those cards being dragged still.

Steps to reproduce:

  1. Drag some card(s), don't raise finger
  2. Press power button on the other hand
  3. Unlock the device

Cards are still being dragged although user is not touching them. The drag should have been canceled. Touching the dragged card will cancel the drag. Note that touching some other card will not help. Also now if the device is rotated the cards will not resize.

Access to new game button is too difficult

Currently starting a new game is only possible from Options & Rules page but that requires using pulley menu to first open that page. In contrast Restart button requires only a press of a button on toolbar. I did not want to add new game button to toolbar since it is destructive, i.e. player cannot get back to the previous game if they press new game accidentally. This needs some thought to not break this rule while allowing easier access to new game action.

Leaking texture file descriptors

Textures aren't correctly released. Currently it uses delete later but that can leave them hanging around if the delete doesn't happen in the GUI thread. Instead they should be removed on the GUI thread with a render job. That would also remove the need for pending texture as the old texture is guaranteed to stay around until after rendering.

This is easiest to test with lsof -p pid by checking the output, rotating the device and checking again (hint: piping to wc -l is a good idea). There should be more dmabuf file descriptors open when the issue occurs:

patience- 21899 defaultuser 50u a_inode 0,12 0 14008 dmabuf43704
patience- 21899 defaultuser 51u a_inode 0,12 0 14008 dmabuf43723
patience- 21899 defaultuser 52u a_inode 0,12 0 14008 dmabuf43724

At least I get these every time. Eventually the app would run out of file descriptors and crash.

Disappearing cards on Patience Deck 0.5.1-1 ?

Dear @Tomin1

I'm having a lot of fun with Patience Deck 0.5.1-1 on SFOS 4.1 / Xperia 10 II (64 bits). Thank you very much for porting this game to SailfishOS :)

On some not so rare occurrences I stumble upon a bug where cards seem to disappear, making the current game impossible to complete (see screenshot below).

As per the screenshot, one can see that there's one deal left, yet the stock in the upper left corner is empty...

Please let me know if I could do something on my end to help you pinpoint this issue.

Best regards,

Samuel

Capture d'écran_20210819_001

Improvements to win animation

A basic version of win animation was implemented in #5 but that could be further improved. In particular I'd like to see more variation in the animations, perhaps different (selectable) animations, if there are enough viable ideas to implement. Feel free to tell about your ideas and experiment with the code. Note that there are some things you need to consider:

  • Some games have stacks of cards per suit, like Klondike.
  • Some games put those stacks to other positions on the table, like Beleaguered castle.
  • Some games have single cards on the table, like Maze.
  • Some games expanding stacks of cards, like Osmosis.
  • Some games don't have any cards on the table at the end, like Helsinki.
  • Some games have a combination of these, like Wall.

Yeah, it's a lot to consider. But any improvements, big or small are welcome to be discussed.

Add translations of game rules

Currently game rules cannot have translations as the model doesn't support translating them. However GNOME Aisleriot comes with game rule translations for some languages. Taking these into use would allow translated game rules for some languages. Others should fall back into default language.

Support building from SDK's Qt Creator (shadow builds)

Support building from SDK's Qt Creator. Currently it is not possible because Patience Deck's build system doesn't support shadow builds. I think it should be possible to improve builds so that regular (non-harbour) version would support shadow builds. It wouldn't be quite out of the box builds as Guile and other libraries need to be built and installed first but it could make development more attractive for some developers. Harbour builds require complicated steps that might be a little too much to get working with shadow builds and rebuilding libraries takes a long time anyway, but even regular builds as shadow builds would be a good first step.

Collect more won games to test data

Currently test data has 58 different games that have a winning play. That leaves 32 games that don't have any. I'd very much like to have successful plays for all of them to be able to check animations properly on all of them. You can help with this. Pick a game in this list, play it through (some are very tough to finish!) and use a script from this repository to collect a command that can replay the game. You can use it when the game is open in won state or if you closed the app just after beating the game.

  • Accordion
  • Agnes
  • Auld Lang Syne
  • Aunt Mary
  • Backbone
  • Camelot
  • Canfield
  • Clock
  • Cruel
  • Diamond Mine
  • Easthaven
  • Eliminator
  • Escalator
  • Fortunes
  • Forty Thieves
  • Gaps
  • Kansas
  • King Albert
  • Lady Jane
  • Odessa
  • Pileon
  • Poker
  • Scorpion
  • Scufflez
  • Spiderette
  • Thieves
  • Thirteen
  • Treize
  • Valentine
  • Wall
  • Yield
  • Yukon

While I'm really looking for finished won games, I would not mind having more game over plays too if such doesn't already exist in test data. You can submit your played game here, DM it me on Sailfish OS forum (user tomin) or send me an email.

You can use the script like this:

curl -o save_state.sh https://raw.githubusercontent.com/Tomin1/patience-deck/master/tools/save_state.sh
chmod +x save_state.sh
./save_state.sh won_game.txt

Copy that won_game.txt to a safe place. If you need the script again, you only need to repeat the last step.

Enable all games

Enable all games from GNOME Aisleriot and get rid of allowlist in GameList class.

Keep statistics of finished games

Currently there is no record of finished games. It would be possible to save finished games (lost and won) to sqlite database and then calculate statistics (number of games played and won, time) to display. Player finishing a game and then undoing a move should be also carefully considered when collecting the statistics. This also needs some UI design for another page in the application. There are also some performance considerations once the number of played games grows very large.

Save state per game

Currently there is only one saved state for the game that has been played last. This could be improved so that the game state was saved per game so that selecting another game may continue from where the game was the last time.

While doing this it might make sense to move the state information and saved game options form dconf to sqlite.

Allow dragging cards while magnifying table

Dragging cards would probably work okay even when table is magnified if touch handling was a bit different. It would require moving magnifying from QML code to C++ and then figuring out how the card's new position would be calculated.

Building guile on i486 on sfdk fails

Building guile for i486 with sfdk fails and I have been trying to figure it out myself but it seems a bit too big of a challenge. Building guile package with the instructions on README.md fails with this error:

checking whether libunistring was built with iconv support... no
configure: error: No iconv support.  Please recompile libunistring with iconv enabled.

config.log tells a little bit more about the issue:

configure:47723: ./conftest
./conftest: error while loading shared libraries: libunistring.so.2: cannot open shared object file: No such file or directory
configure:47723: $? = 127
configure: program exited with status 127

This is different from the issue I had with mb2 and it does not happen with arm targets. At this point I'm not sure if this is an issue with my packaging or if it's bug in the SDK. I'll comment later here an easier way to reproduce the same issue.

Zoom cards on long press

It could be nice if player could zoom in cards with a long press. Currently it is a bit difficult to find cards in a stack. In GNOME Aisleriot player can right click cards to raise them on top of others to see them better and that works well with a mouse, but it wouldn't work on touch screen where fingers usually cover touched cards. Instead we could make the card grow upwards or to its left making the symbols on top left of the card to move next to the finger. Dragging enlarged cards should probably be allowed. This needs some experimentation to see if it is actually a feasible solution.

Add win animation

This is a very often requested feature: After a game ends, if the game was won it should throw cards around. Similar to what Windows' Klondike game has. I think the animation doesn't necessarily need to be the same and there could be even multiple variations of it. The difficult part is that Patience Deck supports a number of different games so animations would need to adapt to different positions of stacks in different games. Some games don't have any cards on the table at the end, so there might be need for an animation that works in this situation.

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.