-
Notifications
You must be signed in to change notification settings - Fork 100
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 axis inputs causing crashes #474
Comments
I saw all these errors on amd64 too :/, the previous gamepad input api (removed in ng, by mrarm) of the Launcher worked far better. My idea would be to cherry pick the old direct interface code back (https://github.com/ChristopherHX/mcpelauncher-client/blob/master/src/window_callbacks.cpp#L144-L181). This would also allow splitscreen with 1.14.1.5 or earlier again.
Known arm32 only bug (arm64 works fine), but shouldn't be hard to fix...., did that already in libc-shim.
Please contribute your SDL implementation (as a Pull Request) to https://github.com/minecraft-linux/game-window even if it is incomplete. |
Thanks for the feedback. My backup plan was to provide gamepad support by translating the inputs into mouse and keyboard callbacks. But I'd rather take the time to do this properly. I'll start reading your old code to try and understand what I need to implement. I've tried many times over the past few days to wrap the lambda, but but without success. Honestly I'd never heard of lambda functions until last month when I started picking apart
and then: I didn't know if you'd be interested in a PR of my SDL code, but it was always to the plan to submit one for changes/suggestions when it was finished. So of course, very happy to contribute to the project. |
@ChristopherHX |
Not my code, I haven't written it. Yes the implementation is in libminecraftpe.so as long they keep exporting these symbols, this avoids using the android input interface.
No was removed (not replaced, minecraft-imported-symbols was kept) by mrarm, he removed more code than I in my fork. Moreover on my machine x86_64 I cannot reproduce the
errors anymore, my machine just keep running no matter what I do with my gamepad. This is also true for the random crashes. |
I forget I published it...
|
Good stuff. First sign there was a problem with
So I changed the include temporarily to an absolute
My build directory contains the minecraft-symbols output:
What else would you have done in CMakeLists.txt? I can't see that you treated any of the other submodules differently. Many Thanks. |
You aren't a cmake expert, but I have had such problems too in the past :).You need to add minecraft-symbols, in the target_link_libraries of mcpelauncher-client cmake file. This fixes both the header file not found and linker errors. (some links https://cmake.org/cmake/help/latest/command/target_link_libraries.html, https://github.com/ChristopherHX/minecraft-symbols/blob/8d1d7e880ac453ab4fa5d741cc78b773784557e6/CMakeLists.txt#L13, https://github.com/minecraft-linux/mcpelauncher-client/blob/d68cf09de902f683783075b7bb59f818c3278c8e/CMakeLists.txt#L12).In mcpelauncher-client/CMakeLists.txt change 'target_link_libraries(mcpelauncher-client logger mcpelauncher-core gamewindow filepicker msa-daemon-client cll-telemetry argparser baron android-support-headers libc-shim OpenSSL::Crypto ${CURL_LIBRARIES})' to 'target_link_libraries(mcpelauncher-client logger mcpelauncher-core gamewindow filepicker msa-daemon-client cll-telemetry argparser baron android-support-headers libc-shim minecraft-symbols OpenSSL::Crypto ${CURL_LIBRARIES})'
|
Ah, of course. It's the client that must import, not the manifest... So with that done I just needed to re-add an old header file, delete a few duplicate symbol definitions and re-write the callback functions to use the modern gamepad data structure/array. All is working now, thank you. Regarding these changes reintroducing part of the old interface, is that worth submitting a PR for too, as a cmake option perhaps? Alternatively, would you like me to do anything more to help debug the underlying issue? |
I was nearly there! I realised I'd forgotten to implement mousewheel. Having done so I found that only up worked. I encountered 2 issues.
Otherwise down evaluates to 0 instead of -127.
Many thanks. |
I'am looking forward to see it :), I wonder if it allows me to build it for android to compare bugs due to libc-shim.
I didn't pulished a fix, because I know it won't work, because of point 2. ARMHFREWRITE, is useless for Mouse::feed, because char is not a floatingpoint function, I tried it already.
A cmake options for this would be a good start (via cli on runtime would be even better or?) |
I'm closing this now then, as we've documented the workarounds here and I have a working input system. |
Further to #457 I've got the client built and running in full-screen/non-X11.
My final issue is with gamepad support. Any axis events (including dpad which I know are also treated as full deflection axes) result in a crash. This might be immediate or take a few minutes to occur. They may work in the game menu, but then the crash will occur whilst the game world is loading. I've seen 4 different errors:
The callbacks I'm using are:
onGamepadState
to indicate the controller is connected,onGamepadButton
for the button presses, andonGamepadAxis
for the axes. Of course - the axis values I supply are normalised to a -1 to 1 range.As a further datapoint - the dpad axes behave strangely in the game menu. No matter if I press up or down, the menu moves down and it keeps going as if I'm holding the button. I've added debug lines and it is definitely receiving the press and release events.
The same thing happens with left/right, except it only goes endlessly to the right.
FYI:
I'm using straight up EGL for video. I abandoned SDL as there were transparency issues with some 2D elements that I never managed to resolve. Also SDL cannot supply a mouse pointer when it isn't windowed. So I'm rendering my own "diamond sword" mouse pointer to the framebuffer.
I'm still using SDL for input. Keyboard and mouse are working fine and the game is playable.
As ever, any suggestions are greatly appreciated.
The text was updated successfully, but these errors were encountered: