We have a new joysticks database in Castle Game Engine, and we need YOU to help us test it

Joystick

Hello everyone!

We have a big and important, but simple request. We’ve reworked the handling of the joysticks and gamepads in Castle Game Engine, with a lot of new features that include serious improvement of joysticks API, access to a huge joysticks database by SDL2 with hundreds of joysticks definitions, autodetection of joysticks, detection of connection/disconnection of joysticks, etc.

However, because we have very limited access to hardware, we are unable to test how well those new features work. And therefore we need your help to test if everything is working as expected on different hardware joysticks/gamepads.

You can download and build “joystick” project from “examples” in this fork: https://github.com/eugeneloza-clean/castle-engine. It is not yet merged into CGE master, but of course it will be — that’s why we ask you to help with testing!

Ready precompiled binaries for Windows 64 bit and Linux 64 bit are here.

If you have access to a hardware joystick or gamepad, please use this tool and tell us (e.g. using forum):

  1. Your joystick name and operation system (Linux or Windows)
  2. Name your joystick was detected in Castle Game Engine

  3. If your joystick was correctly autodetected. If not, can you find your joystick in the list of joysticks and try using it?

  4. Did the axes and buttons on your joystick corresponded to the axes and buttons displayed in the tool? Note, that the names of the buttons and exact joystick layout may be different, but right stick must be right and upper button must be the upper one.

Thanks a lot!

And thanks a lot to Eugene Loza for developing it all!

Here you have some tests:

I have checked “Wireless Steam Controller” on Linux 64. Name is correct but buttons are and axes are all wrong.

Second one is “MLG Pro Circuit Controller (Xbox)”: this one seems correct. Triggers are analog and not shows correctly: yellow if I push the trigger and still yellow when release.

Third one: Nintendo Wiimote, model: RVL-036: paired on system bluetooth but not detected at all. I can move list of controllers with it so it may acts as keyboard.

2 Likes

@tsr Thank you!

We’ll look into it :), in particular why “Wireless Steam Controller” failed.

I think the failure of “Nintendo Wiimote” may not be easy to handle, if it is not detected at all.

Linux - Logitech F510

This has a switch on the back to go between xinput and directinput modes. I usually use xinput. In xinput mode it is detected as “Logitech Gamepad F510 (ID: 0); Axes: 8; Buttons: 11”. However, it fails to autodetect the layout and shows it as a generic XBox pad, while physically the gamepad layout follows the Dualshock convention. The axes and buttons light up correctly on the diagram, although L2 and R2 light up at minimum and maximum values but remain unlit when the trigger is half pressed.

In directinput mode, the gamepad is detected as “Logitech Logitech Rumblepad 2 USB (ID: 0); Axes: 6; Buttons: 12”. The diagram is still a generic XBox pad. Every axis and button in this mode lights up an entirely wrong control on the diagram.

1 Like

Windows, Nintendo Switch Pro Controller, which is detected as “XBox Adaptive Controller”.

I changed the layout to Nintendo Switch Pro Controller and everything works fine except the right stick which cannot rotate left/right.

1 Like

Thanks a lot for the tests everyone!

It seems like the database doesn’t have Wireless Steam Controller record, only 7 Steam Controller records (without “wireless”). Creating a database entry for this joystick might help, see the links below.

Unfortunately this joystick does not seem to be available in the database (or is detected by a significantly different name). If you could create the corresponding database record it’d be a very great help both to SDL2 and Castle Game Engine.

E.g. Try using one of the tools listed here: SDL_GameControllerDB/README.md at master · gabomdq/SDL_GameControllerDB · GitHub (I used SDL2 Gamepad Tool and it worked well both on Linux and Windows) and submit it to SDL2 database through issues Issues · gabomdq/SDL_GameControllerDB · GitHub
Note that they do not accept all joysticks definitions, first of all if they are buggy like my Esperanza EG102 (e.g. if many joysticks with different layouts share the same GUID which makes their autodetection next to impossible or if joystick layout depends on firmware version), but even in this case we still can include this record in Castle Game Engine database, as we alternatively provide a way to select the joystick by name even if autodetect fails.

