mmatyas / pegasus-frontend

A cross platform, customizable graphical frontend for launching emulators and managing your game collection.
http://pegasus-frontend.org
Other
1.28k stars 115 forks source link

Create a "view game achievements and progress" screen/menu/popup #36

Open nwildner opened 7 years ago

nwildner commented 7 years ago

I know this sounds silly, but it would be awsome if pegasus could handle the GetGameInfoAndUserProgress( 'user', game_id ); function from retroachievements API. Pressing a button could show earned achievements and total progress on that game :)

Login information is stored at /opt/retropie/configs/all/retroarch.cfg on RetroPie as an example.

mmatyas commented 7 years ago

Sure, a basic integration wouldn't be hard, I could imagine a profile page or even showing the user's feed. But for the games, Pegasus needs to match the platforms and games to the numeric ID used by retroachievements, and that likely can't be automated. But if there'd be a RA Game ID tag in the game list file, then yeah, it could be picked up and used by the frontend.

nwildner commented 7 years ago

Isn't the resolution between gameID, consoleID and game hashes(cause it have to checksum to see if it's not a "tampered" rom) handled by retroarch already(this thread)?

I'm asking this cause i'm no programmer, but i work with IT :)

Maybe cheevos.c could be of a help?

Thanks for your hard work on this amazing frontend

mmatyas commented 7 years ago

It seems to me that the game detection happens in the individual cores, not in retroarch. Looks like it just provides a common API for them. But anyway, Pegasus doesn't calculate file hashes during runtime (that'd have some performance cost), it just uses the existing game list files and assets. You may use it for managing PC games, or non-libretro emulators too, or have systems that use eg. directories as a game, not files.

What could accurately recognize a game, in my opinion, is a scraper, as it could calculate hashes, may already have a list of known games, and could add such IDs to the game list file.

cc @sselph

meleu commented 7 years ago

@mmatyas you can get the game id "on demand" using the ROM hash. This is the way RetroArch does.

ghost commented 7 years ago

Or if you know a bit of Python, you can study what @neilmunday did with the Pi Entertainment System (PES) GUI. Here is the source code if you want to dig through it.

mmatyas commented 7 years ago

Thanks! I'd still prefer if such mapping would be done by a scraper though, as it has direct access to the ROM files and can more easily find out the game IDs. Pegasus just shows the already found metadata, and while an on-demand ROM hashing could be done (including unzipping, skipping headers for some platforms, etc.), in my opinion it doesn't really worth it doing every time, when one could just store the ID in a file. Nevertheless, it's always useful to see how others handle it, so I'll take a look.

neilmunday commented 7 years ago

Hi. When PES runs its ROM scan, it calculates the Retro Achievements checksum of each ROM found for the systems that Retro Achievements supports. This checksum is saved in the PES database alongside the other meta data for a ROM. If a user has opted to add their Retro Achievements details to PES then they can opt to update their achievements from the PES GUI. For this scan the check sums in the database are used to look up the user's achievements from RetroAchievements.org. You may be interested in https://github.com/neilmunday/pes/blob/master/src/rasum/rasum.c which I created based on RetroArch's cheevos.c file. "rasum" is the program that PES uses to get the check sum for a ROM. Hope this helps.