SteamAPI Integration & Steam Overlay

Posted By: Talemon

SteamAPI Integration & Steam Overlay - 04/21/16 11:02

Hey there,

I've already written a dll project which is simply able to initialize SteamAPI and query info from cloud and pass to game codes.
Yet unable to display steam overlay inside game window!
Steam SDK documents says that:
"The game doesn't need to do anything to have the overlay work, it automatically hooks in for any game launched via Steam. For development, when running your game in a debugger for example, the overlay is loaded when you call SteamAPI_Init(). You'll need to make sure to call SteamAPI_Init() before you initialize the OpenGL/D3D device, otherwise it won't be able to hook in. The overlay works with games that use OpenGL, or DirectX 7, 8, 9 or 10. Input has to be win32 or DirectInput. The Steam overlay will not show over software-rasterized games."

I have two main problems according to this explanation.
1-) When I'm in development enviroment. Game is actually not inside steam folders. So i need to properly inject my dll before D3D device initialized. How can I achive that?
(I already tried to self initialize SteamAPI inside dllmain.cpp entry point. It didn't worked)
2-) From user's perspective our game depends on launcher that asks to enter login info! (Please note that Launcher not developed using GameStudio) then launches game.exe. Which becomes more complicated as Steam will not recognize game.exe since needs to run Launcher first! Seems like I desperately need to initialize SteamAPI properly in order to make things work in real world.

Thanks in advance for your help.
*Edit: wrong file name extension
Posted By: Ch40zzC0d3r

Re: SteamAPI Integration & Steam Overlay - 04/21/16 11:45

If you add the DLL to the exe IAT (Import Address Table) for example using CFF Explorer (http://www.ntcore.com/exsuite.php) it will load the dll (and call its dllmain) before any code in the exe is executed.
If you modify the steam dllmain using ollydbg or ida you can simply call the init func there laugh
You can do this also using a 3dgs plugin dll because those are also executed before device initialization.

I dont know why there should be problems with the launcher.
Let steam start the launcher and keep the process open but hidden.
The Launcher closes itself when the game process is also closed and it will look like its working as it should for steam grin
Posted By: Superku

Re: SteamAPI Integration & Steam Overlay - 04/21/16 15:50

Regarding DLLs: Ch40zzC0d3r already said it but what works fine for me (for 3 custom DLLs) is to use special acknex plug-ins/ DLLs.

Don't know about the launcher stuff but I think the Steamworks Dev Forums (should) have some threads from people with similar problems. I don't know your game/ product but personally I hate launchers, they are so 1996. I don't think anything justifies having those instead of adding the config stuff to the game itself.
Posted By: sitrep

Re: SteamAPI Integration & Steam Overlay - 04/21/16 21:29


@Superku or anyone using Steam laugh


Are the API's and dlls to make a 3DGS game "Seam-ready" available in our community resources ? or is this something that has to be custom coded with C++ ?


Thanks !
Posted By: Superku

Re: SteamAPI Integration & Steam Overlay - 04/22/16 15:33

Sadly it's all custom made.
Took me a while to figure it out, esp. because I didn't know C++ (and still don't really do), but with the Steamworks Forums and the documentation it's doable in a couple of weeks.
Posted By: sitrep

Re: SteamAPI Integration & Steam Overlay - 04/25/16 22:55

@Superku

Thanks for the info ! Really appreciate it laugh

Best wishes to your steam game !
Posted By: Talemon

Re: SteamAPI Integration & Steam Overlay - 04/26/16 12:26

Hi all,

@Ch40zzC0d3r as you mentioned It turns out that I dont need to find a way for SteamAPI to initialize before D3D drivers initialized laugh
I've had concerns about introducing my sub exe to Steam Client. But Steam client can keep track of sub exe(s) and hooks itself
as long as first exe that executed via Steam Client is alive! Once it is hooked to sub process, even if you kill main process
Steam overlay keeps working + "now playing" state remains unchanged.

@Superku Our game is a MMOFPS called ZULA and already published in our country. Launcher handles patching operations,
user information and displays notifications etc.

@sitrep I developed only 1 dll for our project. To develop your own, You can find the documentation inside GameStudio Manual:
GameStudio SDK->Plugin SDK
Also Steam documentation and comments inside .h files pretty straightforward.
© 2024 lite-C Forums