Page 1 of 1

Bug with Xbox 360 controller setup

PostPosted: 23 Apr 2016, 11:07
by krilbe
I just bought two Xbox 360 controllers to play STK with. The shop only had one wireless in stock, so I bought one wireless and one wired. They both connect to USB, the wired one directly and the wireless has a transceiver that connects to USB.

The game seems to work except for the controller setup.

The controller setup seems to be unable to tell the two controllers apart, and when setting up one of them I have to press some of the desired controls on the other one and vice versa. The resulting input.xml becomes a bit messy and the game doesn't play well with a mixture of controls...

STK does detect both controllers as separate ones, naming one "Controller (XBOX 360 For Windows)" and the other "Controller (Xbox 360 Wireless Receiver for Windows)".

I think I am able to get the game working with manual tweaking in input.xml but I'm not quite sure about some of the attributes.

So:

1. Can STK be fixed so the controller setup works with this combo of controllers?

2. Where can I find documentation (or readable source code - guide me please) to understand all the attributes in input.xml?

I am a system developer myself, so I expect I can understand the code if I can get help finding the right source file(s) for controller setup and read/write of input.xml. Maybe I can even spot the bugs, with a little help. I am however rather rusty when it comes to C++, working mostly in C# and before that Pascal/Delphi.

Re: Bug with Xbox 360 controller setup

PostPosted: 01 May 2016, 00:22
by Auria
Hi,

1. Can STK be fixed so the controller setup works with this combo of controllers?


It can be that's a bit difficult, my own gamepad works well with STK. we would need a developer who has a problematic gamepad to help us identify what is going on, it's pretty hard to tell without being able to reproduce

If ever you feel like taking a look, check src/input/input_manager.cpp, method "void InputManager::inputSensing"

What usually happens when these symptoms occur is that the controlle or driver is sending messy values to the game, and STK thinks you've pressed something on your gamepad when you actually haven't. We need to figure out what happens exactly

2. Where can I find documentation (or readable source code - guide me please) to understand all the attributes in input.xml?


That should be mostly self-explainatory, but a few notes.

"event" can be 2 for a stick, 3 for a button (1 is keyboard)
"character" will remain unset for gamepads (0)
"id" will be the button index for a button, and the axis index for a stick. For sticks, "direction" also indicates whether it's in the positive or negative direction with 0 or 1.