-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information. #83
Comments
Copy the |
Manged to solve it by taking a leap of faith and uploading a depot to SteamWorks and it worked! Didn't have to copy steam_api.dll into the root. When I build the binary it ends up there anyway. So it looks like that error is what happens when you don't launch it from Steam? |
On another machine, The first time I launched the game from Steam I got the error.
Subsequent times, all good. |
I'm having this same issue in the Unity editor. How can you launch your game within the Unity editor and get support for Steamworks? Doesn't seem valid that you have to do a build to test the Steamworks functionality. Also, when I did the import of the Steamworks.Net unitypackage it didn't copy the dll's to the root directory (which I believe is now the correct process?) I have my steam_appid.txt file in my root directory and I updated the number. I've run DbgView and I don't see any output from Steam that would shed any light on what the issue may be. Unity 5.3.4f1 64 bit |
I've resolved the issue, I'll post in case someone else hits the same problem. The issue is because my app ID is for an unpublished app and my steamworks account is not the same as the account I log into steam on my desktop with, it means the API doesn't have permission to access the App ID. I resolved it by adding a permission for my desktop steam account within my steamworks web page and now it's working. This is probably obvious to most people! :) but if you're stumped like I was, then try this! :) |
I'm having a similar problem. When I run my game within Unity, DbgView reports that it's "unable to locate a running instance of Steam, or a local steamclient64.dll". But with a build (without a local steam_appid.txt) it works fine. I've got the steam_api64.dll in the root directory and I've tried it with and without the appid file, but it's the same result. What I find strange is that when I put the appid file in the build directory it creates the same problem when I thought you had to put it there to solve it. I have triple checked that it's got the correct id in it. |
Looks like I just had to run Unity as administrator |
@thestonefox Thanks for taking the time to post your fix. Was stuck for a few hours trying to figure what was the problem. Making sure the user logged into steam had permissions for the AppID did the trick. |
@Astiolo Did you ever find a better solution then running Unity as administrator? Seems bad to force a customer to launch the game as administrator every time they play the game. It is also quite annoying as a developer. I have the same issue on my Windows 8 machine using Unity 5.4.0f3. All my other computers don't have this issue. Edit: It might be worth noting that all my windows accounts are administrator accounts. |
@Tagette, The game shouldn't need to be run as admin, just Unity when you're running the game from within the engine. Really you shouldn't need to even do that but it solved the problem for me. |
How does your steam launch? Games should be running at the same process elevation as Steam, If Steam is being run as Admin then the Unity Editor will need to be as well. When you run stuff from Steam it will inherit the same elevation level as Steam itself so it will always work. |
@rlabrecque We have not been launching through steam but I imagine it would have the same issue because we don't have steam run as administrator. We run from the .exe and have the steam_appid.txt present. @Astiolo It seems we have different issues then. I'm using the same Steamworks .Net in Unity 5.1 and I don't have this issue running it on my windows 8 computer. However a different build running 5.4 fails to load the dll unless it is ran as administrator. |
@rlabrecque I have same issue Unity 5.3.6 OSX 10.11 |
Giving my alt account permissions solved the biggest problem I had, thanks! One thing of note - I had to manually copy steam_appid.txt to my build directory, and only then would it start up. Did anyone else have to do the same, or should Build be creating/copying the file to the root of the build dir? |
Hello. I have the same issue. How do you give "account permissions"? Is it to be setup in Steamworks or in Steam? |
This is done via one of two ways. A: Your account must be in your Steamworks partner group. Essentially it just means that your game should show up as playable in your Steam library. @gycot: |
I've tried everything in this thread and I'm still getting the same SteamAPI_Init() failed error... strangely it works if I replace my appID with 480 in the steam_appid.txt file (comes up as Spacewar, of course). Since that's the case it makes me fairly sure it something wrong with how I've got the app setup, but the user I'm logged in with on steam is an admin on the application with full permissions for everything... Does anyone have any other idea on what I might be missing? |
I am also experiencing this same issue. I've added my relevant steam accounts on steamworks in the "Everyone" group which should give them permissions on the app right? |
Having the same/similar problem. At this point I'm not entirely sure where the problem lies(Steamworks.Net, Steamworks SDK). Trying to get a Linux x86_64 build running for a headless server. Game is packaged as a dedicated server and deployed using
I can only guess it might have to do with not having a steam client running(I can't for a headless system) but steamcmd should have my credentials. Are there any logs anywhere on Valve's side that can be checked to see if there were permissions issues? Most of the suggested fixes here or elsewhere just don't work, including the official suggestion of symlinking The game is packaged with steampipe(ass a tool as described here on their partner site, which purposely includes Not really sure where to go from here, but would love some ideas. |
Looks to be the same problem with both |
we had to get help from valve to solve it... something was misconfigured on their end. |
@Nakano37 Could I ask what avenue you used to get support for that? They have pages on their site that specifically state that no support is offered for Steamworks SDK. |
Same issue here. Posting on the steamworks dev forum had someone at valve fix it. Our default app configurations were missing Get Outlook for iOS On Wed, Nov 16, 2016 at 8:58 PM -0500, "Mike Shultz" notifications@github.com wrote: @Nakano37 Could I ask what avenue you used to get support for that? They have pages on their site that specifically state that no support is offered for Steamworks SDK. — |
Posted on their developer group discussion forum, and after going back and forth with various people, eventually a valve employee answered and was able to look into it. |
I was entirely mistaken. On Linux, Now I just have to figure out which calls go with which. |
just to note here I was struggling with the same issue. The solution is to restart steam a few times. If it shows up in steam you should be able to play it. Also, I have to note here: I had no problem with a generated test key. |
Having the same issue. I added my steam app id to the file steamworks.NET created in the root of the project, restarted Unity and Steam multiple times, and I am sure my user has permissions to the steam app. |
Hey benmcnelly, have you tried using DbgView to see if Steam is providing and debug information? https://github.com/rlabrecque/SteamManager/blob/master/SteamManager.cs#L90 |
I'm getting a "SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient64.dll" error when trying to test Steamworks in the Unity editor. This occurs even when I used the default 480 app ID. Where is steamclient64.dll supposed to be located? I can't find a copy, although everything else seems to have been installed. |
It depends on what version of Unity you're on. On modern versions it just has to be next to CSteamworks.dll in the Plugins/x86_64/ folder, on older (<5.2 or so, give or take a version) it needs to be in the project root, NEXT TO 'Assets/', 'ProjectSettings', etc. What version of Unity are you on? The RedistInstall script should have copied it over for you automatically if it needed to. |
Thank you for your reply. A search of the Unity project doesn't find steamclient64.dll anywhere in the hierarchy, though (there are two folders with a similar name, but the file itself isn't there). Does it have to be downloaded separately? |
Oh sorry, I kind of misread that! The local steamclient.dll is only for dedicated servers. In most cases it's just trying to find a running steam client and failing. Valve's new documentation on SteamAPI_Init has better reasons for this. Does your game show up in your Steam library for example? |
Yes, it shows up in my Steam library. (and it offers to "download" it although there's no build on Steam - I was just running it in Unity's editor). It says I just "played" it today, so it's evidently able to monitor my usage of it. So what would be the cause of the error I was getting? |
It seems to be working now, for whatever reason. |
Same problem. In editor it works fine. |
@Suvitruf Did you end up solving this? |
If anybody else gets this error, you need to be logged into a Steam Account that has permission to play the game (if it is unreleased). Login to your Steam Client with the granted key (you can access the Beta branch and the app id etc). Then load Unity and it will connect. |
hi [Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information. What I can do? Please give me a suggestion, I need help to solve this issue. Thanks, advance. |
Both the steam_api.dll and the steam_appid.txt need to be in the same folder as the executable. |
Hi there so I'm running into an issue. When I make a development build, and open it from steam, my game works fine. When I make a release build, it suddenly stops working. The game still opens but the achievements are no longer popping up. Additionally, when my friends try to make a dev build on their computers, it simply wouldn't show up. Anyone run into a similar issue? |
I am having very similar issues. Running the game in the editor is fine, no errors. If I go "Build", I get errors. If I go "Build and Run", I do not get errors, and the game works. However, if I close the game, navigate to the .exe, then open it through Windows File Explorer, it crashes. Weird. Development build or non-development build made no difference but definitely weird stuff going on. Furthermore, when running inside Unity, I was able to get Steam specific information like my Steam ID and display name. In my case, my game is already released, and I am trying to set up cloud saves. It correctly grabbed my steam ID and made a new subfolder for that unique Steam user for the save data, while running in Unity. But as I said, builds crashed. The error was simply: I got the unity package from releases here: https://github.com/rlabrecque/Steamworks.NET/releases The instructions here: https://steamworks.github.io/installation/ I searched for the steam_api.dll file, it was in the plugins folder of the steam project, and manually added it next to the .exe file. It stopped some of the crashing in the game, ie, my menus loaded correctly, but the development build still produced the same error even with the .dll present: I find it incredibly strange that Build & Run works but Build doesn't. Because my game is released, it is in my library so I obviously have permissions. I am using Unity 2019.1.13f1 and have been afraid to upgrade as you know how Unity loves to break when you upgrade versions, so reluctant to do that unless it's a definite fix. I am signed in to Steam and online currently also. Considering the missing .dll, I am wondering if part of the issue is the unitypackage either not importing correctly, or some script is not handling the necessary .dll files correctly? To me that sounds the most likely reason for the errors, from what I can tell, but that single .dll file did not fix it, are there others I need? I am feeling it may not be something I did wrong. I did also update the appID in the txt file assuming I have the correct app ID, which I think I do. ** UPDATE ** In the off-chance that it's Unity version related, I'm going to try some different LTS versions of Unity and the latest version, just in case, with a backup of my project in GIT. Will update you of failure / success. ** UPDATE 2 ** I'm out of options, can't think of anything else to try. At least upgrading to 2020 didn't break the game, but 2021 stuffed up the main monitor to display the game. It didn't fix the Steamworks.NET error message either. I can't use SteamManager without crashing the game. |
I may have found a solution, for my case at least. Someone here said they fixed it by putting the steam_appid.txt file in the build folder. That fixed it. If the .txt file is supposed to be included in the build folder, it wasn't. When I run the build now, I do not get errors. |
My game is for sale on steam I would like to add that it worked perfectly with the AppID for Spacewar, but not my game |
Hey there @immurecreations, if it worked with 480 but not your appid, the two things that I'd check first are: 1. Are you logged in to Steam with an account which owns a license for your AppId? 2. Did you save the file as ASCII/UTF8-no-BOM? |
How do I check the second option? I’m sure number 1 should be valid since my account was given the game throughout the publishing process
|
@rlabrecque i checked the encoding in notepad++ and its UTF8 |
it works now! :) |
This one worked for me too. I'm not sure if having the appId in the root folder is bad practice though. |
Just to be clear, best practice is that you include the steam_appid.txt in the root folder while testing only. When you build for Steam, you should not include that .txt file. |
Hello there, |
Make sure the steam_appid.txt file is in the build folder while testing. But do not include it in the final build for Steam. |
Oh wow, I'm so dumb. So I need to have steam client installed on my computer where I'm developing the game too? Edit: |
Add me to list of people having difficulty with this! First I couldn't even get the 480 app id to work until I read the above comment that you have to save the file as UTF-8 (without BOM). Then that got it initializing as SpaceWar, which was cool. Then I tried to put my own unpublished game's app id in, making sure to save as UTF-8 (without BOM), but initialization fails with that. I tried the other two default app ids you get for each steam project, and they don't work either. But if I go back to the 480 id, it's fine. Anyone have an idea how to troubleshoot this? My Steam account is the same as my Steamworks accounts, so there should be no issue there. Does it just sometimes take a few hours for an app id to propagate through Valve's servers to become valid? |
Okay, I have found our solution! Apparently, the three ids that Steam gave me were not app ids but package ids. So rather than using the app id number, I was using the package ids! Totally wrong number! Now we seem to be initializing properly! |
I don't see this simple solution mentioned much, but while developing in Unity, I had to have Steam running in the background. Simply opening Steam fixed it for me. |
Hi,
I'm running Unity 5,3,1f Personal.
My first game was recently Greenlit http://steamcommunity.com/sharedfiles/filedetails/?id=542685634 so this is my first time getting a game onto Steam.
I imported the SteamWorks.NET Unity component as per the instructions here https://steamworks.github.io/installation/
steam_api.dll did not appear in the root, but the steam_appid.txt did and I edited it, making it my own appid. While poking around I found steam_api.dll under Assets/Plugins/x86.
So not 100% sure that the import went correctly.
When I have steam running and launch the game in Unity UI I get this error. Same if I run a stand alone build.
[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information. UnityEngine.Debug:LogError(Object, Object) SteamManager:Awake() (at Assets/Scripts/Steamwork.NET/SteamManager.cs:97)
Is this normal? Is it because I am not launching it from Steam?
The text was updated successfully, but these errors were encountered: