tomin1 / patience-deck Goto Github PK
View Code? Open in Web Editor NEWPatience Deck is a collection of patience games for Sailfish OS based on GNOME Aisleriot.
License: GNU General Public License v3.0
Patience Deck is a collection of patience games for Sailfish OS based on GNOME Aisleriot.
License: GNU General Public License v3.0
Locking screen while dragging cards leaves those cards being dragged still.
Steps to reproduce:
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.
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.
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.
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
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:
Yeah, it's a lot to consider. But any improvements, big or small are welcome to be discussed.
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. 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.
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.
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 from GNOME Aisleriot and get rid of allowlist in GameList class.
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.
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.
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 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.
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.
Please add ability to in-game shuffle cards not in foundation without restart current game or creating new game
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.