xenia-project / xenia

Xbox 360 Emulator Research Project
https://xenia.jp
Other
8.3k stars 1.14k forks source link

Local Achievements support ? #2083

Open sidevesh opened 2 years ago

sidevesh commented 2 years ago

Validation

Describe what's going wrong

Would it be possible to add support for saving the achievements unlocked locally, and maybe show a pop up when it is unlocked? This would be similar to how RPCS3 maintains local achievements, and this would allow launchers like Playnite to show the achievements. Maybe just saving unlocked achievements would be a good start and the pop up can be a separate issue.

Describe what should happen

Have a local list of unlocked achievements across all games.

If applicable, provide a callstack here, especially for crashes

No response

If applicable, upload a logfile and link it here

No response

Gliniak commented 2 years ago

There is unofficial support for achievements however it still requires some/a lot of work. https://github.com/Gliniak/xenia/commits/stfs_profile_achievement_support Thanks Emoose for most of this code.

Additionally saying "Achievement support" is quite vague in terms of what is to implement.

It would be great to implement them as it should be with support for profiles (GPDs are stored in profile file), but that step is most difficult. I don't have much experience with it yet, but for whatever reason mounted profile starts being corrupted more and more as changes are stored. It might work for like 25 games and then disappear.

In my opinion without profile support achievement support is quite useless. There is no profit of having achievements in account that isn't personal and in form that doesn't match what console does.

chris-calo commented 2 years ago

@Gliniak probably been suggested before, but what if RetroAchievements was used as the aggregator? Doing so would allow for out-of-the-box integration with a lot UIs/launchers/front-ends, including LaunchBox/Big Box which is quite popular. I can imagine the integration would be quite simple too, as the games on Xbox 360 are the ones driving the event triggers for achievements, as opposed to having to introspect direct memory like other RA implementations.

AetherSX2 is a standalone PS2 emulator (ARM-based) that implements this sort of functionality, without the need for RetroArch (unlike other RetroAchievements implementations). Could be useful as a reference?

CHESIRE721 commented 2 years ago

@Gliniak have a weird idea, but i would like to make it known (i know it will sound ridiculous), considering that you mention that the achievements are linked to a profile and this profile is used locally, why not use an emulator that handles this data, for example, why not combine a steam emulator called goldberg emu or at least add the functions that this emulator developed (this emulator is open source), it has a support to create a user profile with a specific id locally, but I mention it because this emulator allows to get achievements locally because steam manages its achievements in a file called "UserGameStatsSchema_(id_game). bin" which contains what would be the data of each achievement, from this file you can dump the data to a file called achievements.json from which depending on how your achievements have been designed we could obtain 2 schemes of achievements that are by triggers or by statistics, of which I can give an example of how are your schemes

achievements by triggers: { "name": "ACHI_001", "defaultvalue": 0, "displayName": "BFA", "hidden": 0, "description": "unlocked ALL!", "icono": "images\ACHI_001.jpg", "icongray": "images\ACHI_001_gray.jpg" }

achievements by statistics: { "hidden": "0", "displayName": "BFA", "description": "unlocked ALL!", "icon": "6a05b669c14009ded04916a69d7646baf911d5e8.jpg", "icon_gray": "8afadeb4b49d560605f0785df766eae1172af5f9.jpg", "name": "ACHI_001", "progress": { "min_val": "0", "max_val": "1", "value": { "operand": "statvalue", "operand1": "STAT_001" } and when an achievement is unlocked this is stored in a specific directory where the achievements obtained are stored in this way: by triggers }, "BATTERING_RAM_ACHIEVEMENT": { "earned": true, "earned_time": 0 }, for statistics }
"BEGINS_WITH_ACHIEVEMENT": { "earned": true, "earned_time": 0, "max_progress": 80, "progress": 60 }

maybe it is possible to dump the achievement scheme of xbox 360 games with a similar scheme to be able to make use of this feature and unlock achievements locally. I know it's complicated to take this opinion into account, but it would be an idea for Xenia to be able to get achievements.

