Author Topic: jump3  (Read 102854 times)

aimaina

  • Administrator
  • Cutesterest
  • *****
  • Posts: 1320
  • Cutes: 211
    • View Profile
  • Pronouns: she/her
Re: jump3
« Reply #15 on: October 03, 2017, 11:50:14 AM »
i feel like theres so many things that could go wrong with this...... like what if a gamepad is in "slot 0" when you first configure it, but then the next day you plug it in and its in "slot 1" so everything doesnt work? is there any guarantee that if you only have one xinput gamepad plugged in, it will always be in "slot 0"? that would be nice but the manual doesnt say whether it works that way so idk if i have to do a bunch of weird bullshit to make gamepads work nicely
~Without love, the truth cannot be seen~

this is watermelon :watermelon: put her in your signature so she can achieve world domination

hubol

  • Cutesterest
  • ******
  • Posts: 1135
  • Cutes: 630
    • View Profile
    • hubolhubolhubol
Re: jump3
« Reply #16 on: October 03, 2017, 01:27:08 PM »
i feel like theres a lot of really bad possibilities for gamepad support. are u able to handle disconnects n shit too?

juner

  • Cuter
  • ***
  • Posts: 172
  • Cutes: 101
    • View Profile
Re: jump3
« Reply #17 on: October 03, 2017, 02:15:50 PM »
this blog post seems to suggest gamepads will usually be 0 indexed... doesn't say much about if you have multiple gamepads plugged in, whether they could change slots every time you reboot.

maybe on loading a new game, if any of the controls are assigned to a gamepad or multiple gamepads you could ask them to hit a button on the gamepads they want to use in order and then have a lil lookup table the slots? and also backup keyboard controls if they have no controller plugged in

i have a bunch of xinput/directx controllers so i can test weird edge case stuff if you need

vgperson

  • Cutest
  • ****
  • Posts: 258
  • Cutes: 110
  • guess i'll have to... make them fall.
    • View Profile
    • vgperson.com
Re: jump3
« Reply #18 on: October 03, 2017, 06:28:50 PM »
I think you can generally assume that people won't try to mix multiple gamepads in a single input set; it seems like way too much of an edge case for the headache it would be. I know in Unity the gamepad indices can completely change around with disconnects, and I can't imagine Game Maker would be much different in that regard. (Although Unity does lack a way of directly checking the "name" (i.e. "XBOX 360 Controller") of a specific gamepad, instead only offering an unpairable list of names, so GM might have an advantage there...)

All To Get Her just stores the basic button/axis names - which gamepad IDs it checks for those depends on the mode. The game assumes that the first gamepad to press anything was Player 1, although when you're in One-Player mode, it actually takes input from any gamepad, which is what you'd probably go with for a single-player game. If you try to enter Two-Player without it knowing what ID Player 2 is yet, it asks for manual calibration (Player 1 press a button, Player 2 press a button). It can also determine which player has which gamepad when they're used to make assignments in button config.

aimaina

  • Administrator
  • Cutesterest
  • *****
  • Posts: 1320
  • Cutes: 211
    • View Profile
  • Pronouns: she/her
Re: jump3
« Reply #19 on: October 03, 2017, 08:43:35 PM »
thanks for the commentz..... i think ill check for input from all gamepads like vg said, that seems like the nicest way to do it.... i actually already coded a (terrible) system for dealing with mixed inputs from multiple pads but itll probably break if gamepad indices change unexpectedly so ill just scrap it

one thing i havent implemented yet is "nice" names for buttons, like displaying "B" instead of "Button 1" if you are using a 360 controller.... vg how did you do that in atgh? what pads do you detect and how? im guessing if a pad name contains "xbox" (case insensitive) i can use xbox button names and if it contains "playstation" i can use playstation button names? i cant find a list of common gamepad names so im hoping theres nothing stupid like a playstation controller that just calls itself "dualshock" or something and doesnt have playstation in the name....
~Without love, the truth cannot be seen~

this is watermelon :watermelon: put her in your signature so she can achieve world domination

vgperson

  • Cutest
  • ****
  • Posts: 258
  • Cutes: 110
  • guess i'll have to... make them fall.
    • View Profile
    • vgperson.com
Re: jump3
« Reply #20 on: October 03, 2017, 09:10:51 PM »
Yeah, I have it check if the names match the two controllers I have (contains "XBOX 360" or "Logitech Dual Action"), and if so, it converts the button names. (It also uses this knowledge about the axes to help improve how analog control works, but 1/2, 3/4, etc. pairs for sticks may be a safe enough assumption for unknown types.) Because of the aforementioned Unity issue, it can't determine the type of a given controller when there's more than one type plugged in, which is why the user can change that setting manually.

I couldn't find anything on controller names I was willing to trust enough to use without actually owning the controller, but there are some mappings out there: 360, PS4. And I feel like it really might be safer to check for DualShock over Playstation? Or both.

aimaina

  • Administrator
  • Cutesterest
  • *****
  • Posts: 1320
  • Cutes: 211
    • View Profile
  • Pronouns: she/her
