Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gamepad not moving the player #2

Closed
itzariot opened this issue May 6, 2023 · 8 comments
Closed

gamepad not moving the player #2

itzariot opened this issue May 6, 2023 · 8 comments
Labels
bug Something isn't working cannot fix There's no way to fix this problem. grok this issue! The issue contains commentary that may be useful for new users or troubleshooters

Comments

@itzariot
Copy link

itzariot commented May 6, 2023

In advanced mode, My gamepad can not move the player even though it's detected and recognized. But, if i set my keyboard to IC_none in script IC_Action_ext, my gamepad can move the player. If i set back to IC_wasd or IC_arrow, the player only moved by keyboard, not gamepad.

The strange is, jump and button action works fine with my gamepad and keyboard.
Is it a bug? Ist it intentional? or do i have to find a workaround in my script to get my keyboard and gamepad action movement both work at the same time.

I just recently learning coding so thank you very much for creating this library. I learn a lot on how you code this library thing.
Your guys are truly angel.

@h3rb
Copy link
Member

h3rb commented May 8, 2023

Thanks. I'm happy to help. I really wish YoyoGames would have solved this for us, but someone had to step up. Since I needed this kind of a library, I made it.

I am aware that on Linux there may be problems with the sticks/axis. On linux, for example, the axis center is 0.5, 0.5 whereas on the Windows side it is 0,0 .. I'm filing an issue about that right now.

I need more information to help you. Please tell me what platform you are testing on, what controller/gamepad you are using, Also, test in Diagonostic Mode to see what your gamepad is actually registering. If you can record that and upload it as a video, or make a table of notes and provide those, that would be helpful. For an example, see the Controller Notes section of https://github.com/LAGameStudio/AtariVCSGML

and if you can sync up that's probably a good way to determine if its me (an issue with InputCandy), user error (your bad), or something else. If you would like to sync on our Discord (invite is at Lostastronaut.com) we can talk through your issue over a video call. Look for user Retrofriends

@h3rb h3rb self-assigned this May 8, 2023
@h3rb h3rb added bug Something isn't working investigating An issue has been processed and needs further investigation or information from the reporter labels May 8, 2023
@itzariot
Copy link
Author

hi,
Thank you for the quick response.
I use PS4 Dualshock 4 and using iMac 2015 with MacOS Monterey 12.6.5.
my Gamemaker version is 2022.6.1.26
Here's the list of order button i press:
in diagnostic screen
L2
L1
R1
R2
dpad right
dpad up
dpad left
dpat down
Circle
triangle
square
cross
left analog
right analog
mouse right click
arrow right
arrowup
arrow left
arrow down
D
W
A
S
space bar
shift

in game screen
space bar
arrow right
arrowup
arrow left
arrow down
shift

dpad right
dpad up
dpad left
dpat down
circle
cross

here's the link for the recording. I'm sorry the size is too big.

i hope this is enough.

@h3rb
Copy link
Member

h3rb commented May 15, 2023

i dont see the recording, could you upload it to youtube?

@itzariot
Copy link
Author

i'm so sorry.
This is the Youtube link for the recording
https://youtu.be/AM6QiJPFI7M
I tried using fire limit and it shows error.

i change the line in 2036
from this:
if ( fired_times <= fire_limit ) return true;

to this:
if ( fired_times <= action.fire_limit ) return true;

and the fire limit working. I hope that helps.

h3rb added a commit that referenced this issue Jul 11, 2023
Issue #2 suggestion to fix syntax error
@h3rb
Copy link
Member

h3rb commented Jul 11, 2023

I took your suggested fix for line 2036 of MatchSignal.

I'm in the process of experimenting with InputCandy's directionals in my own game for the first time. The idea was to use MatchDirectional() but perhaps this was incomplete? I've had some trouble using MatchDirectional in my own game, but have not got a chance to delve too deeply yet.

Also, I've noticed multiple Check* functions seem to be "incomplete" for example CheckAction and CheckActionReleased also aren't doing what they should, or I don't remember how to use them. It's possible they need to be removed or replaced. Case in point I wanted to force an action to trigger only when "Released" using CheckActionRelease but this did not do what was expected. I will file an Issue for this.

I'll experiment and let you know, but here are some things to try and report back on:

  1. Using my genuine XBOX Series S/X style controller, I was able to move the guy using the dpad.
    xboxctrlr

  2. I modified my o_Player object in InputCandy in the following way:
    a) Set moving=false; in Create
    b) removed "var" next to moving in Step
    c) added the following code to Draw:

if ( moving != false ) {
	draw_text(x+16, y+32, json_stringify(moving));
}

The above code allows you to view any signals.

You mentioned you are using a PS4 Dual Shock controller. I know that PS3 controllers do not register like the XBOX one does. Gamemaker's input is perfect but only on the XBOX controller (though it has issues with the left trigger being an axis and not gp_shoulderrb or whatever), so a PS4 may be registering other controls. Try using the "Test on Simulator" option to further investigate. (See also suggested feature to allow for user-defined profiles in a JSON format to be ingested, but this is not currently being worked on: #4 )

