protonscr

Steamworks SpaceWars example not using Steam Controller

steamclosed reviewed
ValveSoftware/steam-for-linux#4250 · opened 2016-01-10 by bbbales2 · updated 2019-03-29 · 7 comments · github
Bbbbales2 2016-01-10 github

I was able to successfully build and run the Steamworks SpaceWars example (https://partner.steamgames.com/documentation/example) but I was unable to get the controller support working. I'm running Ubuntu 14.04.

As I understand it the D-pad should map to directions in game and the right trigger to shoot, but it's not working.

PPlagman 2016-01-11 github

Are you running it from within Steam, and is the Big Picture overlay working properly within the game?

Bbbbales2 2016-01-11 github

No, but let me explain what I know in slightly more detail.

I started by trying to mess with the SpaceWars code to understand how to interface with the controller.

  1. The function "BIsSteamControllerActive" in IGameEngine (GameEngine.h) returns true if add a call to it manually in Main.cpp.
  2. Performing a similar experiment with the function "GetTextStringForControllerOriginAnalog" in IGameEngine (GameEngine.h), arguments x and y both equal to zero. I assumed this is being set in gameenginesdl.cpp:1377. I assumed that the controller action set was not being set properly, and went to investigate how the action sets get loaded. I did not check that this conditional is failing explicitly.

At this point I decided it would be best if I just used an unmodified steamworks SDK and get controller support working in SpaceWars before I tried any more custom code. From what I understood I figured it was likely that the IGA file wasn't getting loaded properly.

  1. From reading this: https://partner.steamgames.com/documentation/steamcontroller, I decided to take the controller.vdf file from the steamworksexample folder and rename it game_actions_480.vdf in my [steam]/controller_config directory. (I see the SpaceWars AppID is 480 in the terminal). This didn't work.
  2. I tried to add SpaceWars to my list of steam games but I was unable to get the game to launch from within Steam. I made a .desktop file for it using https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles. The .desktop launcher worked from the desktop but not when added as a Steam game. As I recall, it seemed to me I was getting errors about the wrong dynamic libraries being loaded. I assume this is because SpaceWars is built for debugging against the development Steamworks libraries and not against distributable ones? I'm not sure. The file I used for the .desktop launcher was the .sh file that modifies the STEAM_RUNTIME and LD_LIBRARY_PATH variables.
  3. Because I couldn't add SpaceWars to Steam and launch it in Big Picture Mode normally, I used the advice in this post https://steamcommunity.com/app/353370/discussions/0/490123197953338875/ (-windowed -480p) to start Big Picture Mode in a windowed way. I was able to launch SpaceWars in the background, but still got no controller stuff. Big Picture Mode responded to my opening and closing of SpaceWars, so I assumed it was working properly.

Any ideas?

Steam seemed to be detecting the SpaceWars binary fine. It would print out little messages when I launched the SpaceWars binary, and I could see where the Steam Controller was being switched back to use it's default .vdf when I closed the game.

Bbbbales2 2016-01-12 github

I just installed the SDK in Windows and the Controller works there for me. I just build and run the game and it works. I should be able to use Windows to do the testing I wanted to do, but I think this is still an issue.

PPlagman 2016-01-12 github

Did you not build Spacewar against the Steam Runtime? It might be why it's failing to start when you add it to Steam. Starting from Steam is required for proper controller functionality, the overlay not working is the reason your controller configuration isn't applying. You can try LD_PRELOADING gameoverlayrenderer.so by hand as well.

Kkisak-valve maintainer 2019-03-01 github

Hello @bbbales2, are you still experiencing this issue on an up to date system?

Bbbbales2 2019-03-01 github

@kisak-valve Sorry! I don't know the status of this. My last post is probably about the last time I messed with it.

Kkisak-valve maintainer 2019-03-29 github

Thanks for the feedback @bbbales2, closing as outdated.

Nothing extracted yet.