Modern Indie Games Ignoring 2nd Party Controllers?

A place where you can chat about anything that isn't to do with games!
Post Reply
User avatar
Pixel_Outlaw
Posts: 2636
Joined: Sun Mar 26, 2006 3:27 am

Modern Indie Games Ignoring 2nd Party Controllers?

Post by Pixel_Outlaw »

Has anyone noticed that a lot of Steam games these days won't work with any offbrand/custom joysticks or controllers?
From what I can gather a lot of it stems from games using SDL 2's (abomination) of a controller interface which essentially is a whitelist of controllers it supports.

Just need to vent my frustrations.
I have a joystick I've built which my OS sees just fine but a lot of games won't detect it because it's not made by Sony, Microsoft, or Logitech.
A few years ago in the SDL 1 days, if your OS saw a controller, a game made in SDL generally let you use it.

This whitelisting controllers and making custom SDL 2 mappings to map button 0 and such to "X" needs to stop.
Some of the best shmups don't actually end in a vowel.
No, this game is not Space Invaders.
User avatar
mamboFoxtrot
Posts: 745
Joined: Tue Jul 29, 2014 3:44 am
Location: Florida, Estados Unidos

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by mamboFoxtrot »

oh, is that what the issue is? I had always chalked it up to just being a D-Input vs X-Input thing :oops:

at least with Steam games now it seems like you can use Steam's universal controller settings thing to make it work, though sometimes with these budget doujin games I get the opposite issue where I have to turn all that "modernizing" off lol

though the most baffling thing I encountered from an indie game was Shantae: Pirate's Curse not supporting my older controller, but also somehow actively blocking joy2key :shock: its like damn y'all really don't want me playin this
User avatar
BulletMagnet
Posts: 13897
Joined: Wed Jan 26, 2005 4:05 am
Location: Wherever.
Contact:

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by BulletMagnet »

mamboFoxtrot wrote:though the most baffling thing I encountered from an indie game was Shantae: Pirate's Curse not supporting my older controller, but also somehow actively blocking joy2key :shock: its like damn y'all really don't want me playin this
I believe the default controller for that one is a wig with a USB plug on it that you have to whip around by moving your neck IRL.
User avatar
ED-057
Posts: 1560
Joined: Fri Jan 28, 2005 7:21 am
Location: USH

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by ED-057 »

Yes I've had a few rants about this, several games from gog have the same problem. They assume a certain a controller, don't specify that in the system requirements, don't have proper reconfig for controls, and can't be tamed using joy2key. So I either use keyboard+mouse or don't play at all.

I was starting to wonder if there is some other workaround out there (like a special joystick driver or something) to work around this bit of developer retardation, but I haven't gotten around to investigating it yet.
User avatar
null1024
Posts: 3810
Joined: Sat Dec 15, 2007 8:52 pm
Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
Contact:

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by null1024 »

SDL's new controller API is basically just XInput. The whitelist is a set of non-XInput controllers that have had mappings submitted.
https://wiki.libsdl.org/CategoryGameController
Steam's "generic gamepad configuration support" outright creates the required mappings, though. Non-Steam games should be able to load external mapping sets with a line like the following in the source:

Code: Select all

SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");
...but many don't.

Also, fuck XInput, which has drastically shrunk the amount of useful gamepads available.
A lot of games in general don't support non-XInput controllers these days.
That wouldn't even be so bad if Windows had a system-wide remapping thing, but it doesn't, which is absurd.
API changes shouldn't require entirely new hardware.
Come check out my website, I guess. Random stuff I've worked on over the last two decades.
User avatar
Pixel_Outlaw
Posts: 2636
Joined: Sun Mar 26, 2006 3:27 am

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by Pixel_Outlaw »

null1024 wrote:SDL's new controller API is basically just XInput. The whitelist is a set of non-XInput controllers that have had mappings submitted.
https://wiki.libsdl.org/CategoryGameController
Steam's "generic gamepad configuration support" outright creates the required mappings, though. Non-Steam games should be able to load external mapping sets with a line like the following in the source:

Code: Select all

SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");
...but many don't.

Also, fuck XInput, which has drastically shrunk the amount of useful gamepads available.
A lot of games in general don't support non-XInput controllers these days.

That is similar to what I found too.
For others on Linux you might try the following line before calling steam.
It seems that they've removed the traditional way of reading controllers.

Code: Select all

export SDL_JOYSTICK_DEVICE=/dev/input/js0
Make sure you reset if afterwards:

Code: Select all

unset SDL_JOYSTICK_DEVICE

And here is the bright guy who wrecked it.
SDL2 code skips over the non event* named files in /dev/inpuot
changeset: 6729:fdaeea9e7567
date: Tue Dec 11 11:07:48 2012 -0500
summary: Removed old Linux joystick API (/dev/js*).

changeset: 6728:0f8336c1f6d9
date: Mon Dec 10 15:50:42 2012 -0500
summary: Removed the "logical" Linux joystick code.
Last edited by Pixel_Outlaw on Sun Jun 28, 2020 1:49 am, edited 1 time in total.
Some of the best shmups don't actually end in a vowel.
No, this game is not Space Invaders.
User avatar
orange808
Posts: 3208
Joined: Sat Aug 20, 2016 5:43 am

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by orange808 »

I've disagreed with lots of decisions, committs, and reverts over the years, but I'm not sure that posting the guy's contact info will help.

Gordon didn't act unilaterally.
We apologise for the inconvenience
User avatar
Pixel_Outlaw
Posts: 2636
Joined: Sun Mar 26, 2006 3:27 am

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by Pixel_Outlaw »

orange808 wrote:I've disagreed with lots of decisions, committs, and reverts over the years, but I'm not sure that posting the guy's contact info will help.

Gordon didn't act unilaterally.
Fair enough. I redacted the contact information.
People have the change ID there they can research it and contact him.
Some of the best shmups don't actually end in a vowel.
No, this game is not Space Invaders.
User avatar
ED-057
Posts: 1560
Joined: Fri Jan 28, 2005 7:21 am
Location: USH

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by ED-057 »

found this: https://www.x360ce.com/

It appears to have fixed Memories of Celceta at least
User avatar
Jeneki
Posts: 2507
Joined: Wed Aug 12, 2009 4:56 pm
Location: Minnesota, USA

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by Jeneki »

My biggest complaint is when only analog stick is supported, with the D-Pad is completely ignored and can't be assigned to anything. Is there some extra challenge in using the D-Pad on modern controllers that makes it so difficult to enable?

There are far too many 2D indie games that would benefit from using D-Pad to move, but nope, you must use the analog stick for whatever reason.
Typos caused by cat on keyboard.
User avatar
null1024
Posts: 3810
Joined: Sat Dec 15, 2007 8:52 pm
Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
Contact:

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by null1024 »

Jeneki wrote:My biggest complaint is when only analog stick is supported, with the D-Pad is completely ignored and can't be assigned to anything. Is there some extra challenge in using the D-Pad on modern controllers that makes it so difficult to enable?

There are far too many 2D indie games that would benefit from using D-Pad to move, but nope, you must use the analog stick for whatever reason.
It's almost entirely the fact that the D-pad has an entirely different API interface vs the sticks. This isn't too hard to fix, but it's a bit tedious, especially if your code just assumes analog stick values everywhere.

as a dev, you need to do something like this [this is with the SDL2 "joystick" API, it'd look a bit different with the "controller" API]:

Code: Select all

//CC0, use freely
//caveat emptor: none of this is tested

//pretends the dpad is an analog stick, get the x axis:
//you can muck about with this for proper sqrt(2)*distance diagonals but whatever, don't trust the analog stick to be a circle gate anyway
//this is a little simpler with the "controller" API since dpad inputs are just individual buttons there (eg, SDL_CONTROLLER_BUTTON_DPAD_UP/DOWN/LEFT/RIGHT)
int get_dpad_x(SDL_Joystick *joy) {
  Uint8 hat = SDL_JoystickGetHat(joy,0);
  if (hat == SDL_HAT_LEFT || hat == SDL_HAT_LEFTUP || hat == SDL_HAT_LEFTDOWN) {
    return -32767; //might have gotten this exactly backwards, but one goes up, the other goes down
  }
  if (hat == SDL_HAT_RIGHT || hat == SDL_HAT_RIGHTUP || hat == SDL_HAT_RIGHTDOWN) {
    return 32767;
  }
  return 0;
}

//pretends the dpad is an analog stick, get the y axis:
int get_dpad_y(SDL_Joystick *joy) {
  Uint8 hat = SDL_JoystickGetHat(joy,1);
  if (hat == SDL_HAT_UP || hat == SDL_HAT_LEFTUP || hat == SDL_HAT_RIGHTUP) {
    return -32767;
  }
  if (hat == SDL_HAT_DOWN || hat == SDL_HAT_LEFTDOWN || hat == SDL_HAT_RIGHTDOWN) {
    return 32767;
  }
  return 0;
}

//these are what you'd use in your game code, probably replacing a bunch of SDL_JoystickGetAxis calls
//this pretends the two entirely separate inputs are one
//there's several ways to do this, but here, we prioritize d-pad inputs if given for each direction
int get_input_dir_x(SDL_Joystick *joy) {
  int dir=get_dpad_x(joy);
  if (dir!=0) { return dir; } //if d-pad is pressed, return it
  return SDL_JoystickGetAxis(joy, 0); //otherwise, read the stick position
}
int get_input_dir_y(SDL_Joystick *joy) {
  int dir=get_dpad_y(joy);
  if (dir!=0) { return dir; }
  return SDL_JoystickGetAxis(joy, 1);
}
this code muxes the two as one input, but you could change the "if (dir!=0)" checks to be some kind of external select for which to use for directions
you'd replace all the direct analog stick checks with calls to get_input_dir_x/y
Come check out my website, I guess. Random stuff I've worked on over the last two decades.
User avatar
Pixel_Outlaw
Posts: 2636
Joined: Sun Mar 26, 2006 3:27 am

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by Pixel_Outlaw »

Jeneki wrote:My biggest complaint is when only analog stick is supported, with the D-Pad is completely ignored and can't be assigned to anything. Is there some extra challenge in using the D-Pad on modern controllers that makes it so difficult to enable?

There are far too many 2D indie games that would benefit from using D-Pad to move, but nope, you must use the analog stick for whatever reason.
It's pretty annoying.
Mostly because they've not put serious time into a dpad and the analog stick /seems/ more encompassing and precise.
In actuality it's slower (more throw) and more imprecise (too many possible directions = inconsistent input)
Some of the best shmups don't actually end in a vowel.
No, this game is not Space Invaders.
User avatar
Obiwanshinobi
Posts: 7463
Joined: Sun Jul 26, 2009 1:14 am

Re: Modern Indie Games Ignoring 2nd Party Controllers?

Post by Obiwanshinobi »

So fucking gash it sounds that I DON'T wanna upgrade from WinXP Pro for a lil' bit longer, again. Even ports from PS2-era consoles, typically troubled in MANY a way (say, MGS2: Substance) would, in general, respect your average USB controller/adapter. Reverse horizontal camera movement in Billy Hatcher and the Giant Egg PC port was the worst I can put my finger on (and a far cry from being that port's biggest flaw).
The rear gate is closed down
The way out is cut off

Image
Post Reply