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

Completed X of Y is not yet implemented #125

Open
5HT2 opened this issue Mar 12, 2022 · 10 comments
Open

Completed X of Y is not yet implemented #125

5HT2 opened this issue Mar 12, 2022 · 10 comments

Comments

@5HT2
Copy link

5HT2 commented Mar 12, 2022

image
image

@5HT2
Copy link
Author

5HT2 commented Mar 12, 2022

Update: I've now spent three hours trying to get anywhere with this issue and I can't get anywhere useful.

What I've figured out

  • The "progress" of achievements is stored as a stat
  • Games are somehow able to keep track of this with something called a "progress stat" that's attached to the achievement, documented here.
  • I assume there's a special IPC call or something that allows you to get more detailed information about achievements
  • I have not been able to find any documentation that even tells you what IPC codes to use when interacting with the client.

@PaulCombal where did you get GET_ACHIEVEMENT_STATS from? That would be the next step for implementing this

@PaulCombal
Copy link
Owner

PaulCombal commented Mar 12, 2022

Hello,

This feature was just never implemented, it's not broken.

On another note, I'm very glad you're looking into the code and willing to contribute! Have you read the few documentation I've left in the doc folder? As a reminder, it can be found online here and will answer most of your questions.

You have found the documentation for the web developer API, which SamRewritten does NEVER use. It uses the steamworks C++ API, as described in the documentation.
EDIT: my bad this is the right one, but just the overview

As for GET_ACHIEVEMENT_STATS, can you please link a Github file/line reference?

Thank you, and let me know whether you missed the doc or if it is just unclear

@5HT2
Copy link
Author

5HT2 commented Mar 13, 2022

As for GET_ACHIEVEMENT_STATS, can you please link a Github file/line reference?

Sorry, I typed the issue from memory, I meant to say GET_ACHIEVEMENTS.

I was referring to

std::string response = m_ipc_socket->request_response(make_get_achievements_request_string());

Specifically the make_get_achievements_request_string() bit.

@5HT2
Copy link
Author

5HT2 commented Mar 13, 2022

Thank you, and let me know whether you missed the doc or if it is just unclear

Your documentation is just fine, I'm struggling to find Steam's own documentation for it's available IPC requests / responses.

@5HT2 5HT2 changed the title Completed X of Y is broken Completed X of Y is not yet implemented Mar 13, 2022
@PaulCombal
Copy link
Owner

PaulCombal commented Mar 13, 2022

Don't you have your IDE set up to get to declarations to have something similar to this:

image

You can follow everything to its declaration this way. I'm not sure what you don't understand here so I'll give a little context. This line is the client asking the "server" to send back the achievements and stats. make_get_achievements_request_string() will produce a string, just like a plain HTTP request in traditional web. request_response sends this string over to the server, which returns a response, also as a string. Both the request and response are JSON formatted strings.

If you want to fix the issue, I think you should better focus on "server" code.
I do not think Steamworks provides a way to figure if an achievement is linked to a stat (I've only reread ISteamUserStats), so my best bet would be to dig around the file parser to see if there is any extra info in the "cache" files.

Also, if you do not have a clear understanding of the steamworks API, remember that there is a full app example included in the SDK zip, doc here.

EDIT: Apparently I also left comments in Actions.h detailing the format of the JSON ipc

@5HT2
Copy link
Author

5HT2 commented Mar 13, 2022

I do understand what it's doing. By "where did you get it from" I was wondering how you figured out that that's the string you need to use in the request. You're manually declaring GET_ACHIEVEMENTS in the headers, so it isn't being pulled from steamworks.

I do not think Steamworks provides a way to figure if an achievement is linked to a stat (I've only reread ISteamUserStats), so my best bet would be to dig around the file parser to see if there is any extra info in the "cache" files.

That's where I was at before, I was looking through the Steamworks sdk for any hint to that. Which file parser and which cache files are you talking about?

@PaulCombal
Copy link
Owner

Is this what you're talking about?
https://github.com/PaulCombal/SamRewritten/blob/master/src/types/Actions.h#L5
https://github.com/PaulCombal/SamRewritten/blob/master/src/types/Actions.h#L37

This is me manually defining a string and an enum.. All the IPC between the client process and server process has been written by me and another contributor. That means I wrote the instructions to send it, and how to react when it is received, this is all custom. Doing a simple Ctrl+shift+f on GET_ACHIEVEMENTS_STR gives you a great idea where it is encoded and decoded on both sides.

As for the parser, I mention it in the doc.

@5HT2
Copy link
Author

5HT2 commented Mar 14, 2022

Oh, I see. The entire parser and IPC wrapper you wrote flew over my head, that makes significantly more sense.

I'll take a look through more of the steamworks lib, what was the "cache" files you mentioned before?

@PaulCombal
Copy link
Owner

This is explained in the same paragraph I linked in my previous message. Maybe it needs more explanation: as far as I know, when Steamapi_init is called, steam caches a file about stats and achievements somewhere in your Steam folder. SamRewritten reads this file to extract some extra info.

I added a link to the parser implementation in the documentation.

@5HT2
Copy link
Author

5HT2 commented Mar 14, 2022

Ahh, thank you.

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

No branches or pull requests

2 participants