Let's start with a long one.
Controller issues are much more complex than I expected, I seem to find two new problems for every fixed one. Frustratingly, it seems that each time I update Unity’s input system to a newer version, something gets broken. Here’s a quick summary of things I’ve dealt with during the past two weeks.
Composite keyboard controls (WASD) stopped working when I updated Unity and its input system after the previous release (to Unity 2021.3.4f1 and input system 1.3.0, if I interpret the version history correctly). In case someone experiences the same, I had to set the control to “pass through” in order to make it work.
Similarly, the controller's shoulder (or bumper, whichever you prefer) buttons didn’t work anymore in battles. In GUI they do work. Pass through -trick didn’t work here, so finally I just downgraded the input system to 1.1.0, which fixed the issue.
Gamepad scrolling in the shipyard didn’t work after the latest ATP release either. Even downgrading the input system doesn’t fix this, which has left me clueless. It seems that my virtual mouse implementation (the code I posted almost a year ago) causes conflicts between the actual system mouse and events I send. This aborts dragging prematurely. I actually got the dragging work by creating a virtual mouse device instead of calling system mouse directly, but now I’m unable to use gamepad and mouse simultaneously, which makes this solution useless for me (Unity’s reference implementation has the same limitation). Enabling/disabling the virtual mouse depending on the last used device might work. I’ll try that at some point.
As this wasn't enough, there were problems with the hardware as well. Crosshair jumped strangely when controlled by the gamepad's joystick, and I spent several hours adjusting dead zones, filtering noise etc. without effect. After a while, I started getting suspicious and tried another controller. Everything worked fine. https://gamepad-tester.com/ proves that the issue really is in the controller:
I don’t feel like fighting with controls right now, so I will probably just implement the common controller navigation to the menus (which was on my TODO list anyway), and use virtual mouse only in the shipyard (if I get it to work). Mouse is practically mandatory in the shipyard, so I won’t be prioritizing this very high.
But it’s not all work without fun. Our first spectator invited his brothers to cheer me up (or mock me, decide yourself). More about the crowd in the future posts.