I haven't gotten any controller to work with the game. (I've tried two different Playstation 2 controllers via adapter, Thrustmaster PS/PC combo controller and few cheap USB controllers now.) Other applications seem to work with the controllers.
I can also confirm that no controller seems to work. My PS3 Afterglow
controller and DragonRise (super cheap) do not work. For the fun of it I even
tried a wiimote.
Confirmed here for 2 USB joysticks : a "Microsoft SideWinter plug and play game pad" and a "Microsoft SideWinter game pad pro".
None of them is seen by the game disallowing local multiplayer.
Note that both controllers work for other games.
(In reply to comment #7)
> Problem persists in the newest version
The new version uses the new SDL Game Controller API: you can tell it how your joystick maps to an Xbox360 controller, with an environment variable.
Here's what a standard wired X360 and PS3 controller looks like:
http://hg.libsdl.org/SDL/file/959d9bbbbea0/src/joystick/SDL_gamecontroller.c#l100
So on my system, this would make the X360 controller work:
export SDL_HINT_GAMECONTROLLERCONFIG="030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5"
The SDL we shipped with the game _should_ have PS3 and X360 controller support out of the box, but it doesn't. We'll fix that next build. In the meantime, you can set the environment variable (or make your own for your joystick).
ProTip: the controller config UI in Steam's Big Picture Mode takes what you configured, and sets this environment variable before launching games.
I'll leave this bug open until we update SDL with those built-in configurations, but you should have the tools you need to get your controller working now. Feel free to post working strings for your controller here.
--ryan.
Tried this (the config I created using steam big picture mode and one that worked with The Cave) and it's didn't recognize it.
export SDL_HINT_GAMECONTROLLERCONFIG="00000000000000000000000000000000,360w,a:b0,b:b1,y:b3,x:b2,start:b6,guide:b7,back:b10,leftstick:b8,rightstick:b9,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5"
I use xboxdrv with the --mimic-xpad flag
Created attachment 3335[details]
test programs for game controllers
(In reply to comment #9)
> SDL_HINT_GAMECONTROLLERCONFIG="00000000000000000000000000000000,
All zeroes can't possibly be right. Can you try the attached program?
Unpack and run ./testjoystick, and it'll show you all the joysticks it sees. Run ./testgamecontroller with and without your SDL_GAMECONTROLLERCONFIG string and see what it says.
--ryan.
This was generated by Steam's Big Picture mode, not sure why it comes out as all zeros, but works fine in big picture mode and The Cave.
Used the package and found the actual guid of the controller and changed the line to this:
export SDL_GAMECONTROLLERCONFIG="000000004d6963726f736f6674205800,360w,a:b0,b:b1,y:b3,x:b2,start:b6,guide:b7,back:b10,leftstick:b8,rightstick:b9,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5"
Start button works and A works, but can't move menu around (can't pick play single player, stuck on Quit Game)
(In reply to comment #13)
> Created attachment 3335[details]
> test programs for game controllers
>
> (In reply to comment #9)
> > SDL_HINT_GAMECONTROLLERCONFIG="00000000000000000000000000000000,
>
> All zeroes can't possibly be right. Can you try the attached program?
>
> Unpack and run ./testjoystick, and it'll show you all the joysticks it sees.
> Run ./testgamecontroller with and without your SDL_GAMECONTROLLERCONFIG
> string and see what it says.
>
> --ryan.
(In reply to comment #13)
> Created attachment 3335[details]
> test programs for game controllers
>
> (In reply to comment #9)
> > SDL_HINT_GAMECONTROLLERCONFIG="00000000000000000000000000000000,
>
> All zeroes can't possibly be right. Can you try the attached program?
>
> Unpack and run ./testjoystick, and it'll show you all the joysticks it sees.
> Run ./testgamecontroller with and without your SDL_GAMECONTROLLERCONFIG
> string and see what it says.
>
> --ryan.
I tried to download attachment but my browser detects an invalid redirection. Am I the only one with this issue ?
You are doing it wrong I have downloaded the attachment and it works too. Whatever if you are using steam you can add the game with "Add non-steam game" after adding the game connect your controller and go to steam big picture mod. In this mode from settings make your contoller configurations. After that you can start dungeon defenders from steam big picture mod. Sometimes controller do not work i don't know why but in these cases restart the game from steam. If you don't have steam you should find the testjoystick it can be also found internet. But i suggest you to use steam it is much eiseir and dungeon defenders soon will be avaible on steam too. I wonder where can I find beta test key ? Maybe --ryan helps??
(In reply to comment #14)
> Start button works and A works, but can't move menu around (can't pick play
> single player, stuck on Quit Game)
I can confirm this, I have the same behavior. For me it seems to only affect the main menu. I can join the controller as player two in a local game. Once the game has started all the buttons/axis map correctly and I can even navigate in the pause menu with the controller.
(In reply to comment #18)
> (In reply to comment #14)
> > Start button works and A works, but can't move menu around (can't pick play
> > single player, stuck on Quit Game)
>
> I can confirm this, I have the same behavior. For me it seems to only affect
> the main menu. I can join the controller as player two in a local game. Once
> the game has started all the buttons/axis map correctly and I can even
> navigate in the pause menu with the controller.
Have you tried the d-pad instead of the thumb sticks on the main menu?
(It's possible we need a larger deadzone for the thumb sticks, though, and they are accidentally pushing around. Try wiggling them a little.)
--ryan.
Yes Ryan you are right D-pad works correctly but game does not respect mode button on the controller when in menus you can use both in the menu regardless of mode button. But after manage to start game you can navigate freely in the game menus without a problem so I don't think there is a Dead Zone problem. After starting game and exitting to main menu will work for navigating with controller in game menus flawlessly.
(In reply to comment #19)
> Have you tried the d-pad instead of the thumb sticks on the main menu?
>
> (It's possible we need a larger deadzone for the thumb sticks, though, and
> they are accidentally pushing around. Try wiggling them a little.)
The D-pad works correctly in game play but not in the main menu.
(In reply to comment #20)
> After starting game and exitting to main menu will work for
> navigating with controller in game menus flawlessly.
This does not happen for me, if I exit to the main menu the controller will still not work there.
Thanks. I was able to make it work with your test tools and enviroment variable.
I had the same problem as the people above me with menu selections stucked and camera moving by itself.
Obviously a deadzone problem i thought. I tried messing around a bit with xboxdrv settings but the bahaviour was very strange.
I finally falled back to stock xpad kernel module and even tho the menu problem is here, it dissapears once you get in-game and fiddle with the sticks a bit.
You don't have to use export command with steam. You should make your controller configs in big picture mode from settings. After that I suggest you to re-open steam and start the game in big picture mode. Mine worked well with steam version of the game.
Ok, using big picture mode made the controllers start responding, but the sticks and dpad are basically stuck. I try to move to another menu option and it goes back to quit.
Was able to get past the menu using the mouse, but when I started the game, the controller characters kept spinning endlessly without any input from the controls.
Seems to work now, but only for one controller type at a time.
Is there a way to use two different kinds of controllers at the same time?
Haven't managed to get this to work, even though even Steam recognises all of the controllers, or is this a Steam <-> SDL communication issue?
(In reply to comment #28)
> Seems to work now, but only for one controller type at a time.
>
> Is there a way to use two different kinds of controllers at the same time?
>
> Haven't managed to get this to work, even though even Steam recognises all
> of the controllers, or is this a Steam <-> SDL communication issue?
Nevermind, I got this to work by recompiling SDL with strings for the joypads I have.
Thanks for the good work. :)
Can you write a "HOW TO" to here. I am thinking to buy a second controller for this game and I thought steam could handle this easly. But this was not the case as I understood.
(In reply to comment #29)
> (In reply to comment #28)
> > Seems to work now, but only for one controller type at a time.
> >
> > Is there a way to use two different kinds of controllers at the same time?
> >
> > Haven't managed to get this to work, even though even Steam recognises all
> > of the controllers, or is this a Steam <-> SDL communication issue?
>
> Nevermind, I got this to work by recompiling SDL with strings for the
> joypads I have.
>
> Thanks for the good work. :)
Could you show how you did this? I can trying to use two controllers with no luck so far.
Also, I was able to get into the character selection menu by using my keyboard for the first player, but I would like to be able to use just two controllers. If I try to navigate the main menu with the controller, it never moves to any of the options whether I use the sticks or dpad. Once inside the character select I can select a keyboard user and then select a controller user.
Well, here is a quick howto, I'm not going to write more detailed one -- not here at least, since this technically isn't a fix for any issue with Dungeon Defenders, but one with SDL's gamecontroller support. If you need more instructions, I suggest you ask SDL forums, which is more appropriate place for this.
But anyways, I already am writing something, so might as well:
If you just want to see the changes I made to the library, I submitted a patch here: http://bugzilla.libsdl.org/show_bug.cgi?id=1783
First, you need to make sure you can compile 32-bit libraries.
Get SDL 2.0 source code from Mercurial repository. (http://www.libsdl.org/hg.php)
Find SDL_gamecontroller.c (IIRC it is in src/joystick)
Find lines under #elif defined(__LINUX__) with long lines like this one:
"030000005e0400008e02000014010000,X360 controller,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5"
Find out your controller's uuid (use the test program previously attached to this thread or something)
Copy the line and replace the new line's value before the first comma with your controller's uuid. Then the rest of the line just tells where each button is. b0 refers to your controllers button 0 (use Steam big picture mode or something to find out what number is assigned to your controller's buttons, or just guess at random), a0 refers to axis 0, h0.1 etc. refer to directional pad values (they're the same with most controllers, so you don't probably need to change them)
Compile SDL with the changes.
Backup your old SDL libraries, whether they are under steam runtime or in the system or wherever non-steam Dungeon Defenders keeps libraries it uses.
Replace the library with the one you just compiled and the controllers should work.
> Ok thanks. I'll take a look at that. Did this fix the controller not working
> in the main menu for you?
I didn't have such a problem in the first place, beats me.
You're able to use two controllers (no keyboard & mouse)?
Have is been tried on wireless 360 controllers? That did work for me on the pc version
(In reply to comment #37)
> (In reply to comment #36)
> > Anything new here?
>
> It works here with a wired 360 controller, so I don't have anything new to
> report.
>
> --ryan.
Any news here?
I use xboxdrv in mimic-xpad mode and have the same problem.
In the main menu cursor stuck on "quit" button. So I can't navigate at all =(
Any new news? Being able to use two controllers would be great.
Right now, I can use one controller just fine, the menu is a bit messed up but if I hold the right stick in the direction I want to go, then I can pick the menu options.
The second controller doesn't work though (also a 360 controller). I hit the start button on it, and other buttons but nothing happens.
I'm also seeing a controller mess up the menu (HIB build). I think it might be caused by some controller events being interpreted as keyboard input: if I make a local game with player one as keyboard+mouse and the second as the controller, player two's character responds correctly to controller input, but the same input input also makes player one's character do (different) things. I have made all gamepad input devices floating with 'xinput float' (if I don't, some trigger button axis sends core pointer events and moves the mouse :)
> Ok thanks. I'll take a look at that. Did this fix the controller not working > in the main menu for you? I didn't have such a problem in the first place, beats me.