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

[$100 Bounty] perfectly ( normal ) working gamepad logic nodes on pc and android phone #2886

Open
vuaieo opened this issue Jun 1, 2023 · 9 comments
Labels
bounty There is a monetary reward for this issue feature request This issue requests a feature

Comments

@vuaieo
Copy link

vuaieo commented Jun 1, 2023

i willing to pay a bounty of 100$ to have normal working gamepad logic nodes which it has to be done anyway but maybe someone would then speed thigns up... because last days i had tryed ps4 and ps3 controlers and on phone the phone controller and all working with bugs... on pc some buttons dont even work or switched up and on phone they do work or not i not sure anymroe but it was nightmare... this has to be consistent and bugless or can forget making any game with controller : ( here is the link bugrepot if it helps #2885 (comment)

the payment sending method will be over paypal or bank ( IBAN ) or even paysafecard, as you wish...

@vuaieo vuaieo added the feature request This issue requests a feature label Jun 1, 2023
@MoritzBrueckner MoritzBrueckner added the bounty There is a monetary reward for this issue label Jun 1, 2023
@MoritzBrueckner
Copy link
Collaborator

MoritzBrueckner commented Sep 20, 2023

Hi, following https://discord.com/channels/486771218599510021/486773516956336128/1154129182385786910 we decided to create a small test application for Kha to see what raw data Kha reports from gamepads. This can help us to find out whether the issue(s) are Kha/Kinc issues or whether something needs to be fixed in Armory or Iron.

So, expect some reports in this issue :)


My findings:

Gamepad: Trust GXT 541 Muta, reported by Windows as "Controller (Xbox360 For Windows)"
Kha registers the gamepad as connected once an arbitrary button is pressed.

Output from the test application on the debug-html5 target on Windows:

Connected: true
ID: Xbox 360 Controller (XInput STANDARD GAMEPAD)
Vendor: unknown

Both sticks:

  • Up: (0, -1)
  • Down: (0, 1)
  • Left: (-1, 0)
  • Right: (1, 0)

Buttons:

Index reported by Kha Corresponding physical button Possible values
0 a 0 or 1
1 b 0 or 1
2 x 0 or 1
3 y 0 or 1
4 L1 0 or 1
5 R1 0 or 1
6 L2 0–1
7 R2 0–1
8 Called "-", but I think it's equivalent to "Select" 0 or 1
9 Called "+", but I think it's equivalent to "Start" 0 or 1
10 left stick press 0 or 1
11 right stick press 0 or 1
12 up 0 or 1
13 down 0 or 1
14 left 0 or 1
15 right 0 or 1

Output on Krom (Windows)

Connected: false
ID: unknown
Vendor: unknown

Both sticks:

  • Up: (0, 1)
  • Down: (0, -1)
  • Left: (-1, 0)
  • Right: (1, 0)

Compared to debug-html5, the y-axis is inverted! Since there is no Armory used in the test application, that's a Kinc/Kha issue (if not by design for whatever reason).

All buttons behave the same as in debug-html5.

Output on HL (Windows), both tested with debug and release builds (same results)

Edit: after applying Kode/Kha#1473, the results for HL are identical to those for hxcpp (see below).

Connected: false
ID: (empty string)
Vendor: (empty string)

Both sticks:
- Up: (0, 5.2634[...]e-315)
- Down: (0, 1.587[...]e-314)
- Left: (1.587[...]e-314, 0)
- Right: (5.2634[...]e-315, 0)

Something is definitely wrong here. Instead of 1 we have 5.2634[...]e-315 and instead of -1 there is 1.587[...]e-314. Could this be some kind of conversion issue?

