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

A bit of doc for the location of the DLLs. #36

Closed
johanneskraem3r opened this issue Jul 7, 2017 · 14 comments
Closed

A bit of doc for the location of the DLLs. #36

johanneskraem3r opened this issue Jul 7, 2017 · 14 comments

Comments

@johanneskraem3r
Copy link

@johanneskraem3r johanneskraem3r commented Jul 7, 2017

TBH, I'm constantly confused where these .dlls (and other lib files) need to go for a Unity build.

Where do they have to be :

1.) when running in the Editor?
2.) when running a build outside of the editor, but not in the steam installation.
3.) in the build depot when publishing for Steam.

I think a clear documentation of this in the repo would be super helpful for people new to this stuff.

( I'm pretty new to this Steamworks API stuff, but so a lot of things that might be obvious for a lot of other people are simply confusing )

=========================================
Here's my try to answers for the above, hope this is correct/clear enough.

1.) Editor: dlls go in the Unity project folder, next to the "Assets" folder.
2.) Build, outside of editor
a. Windows: The appropriate dlls (steam_api64.dll and steam_api64.dll) need to be "next to" the exe file. Also, don't forget the steam_api64.dll and the steam_appid.txt ) updated with your game's ID).
Note: just because these files are in the Unity project directory doesn't mean Unity will bundle them. You need to manually copy them next to the exe after the build.
b. OSX : {???}

3.) a: Windows: Steam API DLLs need to be in the depot next to the exe file. The "steam_appid.txt" is not required since Steam will take care of this info.
b. OSX : {???}

Hope this helps some people.

@johanneskraem3r
Copy link
Author

@johanneskraem3r johanneskraem3r commented Jul 7, 2017

Sorry — Just saw that the Unity example has such a post build script:

https://github.com/Facepunch/Facepunch.Steamworks.Unity/blob/master/Assets/Scripts/Editor/Build.cs

Maybe a bit more doc in this repo wouldn't hurt?

Loading

@johanneskraem3r
Copy link
Author

@johanneskraem3r johanneskraem3r commented Jul 7, 2017

One thing is still unclear for me: For OSX builds, does the "libsteam_api.dylib" file have to be copied somewhere into the build directory as well or that not required?

Loading

@mwegner
Copy link

@mwegner mwegner commented Jul 7, 2017

I think OSX will check elsewhere too, but this is how our Mac build is set up:

We put the dynamic library in:
Aztez.app/Contents/Frameworks/MonoEmbedRuntime/osx/libsteam_api.dylib

steam_appid.txt next to the actual +x executable file:
Aztez.app/Contents/MacOS/steam_appid.txt

screenshot 2017-07-07 08 29 47

Just in case someone reading this isn't familiar--on macOS, applications are .app folders that look and behave like single files to the user (but are really folders under the hood). You can right-click and do "Show Package Contents" if you want to dig in to one with Finder. You can treat them like normal folders with terminal or any file copy operations elsewhere.

Loading

@johanneskraem3r
Copy link
Author

@johanneskraem3r johanneskraem3r commented Jul 7, 2017

Thanks so much @mwegner!

I just found out as well after some digging. Turns out there's log output that prints where Unity is trying to load the file from.

Now we got the following TODO: Add some code to "OnPostprocessBuild" to also copy the OSX files ;-)

Hope this helps some other people as well.

Loading

@johanneskraem3r
Copy link
Author

@johanneskraem3r johanneskraem3r commented Jul 7, 2017

Short follow-up:

libsteam_api.dylib is for any OSX builds? ( 32bit, 64bit, Universal?)

Loading

@mwegner
Copy link

@mwegner mwegner commented Jul 7, 2017

We're only building 64-bit on Mac, so I don't actually know. I guess Unity has retained 32-bit builds for projects that are using native plugins where only 32-bit is available? I'm not sure why it's there otherwise.

Most Mac hardware was booting 64-bit kernel in Snow Leopard (10.6), and as of Lion (10.7), everything is 64-bit by default. According to Unity's requirements page, the player requires 10.8 these days anyway: https://unity3d.com/unity/system-requirements

Snow Leopard shows up as 0.9% on their charts, but only Core Duo chips would boot 32-bit there: http://hwstats.unity3d.com/pc/os-mac.html

Long store short, just ship out a 64-bit build to save some bytes unless you have a weird plugin that needs 32-bit...

Loading

@johanneskraem3r
Copy link
Author

@johanneskraem3r johanneskraem3r commented Jul 7, 2017

... which leads to the question: Which is the 64bit lib to use ? Still the same libsteam_api.dylib file from "/steamworks/redistributable_bin/osx32/". Or the dll?

Loading

@mwegner
Copy link

@mwegner mwegner commented Jul 7, 2017

Oh yeah, looks like Steam just gives you one anyway. We use that on 64-bit builds and it's fine.

Loading

@johanneskraem3r
Copy link
Author

@johanneskraem3r johanneskraem3r commented Jul 7, 2017

Awesome. Really appreciate your help!

Loading

@johanneskraem3r
Copy link
Author

@johanneskraem3r johanneskraem3r commented Jul 8, 2017

Additional note for anyone trying to get the Steam Overlay working on a OSX/ 64 bit builds: It's not working properly. I got the Client API to work on 64 bit / universal builds ( by putting the lib in the Frameworks folder as "libsteam_api64.dylib"), and e.g. incrementing a Stats counter and awarding Achievements works, but the Steam Overlay won't work. See also: rlabrecque/Steamworks.NET#163

Loading

@mwegner
Copy link

@mwegner mwegner commented Jul 8, 2017

If it's this, from that link: "Steam overlay does not support Metal."

You can un-check "Auto Graphics API for Mac" in player settings and remove Metal from the list. I haven't actually tested overlay-related stuff over here (suppose I should do that before launch).

Loading

@johanneskraem3r
Copy link
Author

@johanneskraem3r johanneskraem3r commented Jul 8, 2017

Yep, that's it.

Can confirm that the overlay works also on OSX 64 bit builds, if you do the following:

1.) un-check "Auto Graphics API for Mac"
2.) Remove Metal ( and thereby only allowing OpenGLCore ).

Thanks again!

Loading

@garrynewman
Copy link
Contributor

@garrynewman garrynewman commented Jul 8, 2017

I've put a wiki page up describing how we ship Rust.

https://github.com/Facepunch/Facepunch.Steamworks/wiki/Library-Locations

Loading

@garrynewman garrynewman closed this Jul 8, 2017
@johanneskraem3r
Copy link
Author

@johanneskraem3r johanneskraem3r commented Jul 8, 2017

Sorry to bug you again. But, I simply can't make it work like this on the 64 bit Mac builds.

What I want to do is award achievements.

The only way I can make the awarding of the achievement and the correct display in the Steam overlay ( the achievement icon popping up) work, is by putting two copies of the file

libsteam_api.dylib

under

mygamename.app/Contents/Frameworks/MonoEmbedRuntime/osx

so that I have:

mygamename.app/Contents/Frameworks/MonoEmbedRuntime/osx/libsteam_api.dylib
mygamename.app/Contents/Frameworks/MonoEmbedRuntime/osx/libsteam_api64.dylib

If one of those files is missing, it won't work. Super weird, but that's what I'm seeing here.

Not sure whats going on here.

Loading

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

Successfully merging a pull request may close this issue.

None yet
3 participants