Bug 5525 - Joypad doesn't work
Status: RESOLVED FIXED
Alias: None
Product: Psychonauts
Classification: Unclassified
Component: everything
Version: unspecified
Hardware: PC Linux
: P3 normal
Assignee: Ryan C. Gordon
QA Contact: Ryan C. Gordon
URL:
Depends on:
Blocks:
 
Reported: 2012-05-31 17:05 EDT by Daniel Gibson
Modified: 2012-06-20 23:34:27 EDT
7 users (show)

See Also:



Description Daniel Gibson 2012-05-31 17:05:20 EDT
I've got a "GreenAsia Inc.    USB Joystick" (PS2 Joypad with adapter), that generally works with Linux (jstest and jscal).

OS: Debian Squeeze AMD64 with Kernel 2.6.39 from backports.

I can't use it in Psychonauts, can't move and the buttons don't work either (not even in the bindings menu).

I tried starting Psychonauts with
SDL_JOYSTICK_DEVICE="/dev/input/js0" ./Psychonauts
didn't help either.


PS: Thanks for porting this awesome game to Linux :-)
Comment 1 ifyoudieinthegameyoudieforreal 2012-05-31 18:39:34 EDT
I'm having this problem as well. I'm using a Dualshock 3 controller attached via USB, which works with all other games that have joystick support on Linux. Events are read from /dev/input/js0 , which is a standard joystick location on Linux.

Likewise, thank you for porting this game to Linux! I love the Humble Bundle, and, although I've enjoyed watching my friends play through the game, this will be my first time!

-David
Comment 2 Mathieu Comandon 2012-05-31 20:21:36 EDT
I don't think it's implemented right now. If you run the game from a console you can clearly see : 
STUBBED: write me at GetJoystickInput (/home/icculus/projects/psychonauts/Source/CommonLibs/DirectX/SDLInput.cpp:428)
STUBBED: write me at GetJoystickActionValue (/home/icculus/projects/psychonauts/Source/CommonLibs/DirectX/SDLInput.cpp:613)

Given these messages, I'm guessing that the joystick input handling has to be ported from DirectX to SDL.
Hoping for an update soon :)
Comment 3 Ryan C. Gordon 2012-06-01 23:58:22 EDT
That's the danger of leaving the STUBBED messages in the build.  :)

We'll fix joystick support for the next build.

