Giter VIP home page Giter VIP logo

Comments (8)

h3rb avatar h3rb commented on June 19, 2024

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

from inputcandy.

itzariot avatar itzariot commented on June 19, 2024

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.

from inputcandy.

h3rb avatar h3rb commented on June 19, 2024

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

from inputcandy.

itzariot avatar itzariot commented on June 19, 2024

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.

from inputcandy.

h3rb avatar h3rb commented on June 19, 2024

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).

from inputcandy.

h3rb avatar h3rb commented on June 19, 2024

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

from inputcandy.

h3rb avatar h3rb commented on June 19, 2024

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.

from inputcandy.

h3rb avatar h3rb commented on June 19, 2024

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

from inputcandy.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.