Gliniak commented 1 year ago

After a bit of consideration I agree.

It would be nice to already have at least basic achievement support + some external storage for them. What I mean by that.

In ideal world:

Issues:

w400pedro commented 1 year ago

@Gliniak Hmm... idk if this idea keeps going, but the RetroAchievements site should be a good place to store the achievements externally, and would be a great addiction to the site.

chris-calo commented 1 year ago

@Gliniak @w400pedro yeah, RetroAchievements to me seems like the perfect place. Awesome uptime, free-hosting, leaderboards, good community willing to help build out data, the works. It's a no-brainer.

Gliniak commented 1 year ago

It's WIP but slowly, due to many circumstances

w400pedro commented 1 year ago

Got it, really good to know that the project keeps going, I know that's not an easy task, I'll be waiting :) take your time

wescopeland commented 1 year ago

RetroAchievements has recently released an emulator integration guide that may be helpful: https://github.com/RetroAchievements/rcheevos/wiki/rc_client-integration

BrightEmber commented 1 year ago

Also underrated is that so many official Xbox 360 achievements are completely unattainable by default, or due to online being deprecated. RetroAchievements is a solution to that due to being community maintained perpetually. I do have to praise the service, and I hope you'll consider it. Either way, I look forward to seeing what comes of this c:

chris-calo commented 1 year ago

@BrightEmber I think those could be safely ignored and/or RetroAchievements has a way of handling the tagging of those in their data structures. Best bet would be to either:

  1. Have a community table for folks to flag achievements as unobtainable given the current state of a game (RA also has support for this, as I recall without the need of a separate spreadsheet).
  2. If ever possible to, say, have community run servers for Halo 3 or whatever the achievements can be achievable or enabled (if disabled in 1 above).

TLDR: it may annoy some completionists that they can't 100% achievements on an Xbox 360 emulator. But, if a blocker to having achievements at all vs not, it could be a non-issue. I suggest we look at how RPCS3 is handling this same issue for their online-only achievements.

wescopeland commented 1 year ago

I can speak as an achievements developer on RetroAchievements: we would likely go the route of creating entirely new achievement sets for all the games theoretically that would be playable using Xenia. Perhaps it would be possible to leverage the built-in achievement triggers in the games to avoid doing a lot of extra work, but oftentimes the official achievements sets were so low quality that we can produce something better with a little bit of elbow grease.

This is a process that involves finding the relevant addresses in the game's memory using our debugging tools (aka https://github.com/RetroAchievements/RAIntegration) and then coding all the conditionals required to trigger the achievements.

PCSX2 recently also did a RetroAchievements integration, which may be helpful to reference.

iTzAnDw commented 1 year ago

So am i the only one that don't know how to download the gliniak xenia?

Gliniak commented 1 year ago

Achievement support is not yet available. There is one branch on my fork that allows them, but it's quite old build of Xenia and it's a bit unstable. It can break profile package. Plus it doesn't contain integration with RA at all. Basically it is deprecated

Razzile commented 1 year ago

I think the retro achievements conversation should be spun off into its own issue as this one was originally intended for handling achievements locally.

sidevesh commented 1 year ago

I agree, while custom set of RA achievements would be great, I think the official achievements need to be atleast recorded to a file locally first, given XBox 360 already has achievements that in Xenia is just going without any use. Once storing locally is figured out, pushing those somewhere could be considered. Displaying those locally store achievements in a window could then be another issue of its own.

BrightEmber commented 1 year ago

RetroAchievements issue is now separate as suggested by Razzile, to prevent clogging up this thread: https://github.com/xenia-project/xenia/issues/2219

sidevesh commented 1 year ago

Now that RA discussion is spun off, can the branch which has achievements support be updated and brought in ? Getting it merged even without a UI to show the achievements would be enough to begin with since buiding a simple UI to show achievements could be a simpler PR someone can work on (I can look into it too). Also we can then start a discussion to integrate those achievements in other launchers like Playnite, which is ultimately what I wanted since it tracks achievements from all platforms and other emulators too.