It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Hello folks. Sensing that Guacamelee will soon be available for Linux on GOG i taken my copy from Humble Bundle and checked it out. Its turned that Guacamelee have rather unpleasant way to deal with gamepads - its naturally supports ONLY XBOX controller.
However, in README there is some info about adding non-xbox gamepads:
-controlmapping <mapping>
Adds the SDL2 game controller mapping <mapping>. Mappings have the format "341a3608000000000000504944564944,AfterglowPS3Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h 0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a 0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7" and can be created for example with Steam Big Picture mode. The mapping should be enclosed in quotation marks and not have any space characters. Mappings are saved to game settings so they only need to be supplied once.

Not very obvious, right? And not very frindly to gamer, but still managable in manual way.
After some trial and error i got my Logitech ChillStream to work fine and want to share actual HOWTO with future gamers.

Ok, there is 3 steps to make mapping 1) getting correct gamepad ID, 2) getting gamepad name and 3) actual mapping

1) SDL2 (which is used by game) uses custom hard-to-understand ids, so we need this [url=https://bazaar.launchpad.net/~taktaktaktaktaktaktaktaktaktak/+junk/joystickguid/view/head:/joystickguid.rb]script[/url]

#!/usr/bin/env ruby

class JoystickGUID
EVIOCGID = 0x80084502

# Derive an SDL-style GUID from bus type, vendor, product, version
def JoystickGUID::ReadGUID(filename)
input = [0,0,0,0].pack('SSSS')
success = 0
File.open(filename, File::RDONLY|File::NONBLOCK){ |file|
success = file.ioctl(EVIOCGID, input)
}
bustype, vendor, product, version = input.unpack('SSSS')
if(0 != success || 0 == vendor || 0 == product || 0 == version) then return nil end
return format('%02x%02x0000%02x%02x0000%02x%02x0000%02x%02x0000', bustype & 0xFF, bustype >> 8,
vendor & 0xFF, vendor >> 8,
product & 0xFF, product >> 8,
version & 0xFF, version >> 8);
end
end

if(__FILE__ == $0)
if(1 != ARGV.length)
puts("Usage: #{$0} eventDevice")
exit
end

puts("#{ARGV[0]}: #{JoystickGUID::ReadGUID(ARGV[0])}")
end

Ofc, you need installed Ruby on your system to run.
Now, save it, make runnable and execute in console as root - sudo ./joystickguid.rb /dev/input/eventX
where X is number of event device to which your gamepad is referring.
Easiest way to get that number is to look in /dev/input/by-id/ directory for example, inmy case there is /dev/input/by-id/usb-Logitech_XUSB_Gamepad_9438A47A-event-joystick which is points to /dev/input/event6 so i need 6 instead of X

My output is /dev/input/event6: 030000006d04000042c2000001100000

2) Now, gamepad name. Thats easy used lsusb in console. I gettin string Bus 002 Device 004: ID 046d:c242 Logitech, Inc. as part of output - thats my gamepad.
And where is tricky part starts - normally i should input "Logitech, Inc." in mapping instead of AfterglowPS3Controller BUT Guacamelee dont expects to see extra period in gamepad name and interprets mapping as empty one. Removing that period from gamepad name dont helps either. Solution is simple - just dont fill it.
So, its 030000006d04000042c2000001100000,, for me.

3) And mapping. Thats easy. Install qjoypad package.
Run it in console. Once it ready push buttons and see results.
For example its
DEBUG: passing on a button event
DEBUG: 0 1
DEBUG: passing on a button event
DEBUG: 0 0
when i press A button on my gamepad, so i should use
a:b0 in mapping. Try all other buttons, triggers, sticks and fill mapping with correct values for YOUR joypad. For sticks AND triggers you will need axis numbers. Dont forget that in "leftx" is LEFT stick and that x is "horizontal" axis while "righty" is RIGHT stick and y is "vertical" axis.
Thats is "leftstick" then? On some gamepads sticks is actuall buttons too, you can push them down and heard click (button event detected in qjoypad too), these "buttons" is goes here. "guide" is big button between Select\Back and Start (on Xbox compatible gamepads).
(hint - dont change anything regarding dp* values - its should work as is, hopefully)
After you done you should run game from console with similar mapping
./game -controlmapping "030000006d04000042c2000001100000,,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,rig hty:a4,lefttrigger:a2,righttrigger:a5"
Thats actual mapping for my Logitech Chillstream, its works (for me) so should for you.
Hope it help.
P.S. Message for Guacamelee developers: Dammit, are you nuts?How its supposed to be obvious for games, just mentioning SDL2 in readme and nothing more?
Post edited July 26, 2014 by Redfern