After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730057 - Use the library libgames-scores to manage scores
Use the library libgames-scores to manage scores
Status: RESOLVED FIXED
Product: gnome-mines
Classification: Applications
Component: general
3.13.x
Other Linux
: High enhancement
: ---
Assigned To: Nikhar
gnome-mines-maint
Depends on: 727656
Blocks: 745492
 
 
Reported: 2014-05-13 10:58 UTC by Allan Day
Modified: 2016-04-26 04:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Calculator (git master) (20.62 KB, image/png)
2014-05-13 16:34 UTC, Michael Catanzaro
  Details
Patch that uses libgames-support to manage scores (14.73 KB, patch)
2015-03-06 04:30 UTC, Nikhar
reviewed Details | Review
screenshot, my that empty state! (10.58 KB, image/png)
2016-02-15 02:54 UTC, Michael Catanzaro
  Details
screenshot of normal state, some room for improvement here.... (10.58 KB, image/png)
2016-02-15 02:55 UTC, Michael Catanzaro
  Details
Try again to attach screenshot (42.09 KB, image/png)
2016-02-15 02:56 UTC, Michael Catanzaro
  Details

Description Allan Day 2014-05-13 10:58:00 UTC
The current scores dialog feels a bit like it's from a spreadsheet program, rather than a game. It also doesn't encourage (self) competition. A better design would:

 * Rank the results to encourage you to do better.
 * Not require work (window resizing, scrolling, sorting).
 * Allow multiple players to compete.
 * Look attractive.

There are some mockups for a new dialog here (see bottom-right):

https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/games/mines/mines2-new.png
Comment 1 Michael Catanzaro 2014-05-13 16:34:07 UTC
Created attachment 276463 [details]
Calculator (git master)

I mostly like this design, especially since it will work equally-well for all of our games.

I don't want to mix scores from different difficulty levels, so I'm planning to not implement the Difficulty column and instead have a combo box for switching between difficulty levels, like we do now.  I'm not sure how to do this elegantly. Perhaps we could use a title combobox, like with the latest Calculator (which I *think* worked well?).
Comment 2 Robert Roth 2014-05-26 12:18:38 UTC
@Allan Day: could you please comment on Michael's thoughts on the scores dialog?
Comment 3 Michael Catanzaro 2014-05-26 14:56:17 UTC
Some private discussion from early April:

Michael: [A]dding a new column to indicate the difficulty level of a particular score [...] would not work well because the easier levels of course will be finished in less time, so you'd have to play the 8x8 board if you want to get a high score.

Allan: It's a bit hard to make that look nice, and if it were me I'd want to see all my scores alongside each other. I was wondering if we could somehow compute the ranking based on the time and the difficulty...

Michael: Well we could, but the scores wouldn't be as meaningful. There's no way we'd be able to normalize the difficulty correctly, for instance: on some difficulty level it would be easier to score points than on others. I really think the way to go is separate lists.

Michael: Brainstorming: The last mockup had a button on the bottom for Change Name; we could use that with the label "Show scores for different board sizes." Or we could use the board size as the title for the dialog (after the name has been entered) and make it a popover menu, like in the master branch of Calculator.

Allan: If we can't normalise the difficulties it might just be simplest to put each difficulty into a separate tab. The problem is custom games, of course...

(Which reminds me that a GtkNotebook would probably work here.)

Anyway, sorry for having been distracted from the scores project for so long.  There is a library and Mines and Robots are both using it and it mostly works, but the API was designed ten years ago for the old C games, and I need to do more work on it before it'd be suitable for master.
Comment 4 Michael Catanzaro 2014-06-26 23:19:28 UTC
The current plan is to add a new category for each type of custom game that has been played in the past. This means there could be a real notebook full of categories -- somewhat messy -- for someone who likes to play lots of different types of custom games, but there will be zero tabs if you always play the same type of game.

