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

Retroachievements support (work-in-progress) #17589

Merged
merged 41 commits into from Jun 26, 2023

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Jun 17, 2023

Implement RetroAchievements support (#16169). Not to be confused with RetroArch, these are two different projects.

Most of RetroAchievements.cpp was adapted from DuckStation's integration by @stenzek.

So far, login works (unless you're on a touchscreen device), game identification and basic achievement listing works, and unlocking achivements works.

TODO list before initial merge:

  • Login UI, basic settings
  • Proper achievement listing UI from the pause screen
  • On-screen notification UI for unlocks
  • Fix the game hashing so it can work with scoped storage
  • More secure login token storage
  • Fill in the remaining translation strings in en_US.ini (will add actual translations in the next PR)

Next steps after this:

  • Leaderboards UI
  • HTTPS support (we force HTTP because our client implemenetation lacks ssl support)
  • Challenge mode (disable savestates etc)
  • Juicy sound effect for unlocks
  • Other missing features

@hrydgard hrydgard added the User Interface PPSSPP's own user interface / UX label Jun 17, 2023
@hrydgard hrydgard added this to the v1.16.0 milestone Jun 17, 2023
@hrydgard hrydgard marked this pull request as draft June 17, 2023 09:50
@cannnAvar
Copy link

How we can use achivements now

@hrydgard
Copy link
Owner Author

Stay tuned, it's not ready enough yet.

@hrydgard
Copy link
Owner Author

Rebased on top of #17594 .

@stenzek
Copy link

stenzek commented Jun 18, 2023

Got pinged about this, please maintain my copyright notice in DuckStation-derived files (and add your own, obviously), thanks.

Also, feel free to relicense those files to GPL2 to match the rest of the emu if that makes things easier (in DS it's GPL3).

@hrydgard
Copy link
Owner Author

@stenzek will do, thank you!

@hrydgard hrydgard mentioned this pull request Jun 18, 2023
@hrydgard hrydgard force-pushed the retroachievements-initial-work branch 2 times, most recently from 8f113fe to 58e9afd Compare June 18, 2023 14:06
@hrydgard hrydgard force-pushed the retroachievements-initial-work branch 2 times, most recently from cb0d65f to ca82a6a Compare June 21, 2023 10:18
@hrydgard
Copy link
Owner Author

hrydgard commented Jun 21, 2023

Progress report: You can now login through the UI, and play and get achievements, and you do get nice little popups with achievement icons and text when you do. There is also an achievement list on the pause screen, if achievements are enabled for the game. Logging in works on all desktop platforms currently - or if you have a physical keyboard for your phone somehow. This will of course be fixed soon.

I'll do a more general fix for text input UIs on master soon, then bring it into this PR.

EDIT: Confirmed working fine on Android except a weird centering issue, the code updates are coming soon.

@hrydgard
Copy link
Owner Author

This is starting to get usable now, opening for review, but don't merge until the below is solved:

I think we should probably store the RetroAchievements login token somewhere slightly more secure than in PPSSPP.ini, it's too easy to accidentally leak your token while sending that file in for debugging or something.

On Android we'll just store it in a file in the app private directory.

On Windows, Mac, Linux, I'm thinking just store it in a separate file in the home directory somewhere?

@hrydgard hrydgard marked this pull request as ready for review June 22, 2023 07:34
@hrydgard hrydgard force-pushed the retroachievements-initial-work branch from 9242066 to ee30ce5 Compare June 22, 2023 08:27
@Captainquill
Copy link

Hello sir.. When will this be ready to download. Just a tentative release Window.?

@hrydgard
Copy link
Owner Author

Next week it will be in the "nightly" builds.

@anr2me
Copy link
Collaborator

anr2me commented Jun 25, 2023

Hello sir.. When will this be ready to download. Just a tentative release Window.?

Currently you can also download the artifacts from https://github.com/hrydgard/ppsspp/actions/runs/5360144898?pr=17589 if you want to test it.

@hrydgard hrydgard force-pushed the retroachievements-initial-work branch from 37a557c to 4134acc Compare June 26, 2023 08:02
@hrydgard
Copy link
Owner Author

Should be ready for initial review/merge now.

@hrydgard
Copy link
Owner Author

hrydgard commented Jun 26, 2023

Hm, actually need to clean up the choice of directory for secrets storage. It's not making good choices on some platforms.

@hrydgard
Copy link
Owner Author

hrydgard commented Jun 26, 2023

Ok, I've been thinking about where to put the login token on various platforms. One idea would be the following:

  • Android: It clearly belongs in the app private data folder.
  • Windows: There are two cases here:
    • installed: %APPDATA%\PPSSPP ?
    • portable: memstick/PSP/SYSTEM , next to the ini (but not included in the ini file)
  • Linux/Mac: memstick/PSP/SYSTEM
  • iOS: ?
  • Switch: ?

However, after some chats I think I might be overthinking it. It's only really important to keep it out of the .ini as we often ask people to post that. But just putting the login token in a file next to the ini on all platforms may be good enough, really.

@hrydgard
Copy link
Owner Author

Alright, I think this is a pretty good checkpoint, and I'm just gonna get it in and work from that state.

@hrydgard hrydgard merged commit 01cf22e into master Jun 26, 2023
19 checks passed
@hrydgard hrydgard deleted the retroachievements-initial-work branch June 26, 2023 22:13
@hrydgard hrydgard added RetroAchievements RetroAchievements related work and removed User Interface PPSSPP's own user interface / UX labels Jun 27, 2023
Comment on lines +54 to +55
// for testing
std::string GetFirstIconName() const {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is for specifically, but it should be using lock_ in case someone starts calling it later.

-[Unknown]

Copy link
Owner Author

@hrydgard hrydgard Jul 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never used it for anything, I'll just delete it. Was gonna be used to test achievement popups without getting achievements.

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

Successfully merging this pull request may close these issues.

None yet

6 participants