Re: jump3
« Reply #21 on: October 03, 2017, 09:32:36 PM »
oh game maker has nice gamepad constants like gp_face1 (A on 360 and X on ps), gp_axislh (left stick horizontal axis), gp_shoulderr (right shoulder button), gp_padd (d-pad down) so i dont need to worry about determining what like "button 5" or "axis 7" is for 360/ps controllers.... i just need to know whether im dealing with a 360/ps controller or some other thing

i think ill just detect xbox (360 and one, although i dont actually have an xbone controller to test with....) and ps controllers, and not worry about nice button names for other controllers....
~Without love, the truth cannot be seen~

this is watermelon :watermelon: put her in your signature so she can achieve world domination

aimaina

  • Administrator
  • Cutesterest
  • *****
  • Posts: 1320
  • Cutes: 211
    • View Profile
  • Pronouns: she/her
Re: jump3
« Reply #22 on: October 03, 2017, 10:03:20 PM »
oh no the dualshock 3 has "start" and "select" buttons, but on the dualshock 4, "start" is called "options" and "select" is activated by pressing the touchpad
~Without love, the truth cannot be seen~

this is watermelon :watermelon: put her in your signature so she can achieve world domination

aimaina

  • Administrator
  • Cutesterest
  • *****
  • Posts: 1320
  • Cutes: 211
    • View Profile
  • Pronouns: she/her
Re: jump3
« Reply #23 on: October 03, 2017, 10:15:47 PM »
lol i found some thread saying that the mapping between gm constants and playstation face buttons given in the docs is only correct if you are making an actual ps4 game, and its different if you are using a ps4 controller on windows..... gamepads are a nightmare

so i think i wont be supporting nice button names for playstation controllers.....
~Without love, the truth cannot be seen~

this is watermelon :watermelon: put her in your signature so she can achieve world domination

aimaina

  • Administrator
  • Cutesterest
  • *****
  • Posts: 1320
  • Cutes: 211
    • View Profile
  • Pronouns: she/her
Re: jump3
« Reply #24 on: October 03, 2017, 10:54:20 PM »
the gamepad adventure wouldnt be complete without bizarre differences in behaviour between windows and html5.....
~Without love, the truth cannot be seen~

this is watermelon :watermelon: put her in your signature so she can achieve world domination

aimaina

  • Administrator
  • Cutesterest
  • *****
  • Posts: 1320
  • Cutes: 211
    • View Profile
  • Pronouns: she/her
Re: jump3
« Reply #25 on: October 03, 2017, 11:17:03 PM »
on html5 my xbox controller is just called "xinput" instead of anything with xbox in the name..... it seem bad to treat anything called "xinput" as an xbox controller so i guess i cant provide nice button names for xbox controllers on html5.....

also my snes usb controller doesnt work on html5.... it doesnt detect up or left on the dpad
~Without love, the truth cannot be seen~

this is watermelon :watermelon: put her in your signature so she can achieve world domination

aimaina

  • Administrator
  • Cutesterest
  • *****
  • Posts: 1320
  • Cutes: 211
    • View Profile
  • Pronouns: she/her
Re: jump3
« Reply #26 on: October 03, 2017, 11:59:30 PM »
love-game.net/jump3/003 this is the gamepad version.... u go to options then key config to set up the gamepad....

i found out that chrome can detect 360 controllers correctly but firefox seemingly cant, so the nice button names for 360 controllers should work in chrome.... you might have to restart chrome before it detects your controller at all though
~Without love, the truth cannot be seen~

this is watermelon :watermelon: put her in your signature so she can achieve world domination

aimaina

  • Administrator
  • Cutesterest
  • *****
  • Posts: 1320
  • Cutes: 211
    • View Profile
  • Pronouns: she/her
Re: jump3
« Reply #27 on: October 04, 2017, 12:18:15 AM »
also this page http://html5gamepad.com/ is a useful way to check if any gamepad issues that arise are specific to my game or just a general html5 thing
~Without love, the truth cannot be seen~

this is watermelon :watermelon: put her in your signature so she can achieve world domination

vgperson

  • Cutest
  • ****
  • Posts: 258
  • Cutes: 110
  • guess i'll have to... make them fall.
    • View Profile
    • vgperson.com
Re: jump3
« Reply #28 on: October 04, 2017, 12:20:09 AM »
also my snes usb controller doesnt work on html5.... it doesnt detect up or left on the dpad

I wonder if this is something like each direction is its own axis, instead having horizontal and vertical like normal, so it only checks those first two for right/down? I feel like GM's ""Nice Constants"" may actually just be a bunch of assumptions being applied to the raw stuff. Anyway, it seems to work.

And to be fair, who starts coding a browser expecting people to use gamepads with it.

aimaina

  • Administrator
  • Cutesterest
  • *****
  • Posts: 1320
  • Cutes: 211
    • View Profile
  • Pronouns: she/her
Re: jump3
« Reply #29 on: October 04, 2017, 12:26:03 AM »
theres a way to just loop through all the axes and apparently my snes pad just has two, which correspond to up/down and left/right.... on windows it can detect negative values for those axes but on html5 it just cant. its really weird
~Without love, the truth cannot be seen~

this is watermelon :watermelon: put her in your signature so she can achieve world domination