Buttons have the same indices, but again, the expected value of 1 is reported as 5.2634[...]e-315 (and L2 and R2 return values in the range [0, 5.2634[...]e-315]

Output on hxcpp (Windows), both tested with debug and release builds (same results)

This target is not used by Armory, but I tested it out of interest.

Connected: true
ID: Xbox 360 Controller
Vendor: Microsoft

Both sticks:

  • Up: (0, 1)
  • Down: (0, -1)
  • Left: (-1, 0)
  • Right: (1, 0)

(inverted y axis just like in Krom)

The buttons behave the same as in Krom and debug-html5.

@Redberd36
Copy link

Redberd36 commented Sep 20, 2023

Redberd36

My findings:

Gamepad: (PS5) DualSense Wireless Controller, reported by Windows as "DualSense Wireless Controller"
Kha registers the gamepad as connected once an arbitrary button is pressed.

Output from the test application on the debug-html5 target on Windows:

Connected: true
ID: (PS5) DualSense Wireless Controller (STANDARD GAMEPAD Vendor: 054c product: 0ce6)
Vendor: unknown

Both sticks:

  • Up: (0, -1)
  • Down: (0, 1)
  • Left: (-1, 0)
  • Right: (1, 0)

Buttons:

Index reported by Kha Corresponding physical button Possible values
0 Cross 0 or 1
1 Circle 0 or 1
2 Square 0 or 1
3 Triangle 0 or 1
4 L1 0 or 1
5 R1 0 or 1
6 L2 0-1
7 R2 0-1
8 Create 0 or 1
9 Options 0 or 1
10 left stick press 0 or 1
11 Right stick press 0 or 1
12 Dpad-Up 0 or 1
13 Dpad-Down 0 or 1
14 Dpad-Left 0 or 1
15 Dpad-Right 0 or 1
16 PS button 0 or 1
17 TouchPad 0 or 1

@Redberd36
Copy link

Redberd36

My findings:

Gamepad: Logitech F310 Wired Gamepad Controller, reported by Windows as either XInput: "Controller (Gamepad F310)" or DirectInput: "Logitech Dual Action"
Kha registers the gamepad as connected once an arbitrary button is pressed.

Output from the test application on the debug-html5 target on Windows:

Connected: true
ID: Xbox 360 Controller (Xinput STANDARD GAMEPAD) or Logitech Dual Action (STANDARD GAMEPAD Vendor: 046d product: c216)
Vendor: unknown

Both sticks / Both Input Modes:

  • Up: (0, -1)
  • Down: (0, 1)
  • Left: (-1, 0)
  • Right: (1, 0)

Buttons / Both Input Modes:

Index reported by Kha Corresponding physical button Possible values
0 A 0 or 1
1 B 0 or 1
2 X 0 or 1
3 Y 0 or 1
4 L1 0 or 1
5 R1 0 or 1
6 L2 XInput: 0-1 / DirectInput: 0 or 1
7 R2 XInput: 0-1 / DirectInput: 0 or 1
8 Back 0 or 1
9 Start 0 or 1
10 left stick press 0 or 1
11 Right stick press 0 or 1
12 Dpad-Up 0 or 1
13 Dpad-Down 0 or 1
14 Dpad-Left 0 or 1
15 Dpad-Right 0 or 1

@MoritzBrueckner
Copy link
Collaborator

MoritzBrueckner commented Sep 21, 2023

I also conducted the tests for Krom and HL now and updated my post above. There are definitely some issues with Krom and HL on my end: on Krom, the y axis of the sticks is inverted, and on HL, the raw values are completely wrong.

To run the test application with Krom on Windows:

  1. Open a terminal in the root folder of the test app (probably called KhaGamepadTester for you)
  2. Execute node "<Armory-SDK-path>\Kha\make" krom (replace <Armory-SDK-path> with the path to your Armory SDK)
  3. Execute "<Armory-SDK-path>\Krom\Krom.exe" build/krom build/krom-resources

To run the test application with HL on Windows:

  1. Open a terminal in the root folder of the test app (probably called KhaGamepadTester for you)
  2. Execute node "<Armory-SDK-path>\Kha\make" windows-hl
  3. Open build/windows-hl-build/New-Project.sln in Visual Studio and compile for debug x64 or release x64

@Redberd36
Copy link

Redberd36

My findings:

Gamepad: Logitech F310 Wired Gamepad Controller, reported by Windows as either XInput: "Controller (Gamepad F310)" or DirectInput: "Logitech Dual Action"
Kha registers the gamepad as connected once an arbitrary button is pressed.

Output from the test application on the debug-Krom target on Windows:

Connected: false both modes.
ID: unknown both modes
Vendor: unknown both modes

Both sticks XInput mode:

  • Up: (0, -1) Inverted Down
  • Down: (0, 0.999) Inverted Up
  • Left: (-1, 0)
  • Right: (0.999, 0)

Buttons XInput mode:

Index reported by Kha Corresponding physical button Possible values
0 A 0 or 1
1 B 0 or 1
2 X 0 or 1
3 Y 0 or 1
4 L1 0 or 1
5 R1 0 or 1
6 L2 0-1
7 R2 0-1
8 Back 0 or 1
9 Start 0 or 1
10 left stick press 0 or 1
11 Right stick press 0 or 1
12 Dpad-Up 0 or 1
13 Dpad-Down 0 or 1
14 Dpad-Left 0 or 1
15 Dpad-Right 0 or 1

Left stick only DirectInput mode:
(Right stick is unresponsive to any movement)

  • Up: (0, -1)
  • Down: (0, 1)
  • Left: (-1, 0)
  • Right: (1, 0)

Buttons DirectInput mode:

Index reported by Kha Corresponding physical button Possible values
0 X 0.501960813999176
1 A 0.501960813999176
2 B 0.501960813999176
3 Y 0.501960813999176
4 L1 0.501960813999176
5 R1 0.501960813999176
6 L2 0.501960813999176
7 R2 0.501960813999176
8 Back 0.501960813999176
9 Start 0.501960813999176
10 left stick press 0.501960813999176
11 Right stick press 0.501960813999176
12 Dpad-Up 0 or 1
13 Dpad-Down 0 or 1
14 Dpad-Left 0 or 1
15 Dpad-Right 0 or 1

@Redberd36
Copy link

Redberd36

My findings:

Gamepad: Logitech F310 Wired Gamepad Controller, reported by Windows as either XInput: "Controller (Gamepad F310)" or DirectInput: "Logitech Dual Action"
Kha registers the gamepad as connected once an arbitrary button is pressed.

Output from the test application on the debug-HL target on Windows:

DirectInput mode:
Connected: false
ID: Generic Gamepad
Vendor: DirectInput8

(Unresponsive to all inputs)

XInput mode:
Connected: true
ID: Xbox 360 Controller
Vendor: Microsoft

Both sticks XInput mode:

  • Up: (0, 0.999) Inverted Down
  • Down: (0, -1) Inverted Up
  • Left: (-1, 0)
  • Right: (0.999, 0)

Buttons / DirectInput mode:

Index reported by Kha Corresponding physical button Possible values
0 A 0 or 1
1 B 0 or 1
2 X 0 or 1
3 Y 0 or 1
4 L1 0 or 1
5 R1 0 or 1
6 L2 0-1
7 R2 0-1
8 Back 0 or 1
9 Start 0 or 1
10 left stick press 0 or 1
11 Right stick press 0 or 1
12 Dpad-Up 0 or 1
13 Dpad-Down 0 or 1
14 Dpad-Left 0 or 1
15 Dpad-Right 0 or 1

@Redberd36
Copy link

Redberd36 commented Sep 22, 2023

Redberd36

My findings:

Gamepad: (PS5) DualSense Wireless Controller, reported by Windows as "DualSense Wireless Controller"
Kha registers the gamepad as connected once an arbitrary button is pressed.

Output from the test application on the debug-Krom target on Windows:

Connected: false
ID: unknown
Vendor: unknown

Left stick only:
❌ (Right stick is unresponsive to any movement)

  • Up: (0, -1)
  • Down: (0, 1)
  • Left: (-1, 0)
  • Right: (1, 0)

Buttons / DirectInput mode:

Index reported by Kha Corresponding physical button Possible values
0 Cross 0.501960813999176
1 Circle 0.501960813999176
2 Square 0.501960813999176
3 Triangle 0.501960813999176
4 L1 0.501960813999176
5 R1 0.501960813999176
6 L2 0.501960813999176
7 R2 0.501960813999176
8 Create 0.501960813999176
9 Options 0.501960813999176
10 left stick press 0.501960813999176
11 Right stick press 0.501960813999176
12 Dpad-Up 0 or 1 / PS button: 0.501960813999176
13 Dpad-Down 0 or 1 / Touchpad: 0.501960813999176
14 Dpad-Left 0 or 1 / Mute button: 0.501960813999176
15 Dpad-Right 0 or 1

@Redberd36
Copy link

Redberd36

My findings:

Gamepad: (PS5) DualSense Wireless Controller, reported by Windows as "DualSense Wireless Controller"
Kha registers the gamepad as connected once an arbitrary button is pressed.

Output from the test application on the debug-HL target on Windows:

Connected: true
ID: Generic Gamepad
Vendor: DirectInput8

Left stick only:
❌ (Right stick is unresponsive to any movement)

  • Up: (0, -1)
  • Down: (0, 1)
  • Left: (-1, 0)
  • Right: (1, 0)

Buttons / DirectInput mode:

Index reported by Kha Corresponding physical button Possible values
0 Square 0.501960813999176
1 Cross 0.501960813999176
2 Circle 0.501960813999176
3 Triangle 0.501960813999176
4 L1 0.501960813999176
5 R1 0.501960813999176
6 L2 0.501960813999176
7 R2 0.501960813999176
8 Create 0.501960813999176
9 Options 0.501960813999176
10 left stick press 0.501960813999176
11 Right stick press 0.501960813999176
12 Dpad-Up 0 or 1 / PS button: 0.501960813999176
13 Dpad-Down 0 or 1 / Touchpad: 0.501960813999176
14 Dpad-Left 0 or 1 / Mute button: 0.501960813999176
15 Dpad-Right 0 or 1

@tong
Copy link
Contributor

tong commented Oct 31, 2023

The SDL gamepad db might be useful for mappings: https://github.com/gabomdq/SDL_GameControllerDB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty There is a monetary reward for this issue feature request This issue requests a feature
Projects
None yet
Development

No branches or pull requests

4 participants