Sign in to follow this  
KazenoZ

SteamWorks .NET integration

Recommended Posts

KazenoZ    152
Hello,

I'm not sure I'm posting in the right place, but there wasn't really anything better suited.

So this is the thing,
I'm currently working on an application that I would really like to apply to SteamWorks when I get the beta build done in about a couple of weeks.
However, looking at their FAQ just now brought me to a statement that SteamWorks doesn't offer a built in wrapper for .NET languages to the SDK.

My project is heavily dependant on the .NET functionality in it, which brings me to ask the following few:
- Having no wrapper means that it wouldn't have support to be published through Steam at all, or would it only mean that I would have no support for the SteamWorks' functionality the SDK has to offer?
- My project is actually composed of 2 executables, one is for designing, the one done in .NET, and has no actual need of the SteamWorks' functions (except for it being the main executable that I would need to be the one opened by Steam when it's clicked to play), and the other is a native application that should be able to incorporate SteamWorks' API in it, and in which they are needed.
The question being, will it be possible to support running of the .NET application from the Steam menu using this? And will it be possible to boot the other executable that utilizes the API through this .NET application, and still maintain support from SteamWorks?

Again, I don't know if this is the right place, but I'm just hoping there might be some people around here that actually have access to SteamWorks, that can help and answer my question? SteamWorks' site has no support page, so there's no where I can ask this there =\

Thank you very much for your time to reading and acknowledging my problem.

Share this post


Link to post
Share on other sites
_the_phantom_    11250
As with any C++ library you want to access from a .Net language a wrapper can always be written.

There are existing games on Steam which are written in a .Net language (C# mostly) which have Steamwork integrated into them.

However, you would have to write this wrapper yourself if Valve don't have one they can supply you with; due to the restrictions on the Steamworks SDK licensing you also couldn't just ask someone else to do it for you I'm afraid.

Also, it should be noted that people using Steamworks are likely under various agreements which means they can't discuss the details of the SDK with you and certainly not on a public forum.

Share this post


Link to post
Share on other sites
EJH    315
Yes you can. I'm currently beta testing Galactic Arms Race which is an XNA game with full Steam Integration. There are two other XNA games already available on Steam, Terraria and Sol Survivor. Here's links to all 3 games:

[url="http://gar.eecs.ucf.edu/"]http://gar.eecs.ucf.edu/[/url]

[url="http://store.steampowered.com/app/45000/"]http://store.steampo....com/app/45000/[/url]

[url="http://store.steampowered.com/app/105600/"]http://store.steampo...com/app/105600/[/url]

Basically you just make a bunch of C# wrapper functions for the Steamworks DLL. It can be a bit tricky and time consuming depending on what functionality you need. Also, you cannot try/catch recover from exceptions thrown by a DLL, so debugging can be a hassle.

If you (or anyone else) get accepted on Steam and get a game ID, I will gladly share my C# wrapper code. It will save you a lot of time/hassle. Just PM me here or post on the Galactic Arms Race web site. You would have to get accepted by Valve first of course, and anyway, the code would be useless if you don't have access to the Steamworks SDK. ;)

Share this post


Link to post
Share on other sites
KazenoZ    152
Thank you both for the answers, that helped me alot.

And sure EJH, I'll keep that in mind and contact you when the time comes, thank you very much =)

Share this post


Link to post
Share on other sites
lpcstr    127
I haven't worked in a .NET language in some time, but I thought using C API DLLs in C# was a trivial task.

Wouldn't you just use pinvoke?

[code]
[DllImport("steamworks.dll")]
public static void SomeSteamAPI();
[/code]

I don't see where the challenge lies.[size="2"][/size]

Share this post


Link to post
Share on other sites
Flimflam    665
[quote name='lpcstr' timestamp='1306536074' post='4816596']
I haven't worked in a .NET language in some time, but I thought using C API DLLs in C# was a trivial task.

Wouldn't you just use pinvoke?

[code]
[DllImport("steamworks.dll")]
public static void SomeSteamAPI();
[/code]

I don't see where the challenge lies.
[/quote]

The challenge lies in the fact that SteamWorks is a rather large class based library, not just a collection of functions that can be willy-nilly P/Invoked with success. It's not impossible, but it's not trivial either.

Share this post


Link to post
Share on other sites
EJH    315
[quote name='lpcstr' timestamp='1306536074' post='4816596']I don't see where the challenge lies.
[/quote]


Uhh many places:

- how do you call C++ DLL from C# in the first place?
- how do you marshal every C# type to every C++ type?
- what do you do when the C++ DLL function your are calling requires C++ structs/classes as parameters?
- string encoding is not straightforward at all. UTF, Ascii, C++ strings, C# strings, C char[] arrays, etc... you may need to convert any of those to any other.
- how do you convert stuff like delegates, function pointers, callbacks, etc. from C# to C and vice-versa?
- what if either DLL or .exe is threaded and the other is not?
- handling/debugging exceptions in a DLL?

It is not trivial at all, unless you have done it all before. ;)

Share this post


Link to post
Share on other sites
KazenoZ    152
Most of these are problems relating to C# to C++ wrapping though, what if the program already works with C++?

And I just need to ask this again, since you worked with it, and I forgot I didn't get the answer in the last post, my .NET program doesn't actually need the Steam support, just needs to be put for download and use the statistics features, no matchmaking/leaderboards/achievments or anything like that, will that require a wrapper too?

Share this post


Link to post
Share on other sites
EJH    315
[quote name='KazenoZ' timestamp='1306578678' post='4816742']
Most of these are problems relating to C# to C++ wrapping though, what if the program already works with C++?

And I just need to ask this again, since you worked with it, and I forgot I didn't get the answer in the last post, my .NET program doesn't actually need the Steam support, just needs to be put for download and use the statistics features, no matchmaking/leaderboards/achievments or anything like that, will that require a wrapper too?
[/quote]

In that case you don't need to make any wrapper code at all. You can write it in Cobol if you want and the Steam installer will just install the game. ;)


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this