Extra window and Steam Overlay

BlitzMax Forums/BlitzMax Programming/Extra window and Steam Overlay

Ian Martin(Posted 2015) [#1]
I'm getting my game Platfinity ready for release on Steam, and noticed I am getting an extra window open in the background. I got Steam achievements working via Skidracer's steamstub.dll, and the achievements are activating in my account, but there is no Shift-Tab notification in the corner, notifications don't pop up when an achievement is *ahem* achieved, and Shift-Tab does not bring up the Steam Overlay.

I did some experiments with the code, seeing if I'm doing anything weird that's stopping the overlay, with no luck. So I reduced the entire game to just setting the graphics and putting up a logo, and I still get a background window:
Graphics (1920, 1080) 

Incbin "IncludeAssets/Platform Logo Complete 004.png"
Global TextureTitleCompleted:TImage=LoadImage ("incbin::IncludeAssets/Platform Logo Complete 004.png", 0)

SetColor (255, 255, 255)
DrawImage (TextureTitleCompleted, 0, 0)
Flip

Delay (3000)

WaitKey


I should note I do not get a background window when I compile and run in the IDE, only when I create the .exe and run the program from the .exe

Does anyone know why this background window opens up and is there any way to disable it or close it?

I know a few people have games on Steam, like Charlie (Scoregasm), therevills (Legends of Solitaire: Curse of the Dragons), and Grey Alien (Spooky Bonus). I've tested Scoregasm and Legends and the Steam overlay works fine on my PC. Maybe someone else has run into this problem? And if so, how did you solve it? Is this extra window blocking the overlay from hooking in?

Any help would be most appreciated! :)


