isXander / Controlify

Another controller mod - for fabric!
https://www.isxander.dev/mods/controlify
GNU Lesser General Public License v3.0
122 stars 23 forks source link

Retain settings between controllers of the same type [Re-open again] [Bug] #290

Closed aekramer closed 2 months ago

aekramer commented 2 months ago

Current Behaviour

The issue of controllers of the same type still overwriting settings is unfortunately still happening even after the 2.0.0 beta 3.

The original and subsequent issue was closed as related bugs that may be part of the fix were resolved , however the issue still persists. Unfortunately I do not yet know how to reproduce it consistently, however it still happens every other day that it requires a rebinding of all custom configurations.

Link to previous issues (maybe its time to start a big thread until its actually solved) https://github.com/isXander/Controlify/issues/256 https://github.com/isXander/Controlify/issues/276

Some additional information: My Xbox One S Controller is no longer recognized after a firmware update not too long ago, this causes the submit controller data popup when rebooting, not sure if related at all, as I doubt it would be if it was properly logged from the settings file.

Expected Behaviour

Retain configured settings between controllers of the same type (or even more precisely, the actually same controller is often detected as being new and having to reconfigure it entirely each type, while stock piling the save file with more and more configs each time)

Please provide a way to opt to not use identifiers in the first place and just use the controllers main name (Like Xbox One S Controller) to bind settings to that instead. (Or load add a button to load previous config from same controller type whenever a new controller is detected)

Screenshots

No response

Reproduction Steps

Simply reconnect a controller or reboot the game every once in a while.

Logs

No response

Mod Version

2.0.0 beta3 + 1.20.4

Controller

issues

Bluetooth

Operating System

Windows

ARM

Additional Information

No response

Just to make sure...

isXander commented 2 months ago

Maybe there is a problem that is causing the config to get reset, rather than controller type detection. After repeating the issue, please send the latest.log correlating to that.

aekramer commented 2 months ago

Maybe there is a problem that is causing the config to get reset, rather than controller type detection. After repeating the issue, please send the latest.log correlating to that.

Alright thanks, I'll keep an eye out for it.

EDIT: Just happened again, what's noticeable for me is when I boot it it doesn't recognize the controller and asks if it works and if I would like to submit the controller data, after doing so it will trigger the calibration screen again, doing that and then checking my settings will show the settings have reset

(This was a first boot today, not sure if that is possibly somehow related, as the bluetooth (external usb) adapter may have refreshed some settings perhaps)

Here is the full log file: https://paste.ee/p/orFwC

Oh I just noticed it "Failed to load controller data, resetting to default", as a side note my config file only contains that single controller ID, but it could be that it has reset, I did not remember to double check the previous ID and since the old settings were wiped now

isXander commented 2 months ago

Also, these types of errors are no longer silent. If the config fails to load and resets, you will now get a toast to tell you so, though this case should no longer happen.

aekramer commented 2 months ago

Also, these types of errors are no longer silent. If the config fails to load and resets, you will now get a toast to tell you so, though this case should no longer happen.

Just want to say I really appreciate all the work you put into this already and it's an amazing creation!

isXander commented 2 months ago

Thank you! Sorry this issue has been plaguing you for so long!

aekramer commented 2 months ago

Thank you! Sorry this issue has been plaguing you for so long!

Not sure if this is related to the same fix, but just incase for extra note heres a log of a controller crash happening earlier today (the recalibration screen came up but the controller would not work anymore ingame until a reboot)


[18:36:35] [Render thread/INFO]: Saving Controlify config...
[18:50:10] [Render thread/INFO]: Using SDL to identify controller type.
[18:50:10] [Render thread/WARN]: Controller found via USB hardware scan, but it was not found in the controller identification database! (HID: HID[VID=0x045e, PID=0x0b20])
[18:50:10] [Render thread/ERROR]: Failed to load controller data for 667330d6-8d77-3698-a3cd-0ab6ada0e02a. Resetting to default!
java.lang.NullPointerException: Cannot invoke "dev.isxander.controlify.controller.serialization.ConfigClass.onConfigSaveLoad(dev.isxander.controlify.controller.ControllerEntity)" because "this.instance" is null
    at dev.isxander.controlify.controller.impl.ConfigImpl.deserialize(ConfigImpl.java:54) ~[Controlify-2.0.0-beta.3+1.20.4.jar:?]
    at dev.isxander.controlify.controller.ControllerEntity.deserializeFromObject(ControllerEntity.java:136) ~[Controlify-2.0.0-beta.3+1.20.4.jar:?]
    at dev.isxander.controlify.config.ControlifyConfig.applyControllerConfig(ControlifyConfig.java:177) ~[Controlify-2.0.0-beta.3+1.20.4.jar:?]
    at dev.isxander.controlify.config.ControlifyConfig.loadOrCreateControllerData(ControlifyConfig.java:165) ~[Controlify-2.0.0-beta.3+1.20.4.jar:?]
    at dev.isxander.controlify.controllermanager.AbstractControllerManager.onControllerConnected(AbstractControllerManager.java:82) ~[Controlify-2.0.0-beta.3+1.20.4.jar:?]
    at dev.isxander.controlify.controllermanager.SDLControllerManager.lambda$tick$0(SDLControllerManager.java:73) ~[Controlify-2.0.0-beta.3+1.20.4.jar:?]
    at dev.isxander.controlify.utils.ControllerUtils.wrapControllerError(ControllerUtils.java:28) ~[Controlify-2.0.0-beta.3+1.20.4.jar:?]
    at dev.isxander.controlify.controllermanager.SDLControllerManager.lambda$tick$1(SDLControllerManager.java:73) ~[Controlify-2.0.0-beta.3+1.20.4.jar:?]
    at java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
    at dev.isxander.controlify.controllermanager.SDLControllerManager.tick(SDLControllerManager.java:72) ~[Controlify-2.0.0-beta.3+1.20.4.jar:?]
    at dev.isxander.controlify.Controlify.tick(Controlify.java:491) ~[Controlify-2.0.0-beta.3+1.20.4.jar:?]
    at net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents.lambda$static$0(ClientTickEvents.java:34) ~[fabric-lifecycle-events-v1-2.3.0+a67ffb5d4f-b1011876dc990029.jar:?]
    at net.minecraft.class_310.handler$zoe000$fabric-lifecycle-events-v1$onStartTick(class_310.java:8272) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_1574(class_310.java) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_1523(class_310.java:1289) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_1514(class_310.java:888) ~[client-intermediary.jar:?]
    at net.minecraft.client.main.Main.main(Main.java:265) ~[minecraft-1.20.4-client.jar:?]
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.15.7.jar:?]
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.15.7.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.15.7.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
    at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:243) ~[NewLaunch.jar:?]
    at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:278) ~[NewLaunch.jar:?]
    at org.multimc.EntryPoint.listen(EntryPoint.java:143) ~[NewLaunch.jar:?]
    at org.multimc.EntryPoint.main(EntryPoint.java:34) ~[NewLaunch.jar:?]
[18:50:10] [Render thread/INFO]: Saving Controlify config...
[18:50:10] [Render thread/INFO]: Controller connected: 'Xbox One S Controller'#SDL-2-HID[VID=0x045e, PID=0x0b20] (null)```
isXander commented 2 months ago

This has been fixed