RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Game statistics

    Scheduled Pinned Locked Moved Projects and Themes
    script
    44 Posts 7 Posters 5.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • langestL
      langest
      last edited by

      I have implemented a bash menu, similar to the ones used in the rest of RetroPie.
      I am also using dialog since I though it would look consistent.
      However, it seems like controller support doesn't work by default in the menu.
      How are the controller configured to work in the retropie-setup.sh for instance?

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @langest
        last edited by

        @langest There's a helper program (joy2key) which translates the gamepad inputs to keyboard inputs to navigate and use the dialog screens. Look at the joy2keyStart and joy2keyStop functions here.

        langestL 1 Reply Last reply Reply Quote 1
        • langestL
          langest
          last edited by

          Thanks

          1 Reply Last reply Reply Quote 0
          • langestL
            langest @mitu
            last edited by

            @mitu
            Do you think it would be possible to assume I am running on RetroPie and source the helpers into my scrip? Or do I need to copy the code?

            mituM 1 Reply Last reply Reply Quote 0
            • mituM
              mitu Global Moderator @langest
              last edited by

              @langest It's up to you - however without a RetroPie installation the joy2key program might not be available to run.

              1 Reply Last reply Reply Quote 1
              • langestL
                langest
                last edited by

                @mitu
                What would make the most sense to me would be to reuse the already implemented functionality in retro pie, because I don't plan to use the dialog interface anywhere else.
                The end goal of the tui is to add it to experimental programs in the retro pie install script.
                I tried to source the files, but I most likely did something wrong.
                I haven't really done much bash programming before so I am not sure how everything should be set up. Could you give me some pointers to get started?
                Thanks

                On a separate note, I have come up with some neat new features for the python program that I am going to add. Such as bar chart for visualization and weekly/daily activity.

                langestL 1 Reply Last reply Reply Quote 0
                • langestL
                  langest
                  last edited by

                  @administrators Maybe this thread should have been in the ideas and development sub-forum.

                  1 Reply Last reply Reply Quote 0
                  • langestL
                    langest @langest
                    last edited by

                    @langest said in Game statistics:

                    new features for the python program that I am going to add. Such as bar chart for visualization

                    Got it implemented now together with a new exclude flag as well:

                    $ python3 /home/pi/repos/RetroStats/retro-stats/game_stats.py -c total -b 20 -n 4 -e kodi
                                         Wario Land 3 ▏ 6:36:28 ████████████████████
                                    Crash Team Racing ▏ 2:01:08 ██████
                                       Super Mario 64 ▏ 1:59:56 ██████
                     Pokémon Pinball: Ruby & Sapphire ▏ 0:55:12 ██▊
                    
                    $ python3 /home/pi/repos/RetroStats/retro-stats/game_stats.py -c total -b 20 -n 3  -s nes -c times
                    Balloon Fight ▏ 3 ████████████████████
                       Salamander ▏ 2 █████████████▎
                      Smurfs, The ▏ 1 ██████▋
                    
                    
                    1 Reply Last reply Reply Quote 1
                    • langestL
                      langest
                      last edited by

                      I have implemented the daily schedule feature. It can now tell you when during a day you spend most time playing your games.

                        0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24
                                                            ░░░░▒▒▒▒░░░░▒▒▒▒▒▒▒▒░░░░░░░░▓▓▓▓▒▒▒▒▓▓▓▓████████░░░░        
                      

                      Next step would be to extend the daily view to a weekly view so you can track your invested time per hour per week day. And possibly add some machine learning to categorize invested time to get a nice gradient. Right now I hardcoded some values that looked good on my data.
                      Of course you can use this new view with some selected systems or excluded systems.

                      I also updated the format of the log to make sure that the time in the log is UTC. I then convert to your local time zone when printing. You either throw away your current log or use the convert script here: https://github.com/langest/RetroStats/commit/e8567b456c6e2f3d5e9bdbf6f764d9abcca3361f if you want to keep your data.

                      Also, if someone who reads this could give me some pointers on how to make this available in the install script experimental section or how to the controllers working in the TUI, I would be grateful, more detailed question above. Until then you will probably have to run this via CLI.

                      1 Reply Last reply Reply Quote 1
                      • langestL
                        langest
                        last edited by langest

                        I extended the daily view to a weekly view and added a recent history option and a lookback option. Lookback decides how many recent days you want your stats from.

                        $ python3 /home/pi/repos/RetroStats/retro-stats/game_stats.py -w
                        Monday
                          0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24
                                                                          ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓
                        Tuesday
                          0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24
                                                                                                  ▒▒▒▒▓▓▓▓▓▓▓▓
                        Wednesday
                          0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24
                                                                                              ▒▒▒▒████████▓▓▓▓
                        Thursday
                          0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24
                                                                                          ░░░░▒▒▒▒▒▒▒▒████▓▓▓▓
                        Friday
                          0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24
                                                                          ░░░░░░░░▒▒▒▒▒▒▒▒░░░░░░░░▓▓▓▓████▓▓▓▓
                        Saturday
                          0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24
                                                                          ▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓████▓▓▓▓▓▓▓▓▒▒▒▒
                        Sunday
                          0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24
                                                      ▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▓▓▓▓    ▓▓▓▓████████▓▓▓▓████▓▓▓▓
                        
                        
                        $ python3 /home/pi/repos/RetroStats/retro-stats/game_stats.py -r -n5
                        2019-11-01 19:36:37+00:00 gba Pokemon Gaia
                        2019-11-01 19:15:18+00:00 n64 Mario Kart 64
                        2019-11-01 18:49:16+00:00 kodi
                        2019-10-31 19:39:49+00:00 gba Rhythm Tengoku
                        2019-10-30 20:37:13+00:00 megadrive Sonic the Hedgehog 2
                        
                        1 Reply Last reply Reply Quote 0
                        • langestL
                          langest
                          last edited by

                          I wrote a server to deliver your stats, so now you can get them in your browser on your PC or on your phone.
                          Currently looks pretty ugly since I haven't put any effort into that yet. But most of the functionality is there.
                          If you want to test it out, install it by cloning the repo and run pip3 install . --user and start the server with retro-stats-server. Using your browser go to <retropie_ip>:5000.

                          PC:
                          barchart.png
                          heatmap.png

                          Phone:
                          phone-bar.png
                          schedule-phone.png

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.