JaydenMaalouf / JoystickPlugin

Native Input Joystick Plugin for Unreal Engine 4/5
MIT License
30 stars 6 forks source link

Massive problem regarding steering wheel device index's #32

Closed craytex closed 1 year ago

craytex commented 1 year ago

When disconnecting a steering wheel and plugging it back in instead of it binding to "joystick0" It will keep "joystick0" but also add "joystick1" and it will only send axis and button events to the newly created joystick1, and again if i plug out and back in again it will make a "joystick2" and do the same thing again.

craytex commented 1 year ago

Hoping you see this, I would like to fix it myself but have no experience with sdl2

JaydenMaalouf commented 1 year ago

Hey, Thanks for reporting the issue. It seems there was some issues in the way that I was passing the data from the device mappings to the RemoveDevice method. I've resolved the issues in a branch, see here

I have created a pre-release with the fix, which you can download here: release/2.0.1

Please give this a go and let me know if it works as expected. Thanks!

craytex commented 1 year ago

You are amazing for getting back to me so quickly, I really appreciate this thank you so much! Will report back if it works

On Sun, Feb 19, 2023 at 1:46 PM Jayden Maalouf @.***> wrote:

Hey, Thanks for reporting the issue. It seems there was some issues in the way that I was passing the data from the device mappings to the RemoveDevice method. I've resolved the issues in a branch, see here https://github.com/JaydenMaalouf/JoystickPlugin/tree/fix/crashing-on-close

I have created a pre-release with the fix, which you can download here: release/2.0.1 https://github.com/JaydenMaalouf/JoystickPlugin/releases/tag/2.0.1-fix-crashing-on-close.1

Please give this a go and let me know if it works as expected. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/JaydenMaalouf/JoystickPlugin/issues/32#issuecomment-1435993667, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPGAMHT7LQ23MDOC3MIQ2TWYIP2XANCNFSM6AAAAAAVATYX4Q . You are receiving this because you authored the thread.Message ID: @.***>

craytex commented 1 year ago

Strangely enough now its not detecting the steering wheel

On Sun, Feb 19, 2023 at 2:32 PM Sean Chambers @.***> wrote:

You are amazing for getting back to me so quickly, I really appreciate this thank you so much! Will report back if it works

On Sun, Feb 19, 2023 at 1:46 PM Jayden Maalouf @.***> wrote:

Hey, Thanks for reporting the issue. It seems there was some issues in the way that I was passing the data from the device mappings to the RemoveDevice method. I've resolved the issues in a branch, see here https://github.com/JaydenMaalouf/JoystickPlugin/tree/fix/crashing-on-close

I have created a pre-release with the fix, which you can download here: release/2.0.1 https://github.com/JaydenMaalouf/JoystickPlugin/releases/tag/2.0.1-fix-crashing-on-close.1

Please give this a go and let me know if it works as expected. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/JaydenMaalouf/JoystickPlugin/issues/32#issuecomment-1435993667, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPGAMHT7LQ23MDOC3MIQ2TWYIP2XANCNFSM6AAAAAAVATYX4Q . You are receiving this because you authored the thread.Message ID: @.***>

craytex commented 1 year ago

Yep for some reason its not showing under connected devices under the joystick settings tab

craytex commented 1 year ago

Maybe when you fixed the joystick not getting removed when it should there was code that was calling it too early when being plugged in?

craytex commented 1 year ago

Went back and checked in the older version and device shows as expected

craytex commented 1 year ago

I am using unreal 5.0 btw

craytex commented 1 year ago

5.0.3

JaydenMaalouf commented 1 year ago

Hmmm. There is only 1 change I made to the initialisation of the joysticks. I'll have to attempt to resolve it in the morning. I should have a fix up within the next 12hrs

craytex commented 1 year ago

Sounds good, thanks! Right now I can continue development on the older branch, Hoping its able to be fixed soon, Thank you

JaydenMaalouf commented 1 year ago

Hey @craytex, The following version should resolve some issues with the joystick mappings: release/2.0.1-fix-crashing-on-close.6

craytex commented 1 year ago

Hey everything works except when you disconnect the wheel if you are running force feedback Then it crashes with an error when closing again Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000050

SDL2 SDL2 UnrealEditor_JoystickPlugin!UForceFeedbackEffectBase::StopEffect() [D:\Agents\GitHub_work_temp\build\UE_5.0\HostProject\Plugins\JoystickPlugin\Source\JoystickPlugin\Private\ForceFeedback\Effects\ForceFeedbackEffectBase.cpp:194] UnrealEditor_JoystickPlugin!UForceFeedbackEffectBase::DestroyEffect() [D:\Agents\GitHub_work_temp\build\UE_5.0\HostProject\Plugins\JoystickPlugin\Source\JoystickPlugin\Private\ForceFeedback\Effects\ForceFeedbackEffectBase.cpp:92] UnrealEditor_JoystickPlugin!UForceFeedbackEffectBase::BeginDestroy() [D:\Agents\GitHub_work_temp\build\UE_5.0\HostProject\Plugins\JoystickPlugin\Source\JoystickPlugin\Private\ForceFeedback\Effects\ForceFeedbackEffectBase.cpp:26] UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor UnrealEditor UnrealEditor UnrealEditor UnrealEditor UnrealEditor kernel32 ntdll

Luckily this time the inputs all work

JaydenMaalouf commented 1 year ago

Hmm, seems I was attempting to stop the effect before destroying it. However, based on SDL documentation, this was unnecessary. Please try the updated version here: release/2.0.1-fix-crashing-on-close.11

craytex commented 1 year ago

Apologies for the late reply, This version gives out a new error message Assertion failed: !IsUnreachable() [File:D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp] [Line: 1839] WheelConstantSlip_C /Game/FGearAssets/Maps/UEDPIE_0_Multiplayer2.Multiplayer2:PersistentLevel.FGearPlayerController_C_0.JoystickMultiForceFeedback.WheelConstantSlip_C_0 Function: '/Script/JoystickPlugin.ForceFeedbackEffectBase:OnDestroyedEffect'

UnrealEditor_CoreUObject UnrealEditor_JoystickPlugin!UForceFeedbackEffectBase::DestroyEffect() [D:\Agents\GitHub_work_temp\build\UE_5.0\HostProject\Plugins\JoystickPlugin\Source\JoystickPlugin\Private\ForceFeedback\Effects\ForceFeedbackEffectBase.cpp:117] UnrealEditor_JoystickPlugin!UForceFeedbackEffectBase::BeginDestroy() [D:\Agents\GitHub_work_temp\build\UE_5.0\HostProject\Plugins\JoystickPlugin\Source\JoystickPlugin\Private\ForceFeedback\Effects\ForceFeedbackEffectBase.cpp:29] UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_CoreUObject UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor_UnrealEd UnrealEditor UnrealEditor UnrealEditor UnrealEditor UnrealEditor UnrealEditor kernel32 ntdll

Im noticing its saying a wrong directory in these errors maybe thats a problem?

JaydenMaalouf commented 1 year ago

Im noticing its saying a wrong directory in these errors maybe thats a problem?

Nah, the compile DLL doesn't know it's executing directory, so it uses the directory from the build agent in exception logs. I've uploaded a new version (2.0.1-fix-crashing-on-close.21) - please test and let me know how it goes! I've had to add some compiler if statements to support multiple engine versions as it seems some of the safeguards were changed in UE5.0

craytex commented 1 year ago

Sorry for the long response time, This update seems to have fixed everything!