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

Achievements not working "sometimes" #650

Open
JamesMcGhee opened this issue Oct 17, 2024 · 11 comments
Open

Achievements not working "sometimes" #650

JamesMcGhee opened this issue Oct 17, 2024 · 11 comments

Comments

@JamesMcGhee
Copy link
Contributor

We are seeing features related to achievements work sometimes and not others

For example, getting the number of achievements, reading achievement names, setting achievements, etc.

Sometimes it works, sometimes it doesn't
This is definitely something with Steamworks.NET or at least the latest version of Steamworks SDK as it works in Unreal which uses the SDK directly and doesn't seem to have any issues working with stats and achievements but in Unity which is running under Steamworks.NET its very hit or miss. ... mostly miss

No errors by the way
for example when requesting the number of achievements it just returns 0 ... even for Spacewars which we know has achievements

@JamesMcGhee
Copy link
Contributor Author

We have confirmed with other users that rolling back tot he 1.59 cycle seems to correct/avoid the issue ... as noted else where

Workaround?

Not tested but if the issue is a bug either in Steamworks.NET or Steamworks SDK 1.60 or there abouts you could avoid it by rolling back to 1.59

Doing that is easy and no it wont break anything with our tools ...

Solution

DO NOT USE STEAMWORKS.NET 20.0 OR SIMILAR THAT IS FAR TO OLD

You DO want to use Update to Steamworks SDK 1.59 which you can access via GitHub History
https://github.com/rlabrecque/Steamworks.NET/tree/078ed3c7c9b767a42be555b75ea5fb014c067132/com.rlabrecque.steamworks.net

Just click the link below
To save you time and reading ... just click this link
https://github.com/rlabrecque/Steamworks.NET/archive/078ed3c7c9b767a42be555b75ea5fb014c067132.zip
It will download a zip containing Riley's repo during his 1.59 update before this issue was introduced but after the security patch for initialization and authentication changes

But it says v20.2.0

Ignore the string as it appears in Unity Package Manager ... that is just reading a string in the package.json which wasn't updated very frequently and so basically means nothing 😁 at least for that state of the code. The real info about what code your using is GitHub History. As you can see from the links, the link I gave is the check in Riley did for Steamworks SDK 1.59

@JamesMcGhee
Copy link
Contributor Author

JamesMcGhee commented Oct 24, 2024

I think it might be handy at this point to have 2 branches

Master & (Test, Smoketest, Preivew, whatever you want to call it)

1.60 shouldn't be on the master it has a few issues
1.59 is solid

Its not hard to go back and get the history but its a step to far for so many that just assume its all broken and throw the baby out with the bathwater.

I think it could save you @rlabrecque a lot of headaches if you did your work on "Test" or whatever you chose to call it let your active community work it over for a bit before you merged it with Master (periodically) this
Most if not all of your casual users will just use master and this approach would keep master more "stable" by affording some community testing time before it got to master.

I could even build a simple little Unity Editor script so a user could choose which they wanted to import "Master (more stable)" or "Preview (bleed edge)" or however you wanted to label them

I could add in easy links to bring them here to your Issues list for feedback and bug reporting and I could add a link to ro your GitHub Sponsor so they can find that ... I know many are so challenged with finding that link

If that's of interest let me know, I could work it up fairly quickly I think
would need the two branches set up ahead of time so I know their URLs

@rlabrecque
Copy link
Owner

In the meantime could I tag which ever the last version pre-1.60 is? What should I tag it as?

@AnEmortalKid
Copy link

AnEmortalKid commented Oct 25, 2024

What should I tag it as?