--ryan.
Comment 4 Ryan C. Gordon 2012-06-03 05:48:07 EDT
(I'm adding this comment to several bugs here...sorry if you see it multiple times.)

There were some memory corruption bugs in the initial Humble Bundle build, which we believe have been tracked down and fixed now. Most of the crashes are probably due to these.

Those getting Floating Point Exception crashes during cutscenes: that was my fault, I screwed up something hooking up the Bink audio output code. This is also fixed, I think.

Here is a test build, please try it and report back. It's a 2.1 megabyte download: just untar it and overwrite the two files in your game installation.

This build also has joystick support and working FSAA (if the game is way slower for you, you can turn off FSAA in the options menu).

There are still some bugs, but this should be MUCH more playable.

Download it here:

   http://treefort.icculus.org/psychonauts/psychonuts-linux-test-06032012.tar.bz2

We'll do a more formal build once we get some feedback.

--ryan.
Comment 5 Daniel "koolfy" Faucon 2012-06-03 09:43:14 EDT
I can confirm that the http://treefort.icculus.org/psychonauts/psychonuts-linux-test-06032012.tar.bz2 patch fixes any issue with the Joypad as far as I can tell.


(it also fixes a lot of crashed with the cutscenes, but let's keep in topic here)


I suggest you set it to FIXED.
Comment 6 Sam Listopad 2012-06-03 15:50:27 EDT
I can also attest this allows gamepad usage.

The only slight gripe I have is that the xpad driver for xbox controllers marks each shoulder as a full axis, so when you are not pressing them the games always thinks the shoulder axes are the ones you are pushing.  So to set bindings for anything else you have to half depress the shoulder axes while setting to what you really want.  Just a little annoying is all.
Comment 7 Ryan C. Gordon 2012-06-03 16:45:13 EDT
(In reply to comment #6)
> I can also attest this allows gamepad usage.
> 
> The only slight gripe I have is that the xpad driver for xbox controllers marks
> each shoulder as a full axis, so when you are not pressing them the games
> always thinks the shoulder axes are the ones you are pushing.  So to set
> bindings for anything else you have to half depress the shoulder axes while
> setting to what you really want.  Just a little annoying is all.

This drives me crazy on every game; I wish the drivers would scale those trigger buttons so they work like a normal joystick axis.

The game currently looks for a joystick named "Microsoft X-Box 360 pad" and treats those triggers more sanely, but I assume there are variants that I don't check for (MadCatz, for example, makes a 360-compatible controller, but it probably has a different device name). If you can tell me what your gamepad is reporting its name to be, I can try to do the same for it.

--ryan.
Comment 8 Sam Listopad 2012-06-04 00:07:18 EDT
The pad is a Logitech F510.

The name,  I'm not sure where I can find the one you would see.  I may write something tomorrow,  however from jstest-gtk I get a name of "Generic X-Box pad"
Comment 9 Ryan C. Gordon 2012-06-04 05:51:31 EDT
(In reply to comment #8)
> The name,  I'm not sure where I can find the one you would see.  I may write
> something tomorrow,  however from jstest-gtk I get a name of "Generic X-Box
> pad"

I've added this name...hopefully this will magically fix the problem in the next build.

--ryan.
Comment 10 Arne Döring 2012-06-04 15:48:24 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > I can also attest this allows gamepad usage.
> > 
> > The only slight gripe I have is that the xpad driver for xbox controllers marks
> > each shoulder as a full axis, so when you are not pressing them the games
> > always thinks the shoulder axes are the ones you are pushing.  So to set
> > bindings for anything else you have to half depress the shoulder axes while
> > setting to what you really want.  Just a little annoying is all.
> 
> This drives me crazy on every game; I wish the drivers would scale those
> trigger buttons so they work like a normal joystick axis.
> 
> The game currently looks for a joystick named "Microsoft X-Box 360 pad" and
> treats those triggers more sanely, but I assume there are variants that I don't
> check for (MadCatz, for example, makes a 360-compatible controller, but it
> probably has a different device name). If you can tell me what your gamepad is
> reporting its name to be, I can try to do the same for it.
> 
> --ryan.

My WingMan Cordless Rumblepad has the same issue, it has one speed control "thing" that has it zero exactly in the middle. Even worse it is with the PS3 controller where every button incluting all directions of the D-Pad are recognized as full axes additionally. This often leads to some conflicts if you want to assign them to actions, because many events are triggered at the same time. Normally I use my PS2 controller with adapter, because it is the least annoying.
Comment 11 James Reed 2012-06-06 20:35:42 EDT
(In reply to comment #9)
> (In reply to comment #8)
> > The name,  I'm not sure where I can find the one you would see.  I may write
> > something tomorrow,  however from jstest-gtk I get a name of "Generic X-Box
> > pad"
> 
> I've added this name...hopefully this will magically fix the problem in the
> next build.
> 
> --ryan.

Please add "Mad Catz Wired Xbox 360 Controller" to your list.
Comment 12 Cyprian Guerra 2012-06-07 15:08:32 EDT
I can confirm gamepads work fine now, at least the two I own: "GreenAsia Inc. USB Joystick" and "GreenAsia Inc. USB Wireless 2.4GHz Gamepad". No clue about x-box compatible controllers. From my point of view the issue's solved, thank you. Removing myself from CC list but if you need any more testing I'm available.
Comment 13 M8R-3sdkgg 2012-06-09 16:24:55 EDT
Microsoft X-Box 360 pad here. I was trying to set up the controls like they are if you play this on an X-Box 360, but I couldn't assign the triggers to functions since they are axes instead of buttons. Is there some way, and if not, could there be? They are major controls and pretty useless like this :(

It would also be a nice touch if the dpad as well as the left stick would work for navigating the menu, and as it is options can only be navigated with mouse.
Comment 14 Sam Listopad 2012-06-10 18:51:37 EDT
I found a decent solution in linux.  There is a driver called xboxdrv, which is a user space based driver for the xbox pads mainly.  It can make the triggers act as buttons.  As another bonus it has wireless controllers dpad setup as the hat access, which the xpad driver does not do (sets it up as 4 buttons).

The main page for xboxdrv is http://pingus.seul.org/~grumbel/xboxdrv/
Comment 15 Ryan C. Gordon 2012-06-20 11:49:18 EDT
(I'm adding this comment to many bugs that this fix might apply to...sorry if you see it multiple times or it doesn't _actually_ fix your issue.)

Here is a new test build, please try it and report back. It's a 2.1 megabyte
download, so you don't have to redownload the whole game again.

This is meant to fix crash bugs mostly. We still have rendering issues, etc to sort out. If this didn't fix your issue, please report it on this bug. If there are still other unrelated issues, please file a new bug or add yourself to the CC list of one of the other bugs. Here's the open bug list if you want to check for others with the same problem:

    https://bugzilla.icculus.org/buglist.cgi?query_format=specific&bug_status=__open__&product=Psychonauts

Steam users: you'll get this through Steam shortly.

Linux users, download this...

  http://treefort.icculus.org/psychonauts/psychonauts-linux-0.3-patch.tar.bz2

...and unpack it. Overwrite Psychonauts and libSDL-1.2.so.0 with it. This works with either of the first two builds from HumbleBundle.com.

Mac users that aren't using Steam, download this...

  http://treefort.icculus.org/psychonauts/psychonauts-mac-0.3-patch.tar.bz2

...double click it, and run the patcher program it produces.

We'll do a more formal build once we get some feedback.

--ryan.
Comment 16 Ryan C. Gordon 2012-06-20 23:34:27 EDT
I'm resolving this bug, as joystick support is in the game at this point; general fruity game controllers can be remapped to something sane with third party utilities.

--ryan.