skidracer(Posted 2015) [#2]
In regards to the window, it sound like you are compiling your BlitzMax as a console app and not a gui app.


Ian Martin(Posted 2015) [#3]
Woah! I think that worked.
I'm not using any MaxGUI functions, so I must have unchecked that at some point thinking it had to do with those functions.
I'm going to build through Steam again and see if the overlay comes up now :)

Thanks nitro!


Ian Martin(Posted 2015) [#4]
Hmmm, still no overlay. The extra window is gone, but I'm still not getting the overlay and Shift-Tab doesn't do anything. I must be doing something else wrong :/


therevills(Posted 2015) [#5]
Are you running your game from within Steam itself?

Congrats on getting Greenlit - its a real PITA! ;)


Ian Martin(Posted 2015) [#6]
Yes, I did the build through Steampipe, latest Steamworks SDK 1.35
I'm launching it through the Steam client.
I have no idea why it isn't working.


Ian Martin(Posted 2015) [#7]
Thanks! Yeah, I was on Greenlight for six months or so. It's getting easier now though I think :)


therevills(Posted 2015) [#8]
Could you try adding your game to your Steam client as a non-Steam game and see if that works?

Also try without the incbin.


Ian Martin(Posted 2015) [#9]
Yes, when I add it as a non steam game it works. That is the shift tab popup comes up and the shift tab opens the overlay.
I'll have to build something and upload it to avoid an incbin...all the assets are incbined except the game data. You think the incbins might be a problem?
I don't think it matters, but my game is in the Software category not the Games category. I have stuff in the Software category that the overlay works on though. I wish it was easier to post images, heh


Ian Martin(Posted 2015) [#10]
OK, uploaded just this as the .exe and still not getting an overlay:
Graphics (1920, 1080) 

Global TextureTitleCompleted=LoadImage ("IncludeAssets/Platform Logo Complete 004.png", 0)

Repeat 
	Cls
	DrawImage (TextureTitleCompleted, 0, 0)
	Flip
Until KeyHit (KEY_ESCAPE)



Starting to think maybe it's because it's in the Software category...maybe I should ask Valve in their forums if that's the case?


Ian Martin(Posted 2015) [#11]
Adding that same .exe as a non-Steam game and I get the overlay and can do a screenshot:
http://images.akamai.steamusercontent.com/ugc/405683244452444613/70C83EC6F84D998709DC4B9586628AA467633390/


therevills(Posted 2015) [#12]
Thats strange... I was hoping it would fail too.

Could you try setting the graphics driver:
SetGraphicsDriver D3D9Max2DDriver()
Graphics (1920, 1080) 

Global TextureTitleCompleted=LoadImage ("IncludeAssets/Platform Logo Complete 004.png", 0)

Repeat 
	Cls
	DrawImage (TextureTitleCompleted, 0, 0)
	Flip
Until KeyHit (KEY_ESCAPE)


If that doesnt work try the OpenGL driver "SetGraphicsDriver GLMax2DDriver()"... and if that still doesnt work I would suggest posting on the Steam Developers Group forum and see if you need to do something special enabling Steam Overlay for Software category....

Also have you checked that the Overlay is enabled for your app? (Right click on the app and select properties. In there, one of the tabs says enable steam overlay for this game)


Ian Martin(Posted 2015) [#13]
I had tried setting different graphics drivers before...not since fixing the extra window problem...but before when I was looking for reasons why it wasn't hooking in...as Steam said you needed to create the graphics object before opening Steam. Thanks for helping me with this! :D
I've posted on the Steam forum about it. I'm now thinking it's the fact that it's in the Software category, as most of the Software I have on there does not use the overlay. I'll post here if I get a reply there :)


therevills(Posted 2015) [#14]
Do you have Fraps or anything running in the background?


Ian Martin(Posted 2015) [#15]
Oh, forgot the second question. Yes, the overlay is enabled, the box is checked in properties.


Ian Martin(Posted 2015) [#16]
No, no Fraps. Disabled the nVidia control panel too, as I know that can do capture.


therevills(Posted 2015) [#17]
G'ah! Thought it might be something like Fraps as I found this Steam thread, with this question:

"My steam overlay seems to refuse to work in the official steam version of the game, but the DRM-free version when added as a non steam game does work"

https://steamcommunity.com/app/242920/discussions/0/540734168223520249/#p1

So if you run any other game from your Steam client, the overlay currently works?


Ian Martin(Posted 2015) [#18]
Yes, it works with the other games, including the Legends one from you and Scoregasm.


therevills(Posted 2015) [#19]
I'm sorry I'm out of ideas :(

I didnt have to do anything special myself to get the overlay working. One final idea, could you create an app not using BlitzMax (MonkeyX, PureBasic etc) and see if that works?


Hopefully the Steam group helps... let us know if they have any other ideas...


Ian Martin(Posted 2015) [#20]
Ah, that's a good idea...didn't think of that. I could try some Monkey code. I could probably figure out how to draw a title screen in GameMaker too, heheh If I don't get a better plan from Steam I'll try that.

I'll post here if I get something back from the Steam forums. Thanks again for the help!


skidracer(Posted 2015) [#21]
The default spacewar game id may be useful for testing basic steam functions if you think it is an account issue.


Ian Martin(Posted 2015) [#22]
I'm still waiting for a response on the Steamworks Development forum. I'm thinking it's because it's listed in "Software" instead of "Games" since the overlay works fine when I add it as a non-Steam game which means the overlay can work over the code... if it wants to, heheh


therevills(Posted 2015) [#23]
How did you go with this issue?


Ian Martin(Posted 2015) [#24]
Almost two weeks and no response on the Steam group :/

I have another friend who has a Steam app in Software, just haven't had time to ask him about it yet. I haven't touched the code either, been working all the time since I do retail and it's Christmas season. Should get some time after Thanksgiving and black Friday :)


JoshK(Posted 2015) [#25]
Call Steam_RunCallbacks() each loop.


therevills(Posted 2015) [#26]
Almost two weeks and no response on the Steam group :/

Maybe try using a different tool (like GM...)

Call Steam_RunCallbacks() each loop.

In my main loop I have this:
		If UsingSteam
			ReadSteamWrapper()
			StoreSteamStatsWrapper()
		End If


Those Wrapper functions are defined as follows:
Function ReadSteamWrapper()
	Local read:String = ReadSteam()
	If Not SteamIsActive
		If read.ToLower() = "stats received!"
			SteamIsActive = True
			DebugLog "Steam: SteamIsActive = True"
		End If
	EndIf
End Function

Function SetSteamAchievementWrapper(name:String)
	'Do not call this until ReadSteam has returned "stats received"
	If Not SteamIsActive Then Return
	
	SetSteamAchievement(name)
	StoreStats = True
End Function



Ian Martin(Posted 2015) [#27]
Just now getting time to look at this...

Call Steam_RunCallbacks() each loop.

I don't see that anywhere in the steamstub stuff. Is there a function for that in steamstub?

@therevills: My code looks similar to what you're doing there. It checks to see if Steam is active, reads steam each loop, and stores stats when there are achievements unlocked.

I tried making some code in Monkey, and uploaded it through steampipe as Platfinity.exe Unfortunately, still no overlay.

I also spoke to my friend who has an app in Software. He said he didn't know why it didn't work, that it may be the same as Tools, i.e. no overlay by default. He said Steam might have to do something on their end to make it work. So I will ask them again once I have all the Trading Cards, backgrounds, etc. made. They may be more responsive when they see it's about to go live. I hope so anyway :P