1.59.1 maybe (use the patch option to call out there's a "bug fix" even if the fix is just reverting some version)

@JamesMcGhee
Copy link
Contributor Author

Aye we have been putting people onto 1.59

Link to our "Known Issue" article that talks about the same and gives them a link to DL your 1.59 update you did
https://kb.heathen.group/toolkit-for-steamworks/unity/known-issues

@ZoopTEK
Copy link

ZoopTEK commented Oct 27, 2024

I am unfortunately unable to get any of these workarounds to work.

I am specifically seeing the inability to consistently access Steam stats. Since I have stats that even track fun silly things like distance traveled, it pretty much halts all development, short of "temporarily" removing Steamworks.NET and/or stats from the game entirely.

  • Tried reverting to the last major version, https://github.com/rlabrecque/Steamworks.NET/releases/tag/20.2.0, and it also fails to access stats.
  • Tried downloading and manually copying in the com.rlabrecque.steamworks.net folder into the project, and it also fails to access stats.
  • Tried downloading the ZIP everyone is referencing above, https://github.com/rlabrecque/Steamworks.NET/archive/078ed3c7c9b767a42be555b75ea5fb014c067132.zip, and copying the com.rlabrecque.steamworks.net folder into the project, also failed to access stats.
  • I did really silly things like using the package manager versions, but then copying the contents of the recommended ZIP's com.rlabrecque.steamworks.net folders into them, still unable to access stats.
  • I restarted after each of these installations as well, to ensure it wasn't a steam_api DLL loading issue; also didn't make a difference.

My only theory is that it's as if the steam_api DLL is somehow always using 1.60, but I don't see how that's possible if I'm downloading the recommended ZIP which is based on the commit for version 1.59. Any ideas what else could be causing such stat issues?

If this is a widespread problem, should version 1.59 become the primary version for a while?

@JamesMcGhee
Copy link
Contributor Author

@ZoopTEK
As I noted you do not want to use 20.2 the tags are far out of date

Also I DO NOT recommend you copy the com.rlabrecque.steamworks.net folder into your project you would be MUCH better off using UPM to add from Disk

To do that

You would download that zip and extract it

Or just use Git to get that change set whatever suits you

Then using Unity Package Manager click the + button and select "Add from Disk" now browse to the com.rlabrecque.steamworks.net folder and select the package.json that is in it

This will cause Unity to import it as a package
It being a package is required when using various tools built on top of it so this is the preferred method for Unity devs

I think your issue is that you have a very dirty little project now :)

So I suggest you fully remove Steamworks.NET from your project
To do that delete it from your Asset folder
Remove it from your Packages
Make sure you remove it from the Library Packages if its there

Once you have cleaned your project

then

Download the zip as noted above
Extract it
Using Unity Package Manager click the + button and select Add from Disk
in UPM Add from Disk browse to the com.rlabrecque.steamwroks.net folder and select the package.json within it

This will cause UPM to import that asset as a local package

This has worked for the devs in our community and there are a ton of them so I know this does work around the issue when its installed clearly hence I think the issue you have is that its not installed cleanly

@JamesMcGhee
Copy link
Contributor Author

JamesMcGhee commented Nov 6, 2024

Just a quick update

We are seeing a similar issue using the 1.59 now

public static string[] GetAchievementNames()
{
    var count = SteamUserStats.GetNumAchievements();
    var results = new string[count];
    for (int i = 0; i < count; i++)
    {
        results[i] = SteamUserStats.GetAchievementName((uint)i);
    }
    return results;
}

This code is returning no strings even on 480 which we know has achievements
This same code has been working for about 8 years now and it all of a sudden ... sometimes works ... but offten returns empty

So is this a fundamental change from Valve?
It seems the SteamUserStats.GetNumAchievements() returns 0 a lot of the time but not all the time

@rlabrecque
Copy link
Owner

This is after you get back the initial UserStatsReceived_t for sure?

@JamesMcGhee
Copy link
Contributor Author

JamesMcGhee commented Nov 12, 2024

Yes
On initialization, we get the UserStats and we know that is fine as we are able to set stats, read stats, etc.

But we are consistently getting 0 back on the count.

Originally we only had that issue on the latest, but now it does seem to affect 1.59 and again intermittently but typically is

Just to triple I printed out the EResult from the User Stats response and then got the count ... this is on 480 ... the count is 0 ... it should be 5
image

Here is our full set of logged messages
image

Note that this same code has been driving for more than a decade :)
It's behind a couple hundred games and hasn't had any change recently.

So it should be rather robust ... that or we have just be stupidly lucky lol

@JamesMcGhee
Copy link
Contributor Author

Any movement on this
still comes up and is still very much an intermittent thing ... that is sometimes it returns 0 and some times it returns the expected count.

Steamworks in general seems a bit wonky here lately, from Valve that is not just Steamworks.NET implementations. We have seen issues with the callback in overlay-activated act-up on Steam Deck which of course effects getting verified ... that turned out to be a them issue ... we have tried to raise it in the wider community (Steamworks Dev forum, with our own community encouraged people to raise it with Valve support) but as far as I can see this is still an issue

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

4 participants