Steamworks.NET
Steamworks.NET copied to clipboard
[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.
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?
Copy the steam_api.dll
into the executable folder. That should work.
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.
[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)
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 other appid(480 or published) is working but not mine T.T(492610) What can i do??
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. B: Your account owns the game through a "Developer Comp" (red) CD-Key.
Essentially it just means that your game should show up as playable in your Steam library.
@gycot: Yes, you need to manually copy steam_appid.txt if you need it. You're not supposed to ship it to customers as Steam injects the appid itself when it's run from Steam. You can ensure that you're running from Steam by calling SteamAPI.RestartAppIfNecessary with your AppId (as is done in SteamManager)
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 steamcmd
. Potentially relevant info from the logs:
[S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.
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 steamclient.so
to .steam/sdk32
.
The game is packaged with steampipe(ass a tool as described here on their partner site, which purposely includes steamclient.so
and steam_appid.txt
as redistributables. But an strace
only suggests that it's looking for a pid file isntead of steamclient.so
but I'm no expert at reading these traces.
Not really sure where to go from here, but would love some ideas.
Looks to be the same problem with both SteamAPI.Init()
and GameServer.Init()
. On Linux, anyway.
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" [email protected] 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.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
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, GameServer.Init()
worked! When I wrote that post, my conditional was failing between using that and SteamAPI.Init()
. So something to keep in mind for anyone trying to get a headless linux server running, I guess.
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.