ic simulator

For the reason that not all controllers work out of the box, things like IC_dpad aren't going to work without loading an SDL profile, or by letting the user configure the controls specifically for that controller. I will have to add support specifically for the PS4 in the future. I'll have to run upstairs and grab one, since I already detect the PS3 controller, N64-USB knockoff, XBOX/XInput controller. It's very hard to detect the VCS controllers except by hardwiring the axis. In truth, you really only need to support the top gamepads, or let the user remap on Steam using a third party app, and assume its XBOX style. The other reason InputCandy exists at all is to allow for PC games to permit key remapping.

The way I'm fixing this so far in my own game is to support specific controllers outside of InputCandy, letting InputCandy be a fallback. For example, I directly support the XBOX and VCS controllers, allowing the user to switch to one of those profiles OR the user can switch to "Custom" which is InputCandy. I'm also using InputCandy's screen to let them remap players to devices, access the simulator, and configure custom controls.

For example, from your video, I noted that the PS4 DS controller registered multiple signals for your dpad (as a hat and also as a dpad).

@h3rb h3rb added the grok this issue! The issue contains commentary that may be useful for new users or troubleshooters label Jul 11, 2023
@h3rb
Copy link
Member

h3rb commented Jul 11, 2023

The best way for you to provide a mapping to me is to create a table. Example:

On Bladeblah GamepaD:
"what you pressed" = "what signal said"
A = hat0 Left
B = hat1 Right
X = A
Left Trigger = Right Shoulder

@h3rb
Copy link
Member

h3rb commented Jul 11, 2023

As a follow up, I tested the "Modern VCS Controller" versus the "XBOX Series S or X controller" and, lo and behold, ran into the same issue as you with the PS4. Can't move the guy. See pic:

VCS_versus_XBOX

Above: Red Arrow: VCS Controller, Other: Current gen XBOX controller

So, this is actually expected behavior.

InputCandy allows the user to customize controls, or load an SDL profile (not really recommended!) ... as it doesn't fix the problem for them automagically, because if it did, you would have to have written it or trained it using an interactive trainer, as there is no reliable way in GameMaker with SDL or not to detect the controller make and model reliably most of the time, especially with current generation controllers, because no one company correctly followed the standard.

Where InputCandy helps most is in:

  • Setting the device for a player and remembering devices associated with a player
  • Allowing the player to customize the controls for controllers that don't work right out of the box
  • Automatically assigning new devices when connected
  • Using the abstraction "Actions" to deal with player settings.
  • Unifying the interface and adding additional detection types for GameMaker developers

So far, when I have been using InputCandy, it's been about treating it as a way to configure the keyboard and mouse, and to provide it as a last resort.

For example,

In my game's menu, there is a control settings screen. My game supports couch coop 8 players.

  • The primary thing InputCandy is used for is to allow the user to set the actions, when they aren't using one of the default profiles. Those default profiles are set as a flag in another settings area, not the InputCandy one. I treat InputCandy as a component, and I write my game to support the major controllers of "this" time.. ie XBOX, VCS (because my game is coming out on the VCS) and "Custom" which is the InputCandy settings.
  • The other thing I use InputCandy for is to associate a device with a player. It's up to the player to then select the appropriate profile, because I have no idea if they have selected an XBOX controller or not.
  • The "profile" is literally a switch statement. See screenshot below:

InputCandy_VCXBOX

In the above snippet, you are looking at part of an object I return through a function GetGameControls(player_number)

This returns an object with methods on it. The method "Tertiary" looks for the "third degree fire button" (Like the "A" in XYAB), in this case you can see how it is mapped for each player-requested controller type. I default this controller type to "XBOX" on Steam and "VCS" on the VCS, but the user can pick between them.

I support "VCS" (and can tell the difference between the two VCS official controllers due to the number of axis and buttons that it is the Classic VCS Joystick or the Modern VCS Controller) and I support "XBOX" meaning a contemporary XBOX Series S/X XInput controller, or "mouse, keyboard or a custom control scheme set up by InputCandy" .. I could add some new functionality here, like isPlayerUsingPS4Controller or isPlayerUsingThrustmaster6 or whatever, but it would be up to the player to navigate to the "controls" menu and then pick the profile for the controller they are using. If they have mixed and matched controllers, they have to look at the "Choose a Device" panel of ICUI to see which player is using which controller, then set the player's profile or make a custom one for each player-device combo.

@h3rb h3rb added cannot fix There's no way to fix this problem. and removed investigating An issue has been processed and needs further investigation or information from the reporter labels Jul 11, 2023
@h3rb h3rb removed their assignment Jul 12, 2023
@h3rb
Copy link
Member

h3rb commented Jul 13, 2023

https://github.com/LAGameStudio/InputCandy/blob/trunk/README.md was updated to include important mention of how to use InputCandy based on this feedback

@h3rb h3rb closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cannot fix There's no way to fix this problem. grok this issue! The issue contains commentary that may be useful for new users or troubleshooters
Projects
None yet
Development

No branches or pull requests

2 participants