Unfortunately at the moment we’re using an “obsolete” /dev/js# interface on Linux. It works well for most joysticks, but it has its limitations - e.g. not detecting correctly some sophisticated cases (like wi-fi or bluetooth joysticks). We plan to upgrade it to /dev/event#, but it’s still work in progress.

You mean that the joystick image is different from the actual joystick image, right? Note that we use the same X-Box gamepad image for all joysticks (like SDL2 Gamepad Tool does). We had an idea to draw all possible joysticks layouts, but it’s a really tremendous amount of work (almost 800 joysticks in database :smiley: + about an hour to find, validate and draw each layout), so, it’s left for later if ever :slight_smile: As an alternative we wanted to try to figure out most common layouts (like X-Box, NS, PS) so that at least sticks, D-Pad would be placed correctly and buttons would have correct captions. But again this information is not available in the database and therefore it requires googling (duckduckgoing) images for all the joysticks in the database to determine their look.

Currently we consider trigger pressed when it has > 0.5 pressure. Should it be reduced to some lower value, like 0.2-0.1?

Did you try selecting Logitech F510 Gamepad from the list of joystick layouts? It looks like it has the same layout as Logitech RumblePad 2 USB (only axis[1] and axis[3] are inverted), but still worth a shot.
I’m not sure if that could help, but could you try creating a database entry for your joystick in this mode (see the tool linked above) too? The database has the entry for this joystick, but maybe it’s wrong or there is an alternative layout for the same joystick name. At least that’ll give the answer what exactly works wrong in this case.

It looks like there might be a problem with the database definition (that was the case for my Esperanza joystick - left stick and most of the buttons were working correctly, but the right stick and triggers weren’t; Everything started working well after I’ve created a manual database entry for the joystick). Could you try creating a database entry (see the tool linked above)?

Thanks again everyone!

You can also track the generalized testing results here:Castle Game Engine joysticks&gamepads tests - Google Sheets

I cant seem to get the SDL2 Gamepad Tool work correctly (did the mapping, but the left/right stick couldn’t recognize certain directions when I try to test the result). Anyway the controller works correctly in Steam so here’s the string I got from my Steam config:

030000007e0500000920000000000000,Nintendo Switch Pro Controller,platform:Windows,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3

1 Like

Thanks a lot for the info! Yes, your results exactly correspond to the database entry.
Looks like WinMM for some reason reports wrong horizontal axis for right stick (as my joystick also has right stick at axes 2 and 3 and it works flawlessly). Even more interesting is that SDL2 Gamepad Tool also fails with axes (they are using Direct Input as far as I know).

You mean that the joystick image is different from the actual joystick image, right?

Yes, that’s right. It would be nice to have generic gamepad diagrams for the few main types, but by no means critical.

Currently we consider trigger pressed when it has > 0.5 pressure. Should it be reduced to some lower value, like 0.2-0.1?

That part’s fine, I think. Sorry, I didn’t explain well enough - the F510 may be sending axis values for the L2 and R2 triggers in an unexpected range. The way you describe it is also how I would expect it to work, ie. the button is not highlighted when I’m not pressing it, and is highlighted when I press it far enough. But how it actually works is that the button is highlighted both when I’m not pressing the trigger as well as when I’m pressing it fully. It is not being highlighted within a ~30-70% arc in the middle.

I actually have an SDL2 test program of my own, which shows that on this gamepad L2 generates axis 4 events in the range 0…32768, where 0 is not pressed; R2 generates axis 5 events in the same range. Does this sound about right?

Did you try selecting Logitech F510 Gamepad from the list of joystick layouts?

I was going to, but now the gamepad doesn’t get detected by SDL2 at all anymore in directinput mode. I have no explanation… fortunately, that’s the less useful legacy operation mode, so not too important.

Here you have mapping for Steam Wireless Controller (created with Gamepad Tool):
03000000de2800004211000011010000,Wireless Steam Controller,platform:Linux,a:b2,b:b3,x:b4,y:b5,back:b10,guide:b12,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.8,dpdown:h0.2,dpleft:h0.12,dpright:h0.3,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b8,righttrigger:b9,