Post subject: Game not accepting input from Hourglass
Joined: 12/31/2009
Posts: 174
Game: Teslagrad non-steam 1.2.2 (latest) OS: Windows 7 SP1 64-bit and Windows XP SP3 x86
  • Both OSes are running in a VM (Parallels Desktop for Mac)
  • Inputs works properly in Braid
  • Hotkeys control Hourglass properly
  • Control over the mouse isn't lost unlike Braid
  • Enabling input "when other programs have focus" has no affect
  • Game uses Unity (if it matters)
Windows XP Log: http://puu.sh/8x4WS.txt Windows 7 64-bit Log: http://puu.sh/8x526.txt I am unable to test on a host Windows system at this moment (hangs on my Windows 7 laptop).
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
Congratulations, you exposed an unhooked (and unlisted) WinAPI call for input called RegisterWaitForInputIdle! I am also surprised that this game renders properly considering it's an OpenGL game. (OpenGL in Hourglass is proxied to DirectDraw) The good news is that the source of your problem was most likely found. The bad news is that I have no idea how this function works, and there is no documentation on it as far as I can see now. But I will look into this further! EDIT: This function is not meant to be used for this, it is supposed to be used in Kernel development only, I have no idea why Unity or Teslagrad chose this one over the higher level ones. The things game-developers do... EDIT2: Traced (didn't expect to find it today, only did because I can't read), this is called by XInput. Game uses XInput. XInput hooking was added by keylie in Hourglass-Resurrection, but that version isn't fit for TASing submittable movies with yet, if you know your way around Visual Studio 2010 etc, feel free to grab the latest trunk to test stuff.
Joined: 12/31/2009
Posts: 174
I compiled the trunk, tried it, and it didn't help on either OS. Here is the log from Win XP: http://puu.sh/8y6FQ.txt 000007C4: (f=0, t=6000) InterceptAPI(XInput9_1_0.dll.XInputGetState) failed! (0x0, 0x10021140) 000007C4: (f=0, t=6000) InterceptAPI(XInput9_1_0.dll.XInputSetState) failed! (0x0, 0x100211B0) 000007C4: (f=0, t=6000) InterceptAPI(XInput9_1_0.dll.XInputGetCapabilities) failed! (0x0, 0x10021220) 000007C4: (f=0, t=6000) InterceptAPI(XInput9_1_0.dll.XInputGetDSoundAudioDeviceGuids) failed! (0x0, 0x10021290)
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
Later in the log, this happens: LOADED DLL: C:\WINDOWS\system32\XInput1_3.dll LoadModuleSymbols(0x1E0, C:\WINDOWS\system32\XInput1_3.dll, 0x19C, 0x68E0000) = {BaseOfImage=0x68E0000, NumSyms=103, SymType=0x4, ModuleName=XInput1_3, ImageName=C:\WINDOWS\system32\XInput1_3.dll} Does the game supply it's own Xinput-dll? (XInput9_1_0.dll)
Joined: 12/31/2009
Posts: 174
No, I don't see the dll in the program's files. EDIT: XInput9_1_0.dll is already installed so the game is voluntarily choosing XInput1_3.dll
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
I'll get Keylie's attention onto this, perhaps he can continue debugging the problem, I don't own the game (nor can I afford it) so I cannot really test myself. Also Keylie knows more about XInput than I do.
Joined: 12/31/2009
Posts: 174
You can download the demo at: http://rain-games.com/downloads/ The binary is identical and the only difference are later rooms being removed (only 39 of the total 123 rooms are available).
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
Thanks, will test some and see what I can come up with. EDIT: Since I am stupid, I didn't think of checking the hooking table for Xinput. Open XInputhooks.cpp and change
        MAKE_INTERCEPT(1, XInput9_1_0, XInputGetState),
        MAKE_INTERCEPT(1, XInput9_1_0, XInputSetState),
        MAKE_INTERCEPT(1, XInput9_1_0, XInputGetCapabilities),
        MAKE_INTERCEPT(1, XInput9_1_0, XInputGetDSoundAudioDeviceGuids),
into:
        MAKE_INTERCEPT(1, XInput1_3, XInputGetState),
        MAKE_INTERCEPT(1, XInput1_3, XInputSetState),
        MAKE_INTERCEPT(1, XInput1_3, XInputGetCapabilities),
        MAKE_INTERCEPT(1, XInput1_3, XInputGetDSoundAudioDeviceGuids),
Then build it and run Teslagrad, post a new log and tell me if input ended up working better. (You might need to config XInput in the config, which is a little buggy still)
Joined: 12/31/2009
Posts: 174
Log changed but the game still isn't receiving any input. Win 7 log: http://puu.sh/8zdHk.txt Win XP log: http://puu.sh/8zeCP.txt It successfully intercepts the API after the xinput1_3.dll gets loaded. Just an after-thought, can you let us know if the game renders properly for you? I wonder if OpenGL is playing nice in my VMs because of Parallels' 3D acceleration support.
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
Nice, will see what can be done about that, since some games use the other one. Xinput keyboard input isn't hooked (nor understood by me), the game has settings for gamepad. If you configure hourglass to map the Windows control to desirable gamepad controls (I think Keylie implemented this at least), and then configure the controls in the game for gamepad, you should be able to move. My computers are too weak to run this game apparently, it's so laggy I cannot even maneuver in the menus :(
Joined: 12/31/2009
Posts: 174
The game isn't receiving any input from the controllers either. Thanks for trying. There is no rush, I still have a lot of routing to do first.