hascheevos.sh - a tool for RetroPie/RetroAchievements users
-
Hello friends.
I've been working on a tool that can be useful for RetroPie/RetroAchievements users...
[If you don't know what RetroAchievements are, take a look here.]
Any RetroAchievements user probably faced the situation of loading a game and becoming intrigued "why it didn't load the Achievements List if I'm seeing achievements for this game on RetroAchievements.org website?". To (partially) avoid this confusion, I've made a tool to check if a ROM is OK for cheevos.
You can find it here: https://github.com/meleu/hascheevos
Instructions on how to install and use it can be found in the repo's README. But I would like to highilight a very useful feature of the script for us, RetroPie users...
You can create a custom collection for each supported system (namely:
megadrive
,nes
,snes
,gb
,gbc
,gba
,pcengine
,mastersystem
andn64
), and each collection having only games that have cheevos. Pretty cool, huh? :-)Here is the command to do the trick:
hascheevos.sh --collection --system all
Depending on how many ROMs you have this command may take a few minutes.
After the script finish, restart EmulationStation, press
Start
to access the MAIN MENU and then go to GAME COLLECTIONS SETTING -> CUSTOM GAME COLLECTIONS and enable the achievements collections you see in the list.Now you have one custom collection for each system that supports RetroAchievements and populated only with your games that have achievements.
Notes:
- The custom-collection feature was implemented in EmulationStation 2.6.0.
- More info on how to use ES custom collections can be found here.
- Many thanks to @pjft for implementing such a cool feature in ES!
Tagging guys that may be interested:
@pjft @cyperghost @lilbud @mediamogul @edmaul69 @Sano @grenade44 @hansolo77 @R1n0X @cabrunco @muehltime @orymer @backstander @fun4stuff @Trotts @Keysersoze77 @PokeEngineer @robertybob @TuffCutter @LiveFastCyYoung @Lodan-Zark -
That is a nice workaround for me and everyone else, since the Achievements PR for ES didn't get accepted. But, it is a shame that it didn't...
-
Nonetheless, this is pretty cool!
-
@pokeengineer next step: create a frontend for the script and make it usable with a joystick. Just like those RetroPie-Setup dialogs.
-
Glad to hear this approach works and that you're happy with the outcome. Great work!
-
@pjft Good morning ;)
Well the collection IS one of the milestone in ES development.
Thank you very much.@meleu
For the GUI ;) I have some suggestions :)
A enable/disable feature for connecting to the server (let's call it private mode) - like done here and additional hardcore mode on/off ;)What do you think?
-
I'm going to play around a bit with this... quick question. Does this generate a custom collection for EACH system, or one BIG collection? I'd like to see a BIG collection (because I'm lazy and pick a game at random pressing the X button ^_^). If that's not an option, could you maybe implement that as a request? :)
-
@hansolo77 ok. I'll implement that option soon.
-
@meleu Awesome! That way I can still use the "achievements" system logo @TMNTturtlguy created for me too. :) Maybe you can include a switch option in your GUI for it, so a future user can pick which version they'd like to install.
-
@hansolo77 I've just added the feature you requested. If you already have the tool, perform an
--update
to get the new feature.To achieve what you want you need to perform this command:
hascheevos.sh --single-collection --system all
EDIT: the resulting file will be
~/.emulationstation/collections/custom-achievements.cfg
.I tested a little and everything seems to be fine. Let me know if you find some problem.
About the GUI, I think it will have a little more time to appear. I need to rest a little with all this coding and start to play something (let's hunt some cheevos!). But OK, I've got your suggestion! ;-)
-
I haven't updated the tool since it was in the infant stages. I will actually work on testing/etc in a couple of days. Unfortunately, my free time today is all used up and I'm back on "work" mode. I do have some free time AFTER work though, so I might find some time tomorrow to test. :)
** EDIT **
I just started fresh and re-installed the tool and made it. Quick question, you don't have it documented. Do we still need to pass the RetroAchievments username and password in the execution, or write it inside thehascheevos.sh
script? -
@hansolo77 said in hascheevos.sh - a tool for RetroPie/RetroAchievements users:
Do we still need to pass the RetroAchievments username and password in the execution, or write it inside the
hascheevos.sh
script?No need to edit the script at all.
You only have to provide username/password under some conditions. The script will complain if it needs the account data and they aren't provided
By the way, the README was updated accordingly. -
I finished through a "scrape" of my rom system and had it generate that "all-in-one" collection. I restarted ES and enabled it in the Custom Collections menu. It seems to have worked partially. My list using the old method (scraping each system manually, then running the script to create a custom collection from it) generated a list of 1426 games when I did it a month or so ago. Using the new method, it only grabbed a total of 969 games. At first I thought at "well, some games probably got deleted from the RA server", but that's a large number to be missing. So I went back and checked a few games. RA's homepage shows that Friday the 13th (NES) is the current "Game of the Week". It exists on my old list but not in the new one. Something is screwy there. Also, when I go through the NEW list, a lot of the video snapshots aren't working and just show the JPG art instead, whereas the same game in the OLD list shows a video.
I will experiment more and give specific games tomorrow when I have the chance. It's like ALMOST there. :)
EDIT : I think the problem with the game list shortage is that ES is providing the list with only 1 interration of a game name. For instance, when I look at the contents of the cfg file it created, I have multiple entries for Final Fantasy II. I have the original NES version, a Translated NES version, an NES USA Prototype, and the SNES version. But ES only displays the game 1 time, even through the scraper found and added all 4 to the file. This probably happens many times throughout the gamelist and probably whereever there are multiple versions of the same game.
EDIT 2 : I need to do some more work it seems. I went into my ES settings and disabled the option "Parse Gamelists Only", then restarted ES. The NEW game list is now showing 1456 games. So now that's working. But now I have another problem. None of my GB and NES games are showing any metadata. Not sure what's going on there, and I'm way to tired now to mess with it anymore tonight. But I think I might have to rescrape my metadata. It looks like all your script does is check the hash and build the necessary list of games and their paths. So the changes @pjft did to get custom collections working is to have it parse the cfg with direct paths to them. If ES isn't displaying their metadata, it's missing altogether. I confirmed this by checking the regular NES gamelist and it's gone there too. A perfect system is so close though. :) That is, until the next big thing comes along that I'll want to add too.
-
@hansolo77 can you check the number of lines in the generated file, and/or send it over via pastebin?
I'm also not sure why it would have changed anything in terms of video vs image view. That should not be happening altogether, and if possible I'd like to see a video of it - one with the game in the original collection, with the video showing, and open the edit metadata menu for it, then exit it, and then one in the achievements collection, without the video playing, with opening the edit metadata menu as well.
You can do it with a phone, I just want to see if it's really going for the same file in ES.
Thanks.
-
@pjft I think the problem might be a corrupting SD card. This is the same card I've been using ever since I started my project. That includes all of my original build work, then the adding of video snaps, updated metadata, then the white screen fix, then the Mausberry Shutdown Switch fix, then the Achievements and Custom Collections. The testing of the shutdown scripts for metadata saving was intensive, and a lot of the time my system hung or crashed, resulting in my "pulling the plug" because the shutdown wasn't working. To that end, I think parts of my SD card may have been damaged. Prior to testing out this new cheevo script, I went to shut down my system to make a backup, just like I do any time I go to change things. Well, there was a screensaver running, I pushed the power button and waited. Nothing happened. So after a few minutes I just pulled the plug. When I connected the SD card to my computer for backing up, it offered me the option to FIX it (corrupted data). I chose not too because in my experience, Windows can't really fix a Linux partition with chkdsk. When I booted everything back up the first time, ES was reporting (in the terminal window after exiting) that it was unable to parse the NES game list. When I checked the file via SFTP, it had created a blank
gamelist.xml
and renamed original asgamelist.old
. No really knowing what was going on, I just erased the blank one, and renamed the old one back to the correct way. Rebooted, ES was happy, NES gamelist was working correctly, etc. I then scraped with the cheevos script. Then, following instructions, I rebooted. The cheevo custom collection was there, but none of the NES games had working videos or art (metadata). Everything else was fine, and I didn't think twice about it. Then I noticed the shortage of games compared to the old cheevo list. That's when I tried turning off the "only parse game lists" switch in ES. Once I did that and restarted ES, the games all displayed correctly, although the metadata is still now showing. I think the root cause of the problem is the corruption from before, and possibly the original NES gamelist is bad. So I'm in the process now of re-scraping a new NES gamelist and will see if the results are better afterwards.Long story short - I'm re-scraping a new gamelist because it got f*ed up. :)
-
Apologies, I haven't logged in for a couple of weeks, I will try my best to check this out :)
-
@meleu It's been about a month, and I decided to do a rescrape with the hascheevos script. I first ran with the
--update
flag to get the latest version. Then started the full scrape to collections. It went through just fine. But when it completed, I was presented with the same list (same number of games) I had before. I thought maybe it just needed to refresh the list so I rebooted the Pi. Still nothing new. Surely there have been more games added in the last month. Does the script not overwrite the previously existing collection file? Do I need to run this outside of ES (I was actually playing a game during the entire scrape). Have you noticed anything like this in your tests? -
@hansolo77 I suspect you're seeing your own custom collection lists and not the new ones generated by the script.
Please, try to go to
main menu -> game collections settings -> custom game collections
and see if there are new collections namedACHIEVEMENTS {SYSTEM_NAME}
. -
When I look at my available Custom Collections, it only lists the 1
ACHIEVEMENTS
(remember, I'm using the single collection list, not split). When I SFTP into the Pi, I have a file namedcustom-achievements.cfg
andcustom-achievements.cfg.old
although I think the .old was one I had made before using your updated script. The date on the new one is correct though (11/132017). So it did build a new one. There must not be any new games... Or does your Github repository of the hashes need updated? Watching the scrape, it looks like the first thing it does is download the hashes locally to my Pi, it that correct? -
@hansolo77 please, execute the command below:
bash -x ./hascheevos.sh --collection "~/RetroPie/roms/nes/CONTRA ROM FILE NAME.nes" 2> debug.txt
It'll generate a file named
debug.txt
. Please post its content in codepad.org.
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.