Xinput for Love (Real Xbox controller support) BETA

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Charles Randall
Prole
Posts: 34
Joined: Wed May 09, 2012 2:52 pm

Re: Xinput for Love (Real Xbox controller support) ALPHA

Post by Charles Randall »

Nixola wrote:Didn't he add a new module, instead of replacing love.joystick?
Right now it works with love.joystick but that is just temporary for testing.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Xinput for Love (Real Xbox controller support) ALPHA

Post by Lafolie »

I would love to test it but unfortunately (or fortunately if you look at it in other ways) I don't use Windows.

I checked the SDL site a year ago or so, and there was an api for haptics, though I think it was a planned feature. When it finally gets revised we will hopefully have this feature. Until then I hope your module serves us well :)
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
Charles Randall
Prole
Posts: 34
Joined: Wed May 09, 2012 2:52 pm

Re: Xinput for Love (Real Xbox controller support) ALPHA

Post by Charles Randall »

Lafolie wrote:I would love to test it but unfortunately (or fortunately if you look at it in other ways) I don't use Windows.
Ah. Yeah, my hands are kind of tied since Xinput is windows only. If there were mac libs, I could conceivably do a version for that too, since I have a macbook pro, but I wouldn't be able to test/dev Linux.

But a quick google shows there is a driver for Mac which enables the 360 controller to work. If that's true and it's built to allow the triggers to work as independent axes, then using the standard love.joystick should be perfectly acceptable for that.
User avatar
Charles Randall
Prole
Posts: 34
Joined: Wed May 09, 2012 2:52 pm

Re: Xinput for Love (Real Xbox controller support) ALPHA

Post by Charles Randall »

So just for a bit of background, one of the big reasons why I'm so gung-ho about xbox controllers is that it provides a standard interface that is known. When people use random controllers, the onus is on the gamer to configure his buttons. In Love that's extra painful because it means that people have to implement their own controller remapping, which a lot of people won't bother doing. So maybe you get a gamer who grabs your game and he just uses whatever random joystick he has, and then his buttons are strange and he has a poor experience. Or even worse, your game doesn't support remapping, and he simply chooses not to play instead.

Unacceptable.

With the XInput libs, you are guaranteed a level of consistency, with a controller that is fairly common, on the platform that is the most common. It's a boon that shouldn't be ignored. And if you are gaming on a different platform, well, if I keep API compatibility, then it's just a simple swap-in and other platforms can still play, with the caveats that previously existed *anyway*.

Even if you are developing on other platforms, given the multiplatform nature of Love2d, it makes sense to think about your most common gamer scenario.
User avatar
Charles Randall
Prole
Posts: 34
Joined: Wed May 09, 2012 2:52 pm

Re: Xinput for Love (Real Xbox controller support) ALPHA

Post by Charles Randall »

Oh, and as a side project to this, I'm working on a lua library that will smooth out some of those issues, such as supporting controller remapping via config file, button naming, etc, so that you can have a relatively controller-independent game implementation, and use it so that you can make sure to provide the most consistent experience possible to your players.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Xinput for Love (Real Xbox controller support) ALPHA

Post by bartbes »

Stop double-posting (or triple-posting), please.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Xinput for Love (Real Xbox controller support) ALPHA

Post by Lafolie »

This is the de facto xbox controller driver for mac. I've been using it for years.

Image
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
Charles Randall
Prole
Posts: 34
Joined: Wed May 09, 2012 2:52 pm

Re: Xinput for Love (Real Xbox controller support) ALPHA

Post by Charles Randall »

I gave that a whirl. It does recognize the triggers independently, but the rest of its functionality is super strange. Don't know if that's SDL's fault or not, but it will be something I'll look into.

I've been pointed out to how to make a dll that can be included in the game, so that's the route I'll take for the windows version. Will try and get it done for next weekend, but I'll be rather busy so it might not make it that quickly.

Ideally for the mac version what I'll do is explore that driver and see if there's a way I can know that I'm using a device from that driver, and if so, make my xinput libs work identical to how they'd work on windows, via whatever kind of remapping is necessary. Then at least I'll have mac and PC covered.

After that, if someone wants to work with me to get a linux version working, that would be ideal. Since I'm developing everything on github anyway, if someone wants to join in I can easily give them repo access.
User avatar
Charles Randall
Prole
Posts: 34
Joined: Wed May 09, 2012 2:52 pm

Re: Xinput for Love (Real Xbox controller support) BETA

Post by Charles Randall »

Hey all, beta version is now available as a standalone DLL module.

Repo: https://github.com/mrcharles/XInputLUA

Update test app: https://github.com/mrcharles/love2d-x360-test

If you can't build XInputLUA yourself, you can grab the DLL from the test app.

This is a beta release, I'm sure there are issues. Primarily is that I have yet to test it with non-360 controllers. :)

Anyone willing to try it out, please post in this thread and let me know if any issues. Thanks!
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Xinput for Love (Real Xbox controller support) ALPHA

Post by slime »

I'll try this out as soon as I can! It's been kind of a pain trying to make gamepad controllers work nicely with my game.
Lafolie wrote:This is the de facto xbox controller driver for mac. I've been using it for years.

Image
It's worth noting that the driver's button mappings are different (and currently unconfigurable) compared to the native Windows driver mappings.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], dusoft, Google [Bot] and 12 guests