Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Track Play Time #18410

Closed
2 tasks done
djlain opened this issue Nov 11, 2023 · 7 comments · Fixed by #18442
Closed
2 tasks done

[Feature Request] Track Play Time #18410

djlain opened this issue Nov 11, 2023 · 7 comments · Fixed by #18442

Comments

@djlain
Copy link

djlain commented Nov 11, 2023

What should happen

It would be very useful if ppsspp can track play time for each game. It can be displayed when people select a game, or on the game info page. For example:
202311112232361
20231111223220

Looking forward to seeing the function if possible, thanks very much!

Who would this benefit

People who want to know how many hours they've spent on certain games.

Platform (if relevant)

None

Games this would be useful in

All games

Other emulators or software with a similar feature

In PCSX2, play time was displayed on the pause menu (upper right corner):
PCSX2 Nightly - v1 7 5095 2023_11_11 22_41_30

In Retroarch, play time was displayed on the game select screen:
60 04 2023_11_11 22_43_53

Additionally, if you're using Retroachievements, it will show the current play time when you master a game, which is also very cool:
RetroArch Beetle Saturn v1 22 2 f509c39 __ FPS_ 197 54 2022-12-09 08-33-54 mp4_20231007_132836 285

Checklist

@hrydgard
Copy link
Owner

hrydgard commented Nov 11, 2023

I suppose this could be cool.

This would be global for each game, so if you play on multiple saves, it would simply be the total time played regardless of current progress or player etc.

Design issues:

  • Where to store the data? We could simply have a section in ppsspp.ini looking like this:
[TimePlayedSeconds]
ULUS12345=1321
NPJH00001=4593

It would grow as you play more games but not really a problem. Or we could have a separate ini file.

Some players would like to transfer their play times between systems, they'd have to manually copy the ini file entries since we still don't have any kind of cross platform sync, see #1019 .

How does PCSX2 save the times?

@hrydgard hrydgard added this to the Future-Prio milestone Nov 11, 2023
@djlain
Copy link
Author

djlain commented Nov 11, 2023

Thanks very much for quick replying! PCSX2 save the times in a similar way, by a separate file called "playtime.dat" in the "inis" folder, it's like this:

SLPM-65358                       5057                 1699377967          
SLUS-21216                       119                  1670548388          
SLUS-21672                       104                  1670548514          
SLUS-20916                       20                   1670558736          
SLPM-66930                       167062               1699470236          
SLPM-66742                       21275                1699470437          
SLPM-65593                       93                   1696958126          
SLPM-55117                       25                   1696958165          
SLPM-55221                       88                   1696958285          

The 2nd column was time played seconds.

@hrydgard
Copy link
Owner

hrydgard commented Nov 11, 2023

Makes sense. Just curious, what's the third column? Some kind of integrity hash to prevent trivial tampering?

Also some more potential questions:

  • How should playtime be counted during fast-forward / "slow-forward"?

@djlain
Copy link
Author

djlain commented Nov 11, 2023

I'm also curious about the third column but unfortunately did not find any info about it yet...

And about slow / fast forward (and even frame forward or something), they did not matter in all my mentioned emulators, so only real time will be tracked. And when people pause the game by press esc (or other pause button) , play time will be paused as well.

@hrydgard
Copy link
Owner

Hm, the last column there are unix timestamps, it turns out. Maybe just recording the last time the game was played.

@djlain
Copy link
Author

djlain commented Nov 12, 2023

Thanks for the explaining! Just found PCSX2 also displayed the play time and last played time when you select a game on the big picture mode:
PCSX2 Nightly - v1 7 5095 2023_11_12 17_35_15

Never used this mode before so I missed it.

@hrydgard
Copy link
Owner

Ah, that makes sense!

Yeah, I guess that's pretty neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants