shmups.system11.org

Shmups Forum
 
* FAQ    * Search
 * Register  * Login 
It is currently Mon Jul 06, 2020 1:02 pm View unanswered posts
View active topics



Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Sat Jun 27, 2020 7:59 pm 


User avatar

Joined: 26 Mar 2006
Posts: 2633
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.


Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Sat Jun 27, 2020 8:22 pm 


User avatar

Joined: 29 Jul 2014
Posts: 703
Location: Florida, Estados Unidos
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


Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Sat Jun 27, 2020 10:36 pm 


User avatar

Joined: 26 Jan 2005
Posts: 12570
Location: Wherever.
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.
_________________
"Fight me IRL if you want to man up so badly."
Glossary / Discussion / The Bizaar / Vasara HS


Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Sat Jun 27, 2020 10:53 pm 


User avatar

Joined: 28 Jan 2005
Posts: 1474
Location: USH
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.


Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Sat Jun 27, 2020 11:59 pm 


User avatar

Joined: 15 Dec 2007
Posts: 3463
Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
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:
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.
_________________
eyesoul, an uncomfortably euroshmup-like game I made. :P
Rolling Start arcade racing game forum.


Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Sun Jun 28, 2020 12:10 am 


User avatar

Joined: 26 Mar 2006
Posts: 2633
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:
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:
export SDL_JOYSTICK_DEVICE=/dev/input/js0


Make sure you reset if afterwards:
Code:
unset SDL_JOYSTICK_DEVICE



And here is the bright guy who wrecked it.
Quote:
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.
_________________
Some of the best shmups don't actually end in a vowel.
No, this game is not Space Invaders.


Last edited by Pixel_Outlaw on Sun Jun 28, 2020 1:49 am, edited 1 time in total.

Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Sun Jun 28, 2020 1:21 am 


User avatar

Joined: 20 Aug 2016
Posts: 1681
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


Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Sun Jun 28, 2020 1:50 am 


User avatar

Joined: 26 Mar 2006
Posts: 2633
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.


Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Sun Jun 28, 2020 11:41 pm 


User avatar

Joined: 28 Jan 2005
Posts: 1474
Location: USH
found this: https://www.x360ce.com/

It appears to have fixed Memories of Celceta at least


Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Mon Jun 29, 2020 7:23 pm 


User avatar

Joined: 12 Aug 2009
Posts: 1994
Location: Minnesota, USA
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.


Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Mon Jun 29, 2020 9:03 pm 


User avatar

Joined: 15 Dec 2007
Posts: 3463
Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
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:
//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
_________________
eyesoul, an uncomfortably euroshmup-like game I made. :P
Rolling Start arcade racing game forum.


Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Mon Jun 29, 2020 10:37 pm 


User avatar

Joined: 26 Mar 2006
Posts: 2633
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.


Top
 Offline Profile  
 
 Post subject: Re: Modern Indie Games Ignoring 2nd Party Controllers?
PostPosted: Thu Jul 02, 2020 7:34 am 


User avatar

Joined: 26 Jul 2009
Posts: 7225
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


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: BIL, Ebbo, Mischief Maker and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Space Pilot 3K template by Jakob Persson
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group