The alternative is to not track scores for custom games at all.
Comment 5 Robert Roth 2014-07-01 15:42:00 UTC
Are we sure we want to use a notebook? I like the calculator approach, having entries in the popup for the same categories we have on the new game screen (Small, Medium, Large, Custom), maybe with a "submenu" for custom boards listing custom sizes played. Submenu in this context means something similar to gnome-shell submenus, when the Custom game is clicked, the custom board sizes are revealed.
Comment 6 Michael Catanzaro 2014-07-01 20:04:54 UTC
(In reply to comment #5)
> Are we sure we want to use a notebook? I like the calculator approach

Nope, I'm fine with either way.

>having
> entries in the popup for the same categories we have on the new game screen
> (Small, Medium, Large, Custom), maybe with a "submenu" for custom boards
> listing custom sizes played. Submenu in this context means something similar to
> gnome-shell submenus, when the Custom game is clicked, the custom board sizes
> are revealed.

OK, this is a good idea, and it only really works for the Calculator-style popover approach, so if anyone doesn't like that, please object soon!

Nikhar, this means a slight update to Games.Score.Category is in order:

Category
{
    string key;
    string name;
    Subcategory? subcategory; /* this is new */
}

where subcategory will normally be null, but would be non-null for custom games. (It might also be useful for Robots; e.g. each game mode could have three subcategories: normal, with safe moves, and with super safe moves.  That would make the menu much less cluttered.)

Subcategory
{
    string key;
    string name;
}

We almost don't need the Subcategory class at all: I'm only proposing that because it seems wise to prevent games from nesting more than one level of subcategory. If Category.subcategory was a Category instead of a Subcategory, then the scores dialog would need to be able to nicely handle arbitrary nestings of categories, which seems unnecessary.
Comment 7 Michael Catanzaro 2014-08-17 23:09:51 UTC
FYI, this is a target for 3.15.1.
Comment 8 Robert Roth 2014-12-30 22:25:32 UTC
@Michael Catanzaro: what's the status on this? Is libgames-scores available?
Comment 9 Michael Catanzaro 2014-12-30 23:39:32 UTC
(In reply to comment #8)
> @Michael Catanzaro: what's the status on this? Is libgames-scores available?

It's 95% done, but there are a couple of loose ends (e.g. the scores dialog is too wide) that we need to tie up. Nikhar is looking into things a bit over break. I'm still hoping to have everything done in time for 3.16, since not much more work is required, but I'm only working on WebKit for the immediate future.

The library is available at [1] and you can use it on a sidebranch, but not on master since there's no release and it's not in jhbuild yet. I'm pretty sure the wip/libgames-scores branch of GNOME Mines is incompatible with the current version of the library; it's being used successfully in GNOME Robots, but that's not a Vala project.

Related: I want to make sure you've seen [2] and are OK with it.

[1] https://git.gnome.org/browse/libgames-scores
[2] https://mail.gnome.org/archives/games-list/2014-August/msg00009.html
Comment 10 Nikhar 2015-03-06 04:30:50 UTC
Created attachment 298684 [details] [review]
Patch that uses libgames-support to manage scores

This patch uses libgames-support to manage scores. The old scores would unfortunately be lost with this. Patch's created from a new sidebranch though called libgames-support.
Comment 11 Michael Catanzaro 2015-03-06 04:49:28 UTC
Review of attachment 298684 [details] [review]:

Looks good to me.

See also bug #745489
Comment 12 p.oliveira.castro 2015-05-21 12:44:24 UTC
In the LAN I administer, the users used to compete for the best score on GNOME Mines on Ubuntu 12.04 on free time. Since we switched to ArchLinux, not only the scores were lost, but also the scores are not being shared by the machines (we used to share /var/game between them, and there were the old scores).

Where are the scores saved now? With this new patch, what changes for us?
Comment 13 Michael Catanzaro 2015-05-21 14:01:25 UTC
(In reply to p.oliveira.castro from comment #12)
> In the LAN I administer, the users used to compete for the best score on
> GNOME Mines on Ubuntu 12.04 on free time. Since we switched to ArchLinux,
> not only the scores were lost, but also the scores are not being shared by
> the machines (we used to share /var/game between them, and there were the
> old scores).
>
> Where are the scores saved now? With this new patch, what changes for us?

They're saved in the users' home directories, under ~/.local/share/gnome-mines. With this patch, the only change is that all scores will be reset once. I marked bug #745489 as a blocker, to make sure scores don't get reset again. This won't restore your scores from Ubuntu 12.04 -- those are gone -- but it would be good to not lose all the scores again.

I've also filed bug #749682 to allow you to configure scores to be saved in /var/games once again, so that LAN competitions will work again.
Comment 14 Michael Catanzaro 2016-02-15 02:52:26 UTC
I pushed updated code to the wip/libgames-support branch in git. Scores import is working well. Feel free to go crazy and merge it today before freeze (seems to be working fine, and I've done it for three other games already), or play it safe and save it for the next cycle.
Comment 15 Michael Catanzaro 2016-02-15 02:54:26 UTC
Created attachment 321178 [details]
screenshot, my that empty state!
Comment 16 Michael Catanzaro 2016-02-15 02:55:34 UTC
Created attachment 321179 [details]
screenshot of normal state, some room for improvement here....
Comment 17 Michael Catanzaro 2016-02-15 02:56:36 UTC
Created attachment 321180 [details]
Try again to attach screenshot
Comment 18 Robert Roth 2016-02-29 22:18:37 UTC
Let us save it for next cycle, I thing we should merge this (and hopefully will manage to add for other games too) for 3.22, early in the cycle, e.g. for 3.21.1.
Comment 19 Robert Roth 2016-04-26 00:26:51 UTC
I wanted to merge this, but I couldn't compile, because of gee.h not being found, I had to add gee-0.8 to configure.ac. Did you manage to build without that change?
Comment 20 Michael Catanzaro 2016-04-26 01:09:27 UTC
(In reply to Robert Roth from comment #19)
> I wanted to merge this, but I couldn't compile, because of gee.h not being
> found, I had to add gee-0.8 to configure.ac. Did you manage to build without
> that change?

Yeah, it works fine for me. I think that should not be needed, because gee-0.8 is required in the pkg-config file. I'm not sure what's wrong; is it possible you have an old version of libgames-support? (Try 'jhbuild buildone libgames-support'.)
Comment 21 Robert Roth 2016-04-26 04:06:17 UTC
The build error happened after building and (make) installing libgames-support from master. Maybe some trigger was not run, which is usually we executed by dnf while installing. Please merge into master and push, and I will try to investigate what's up with my system.
Comment 22 Michael Catanzaro 2016-04-26 04:14:07 UTC
What is the error you're seeing?
Comment 23 Robert Roth 2016-04-26 04:37:37 UTC
It was include /usr/include/...: include gee.h not found, or something similar, but now it doesn't happen, even after reverting my configure.ac in gnome-mines to original, make clean, ./autogen again and make. So pushing right now.
Comment 24 Robert Roth 2016-04-26 04:38:33 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.