Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Maintenance & Feedback » JJ2+ Issue Tracker

Bug Report Phantom controller input

Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

May 16, 2018, 01:58 PM
Violet CLM is offline
Phantom controller input

Hi folks. Some people have reported receiving constant input from controllers or controller-like devices that do not seem to correspond to things they are intentionally doing, e.g. their rabbit constantly tries to move down and right.

plus_controller_patches.zip

This is the latest release of JJ2+, but edited to add some prospective fixes to phantom movement problems, and people in this thread have been reporting this works for them. (A fix for people with mouse movement issues instead is also in the works but it wasn't feasible to get it into the same branch as this code, sorry.)


If you're still having problems, before making your report, please instead use the plus.dll from plus_controller_diagnostics_3.zip, which has a minimal modification to constantly show all controller input information. (Only while ingame--if your phantom controller makes it impossible for you to navigate the menu system, load JJ2 directly into a level by command line/drag+drop.) If you experience such phantom input, please a) explain what your specific problem is, b) compare your experience to your experience using regular unpatched JJ2, c) post a screenshot of the various numbers in their base state (i.e. when you are not intentionally doing anything), and d) report how the numbers are affected by any related experiments you choose to do.

Thanks!
__________________

Last edited by Violet CLM; May 2, 2020 at 05:04 PM.
MKG

JCF Member

Joined: Jan 1970

Posts: 1

MKG has disabled reputation

Jun 17, 2018, 03:36 PM
MKG is offline
Exclamation A report here

You know, I'm using the latest WINE stable release (3.9) to run Jazz Jackrabbit 2 and I'm have some really bad problems with my Sanmos TWIN SHOCK gamepad.

One one the symptoms just happens to be "mouse pointer constantly moving to the left", so I figured that I'd report the problem here.

Another problem is that the player always looks up unless I move the stick into the up direction.

From what I could gather, it seems that the stick only returns integers, which explains why the directional button works erratically; and dwPOV return numbers from 0 to 31500, being 65535 when nothing is pressed.

This is what is being reported when nothing is pressed: https://i.imgur.com/yQ3FDXm.png
This is what reports when the Button 2 is being pressed: https://i.imgur.com/rkwBTdi.png
And this is when I move the left stick to it's left-up position and the right stick to it's right-down position: https://i.imgur.com/jyrFEoq.png

Though I might report this to the WINE team as well since in WINE's Joystick configuration panel, the 1, 2, 3 and 4 buttons flicker when holding them pressed, instead of just staying pressed and I recieve this message in the terminal:
0029:err:hid_report: process_hid_report Device reports coming in too fast, last report not read yet!

And here's the video of WINE's control panel bug: https://youtu.be/3jqli888hRs
Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

Jun 22, 2018, 06:19 PM
Violet CLM is offline
Report from Genstar, who I guess is having J2O account problems:

Combination of WINE and TWINSHOCK controller "moves the mouse cursor to the left in-game and some buttons work too fast on menus, directional keys don't even work properly and only the jump button works"

"In control joy.cpl, the 1,2,3 and 4 buttons flicker when pressed instead of just staying pressed... Also got the "device reporting too fast" error on the terminal when running WINE control joy.cpl"

Nothing pressed:

Button 2 pressed:

"when left stick is up-left and right stick is down-right":


"dwPOV shows from 0 to 31500, being 65535 when nothing is being pressed on the POV"
__________________
Love & Thunder

JCF Member

Joined: Sep 2011

Posts: 1,101

Love & Thunder has disabled reputation

Aug 17, 2018, 04:21 PM
Love & Thunder is offline
So, whenever I select a level from Home Cooked, and only from Home Cooked, the controller constantly registers movement right and down (EDIT: I have tested this further, and found this behaviour if I use the command line loading, but only for A Generic SP Episode II. My own custom levels seem to not be affected by this. Perhaps it's memory usage related?). This includes it making me stomp whenever I'm in the air, for instance if I've jumped. It also doesn't let me manually move down or right at all.


TSF level 1, working normally:



HH '17 loaded from its custom J2E episode, working normally:



A custom level I was working on a few years ago, loaded from a command line argument, working normally:



Same custom level, not working normally; stuck moving down and right:




Different custom level, same problem:
__________________
Virus666

JCF Member

Joined: Jan 1970

Posts: 4

Virus666 has disabled reputation

Aug 29, 2018, 05:55 AM
Virus666 is offline
Exclamation Happens on Linux as well

I can confirm that such incidence happens with Jazz Jackrabbit 2 1.23, JJ2+ 5.6 via Lutris (Wine-Staging 3.10 i386) on Linux Mint 19 (x64) Mate with Logitech F310 Xinput/DirectInput. As the game is started with Jazz2.exe -menu -windowed -nolog -nospy executable and arguments, mouse cursor immediately moves left even in OS level. When a map is started, the character looks up as it is shown in previous posts. I found related lines in the readme of the latest release of JJ2+:

"Improved support for DirectInput/XInput (read: XBox-style) controllers:

JJ2+ should now ignore corrupted controller data instead of seeming to constantly press the left and up keys."

https://docs.jj2.plus/

It looks like some Windows and WINE setups fail to "gnore corrupted controller data." When -nojoy argument is added, problem disappears but as it disables controller support, it's a bit pointless. Alternatively, Linux users can emulate keyboard buttons on controller with AntiMicro but that would be a dirty solution to be honest.

Here are the Lutris page and code of the installer script:

https://lutris.net/games/jazz-jackrabbit-2/
https://lutris.net/games/install/2782/view
Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

Aug 29, 2018, 09:48 AM
Violet CLM is offline
Okay. Did you get any data from the plus_controller_diagnostics.zip I linked prominently in the opening post? Also, does your character constantly look up in regular JJ2 (without the JJ2+ patch applied) as well, or is your problem unique to JJ2+ v5.6?
__________________
Virus666

JCF Member

Joined: Jan 1970

Posts: 4

Virus666 has disabled reputation

Sep 3, 2018, 11:45 AM
Virus666 is offline
Quote:
Originally Posted by Violet CLM View Post
Okay. Did you get any data from the plus_controller_diagnostics.zip I linked prominently in the opening post? Also, does your character constantly look up in regular JJ2 (without the JJ2+ patch applied) as well, or is your problem unique to JJ2+ v5.6?

Sorry for late reply. Unfortunately I am not competent enough to make plus_controller_diagnostics.zip or regular v5.6 version of JJ2+ run with WINE manually. Lutris script that automates installation makes use of additional tools some of are AutoHotkey, Helper. Merging and overwriting Lutris installation with your diagnostics tool didn't provide the additional data shown in previous posts.

As I installed JJ2 via WINE manually, JJ2 1.23 without JJ2+ doesn't have phantom controller issues that I experienced with JJ2+ v5.6. Here are my findings;

JJ2 1.23 without JJ2+ (controller is active):
- Characters do not constantly look up.
- Controller buttons work without a problem, they can also be remapped.
- No mouse cursor capture and/or shifting issue occurs.

JJ2 1.23 with JJ2+ v5.6 (controller is active):
- Characters do look up constantly.
- Most of controller buttons do not work. If up button is pressed, character stops looking up, but when you stop pressing, it returns to looking up. Jump, fire, pause, menu buttons work but down, left, right buttons do not work. Buttons cannot be remapped since up button is being constantly pressed. Up button works in menus but other direction keys do not work.
- Mouse cursor moves left in OS level if it is on the window of JJ2. Even if the cursor leaves JJ2 window, it keeps moving to the left edge of the desktop.
Virus666

JCF Member

Joined: Jan 1970

Posts: 4

Virus666 has disabled reputation

Mar 31, 2019, 05:53 AM
Virus666 is offline
Lightbulb JJ2+ v5.5 works

As March 2019, phantom controller input as well as moving mouse cursor issues with JJ2+ v5.6 still exist on Linux. By curiosity, I manually installed the game with WINE, applied 1.23 patch and JJ2+ v5.6 to bypass AutoHotkey, Helper files that Lutris script uses; the bugs are still there.

Today, I found plus.zip version of JJ2+ v5.5 on archive.org; edited Lutris script to replaced JJ2+ v5.6 URL with v5.5 URL, installed the game via edited Lutris script; lo and behold... And it worked without phantom controller input and moving mouse cursor issues!

https://web.archive.org/web/20171223...2plus/plus.zip
https://lutris.net/games/install/2782/view
Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

Apr 10, 2019, 11:22 AM
Violet CLM is offline
(You don't really need archive.org, by the way, we link to all the older versions in the first post of the general JJ2+ thread.)
__________________
French

JCF Member

Joined: Jul 2013

Posts: 26

French is doing well so far

Jul 16, 2019, 01:15 AM
French is offline
Red face Analysis of effects with P220 gamepad

Hello,

Here is my analysis of what happens with my gamepad, using the debugging JJ2+ version given by Violet CLM. I’m playing TSF on Windows 7.

I’ve got a very simple gamepad which is called ‘P220’ in other pieces of software:

You’ve got four arrows on the left with button 7 above, and six buttons on the right with button 8 above. In the middle you’ve got a scale of five steps 0–25–50–75–100 and you can move on it with + and − buttons to light up the LEDs (I’ve never really understood its meaning).

My gamepad works perfectly with JJ2 vanilla. I’ve configured the controls like this:


Trying to change these controls does not work with JJ2+, i.e. I can press Enter or a button of my gamepad to ask for changing the control, but then pressing a button or an arrow has no effect and I must press Escape (or button 7) to get back.

Here is what happens when I start the game:


Then using the buttons changes the values in the following ways.
  1. Pressing Left changes dwXpos to 0 and pressing Right changes it to 65535.
  2. Pressing Up changes dwYpos to 0 and pressing Down changes it to 65535.
  3. Using the + and − buttons changes dwZpos: 100 ⇔ 0; 75 ⇔ 16383; 50 ⇔ 32767; 25 ⇔ 49151; 0 ⇔ 65535.
  4. dwButtonNumber always shows the number of non-arrows buttons that are pressed, except according to point 6. So it can go from 0 to 7.
  5. Pressing any button gets dwButtons increased of 2 power button number minus 1. Say button number is n, then pressing that button adds 2^(n − 1) to dwButtons, and releasing it removes that same amount. E.g. pressing button 3 adds 4 (which is 2^(3 − 1)), pressing buttons 8 and 1 adds 129 (which is 2^(8 − 1) + 2^(1 − 1)). This is impacted by point 6 just below.
  6. Pressing buttons 1 to 6 at once (so the six buttons at the same time) is identical to pressing just buttons 4 and 6 (no matter which other buttons are pressed), so it increases dwButtonsNumber of 2 instead of 6, and dwButtons of 40 instead of 63.
  7. (Other dw values never change.)

Now regarding the effects in the game:
  1. Arrows do not work, but pressing Up makes my rabbit stop looking up (and it also allows Up and Down to work on my keyboard).
  2. All other buttons work normally, except button 7.
  3. Button 7 works like the Escape key (but non-repeated), so it opens the menu. But when it closes the menu and I keep it pressed, then it works normally i.e. my rabbit is running if I make it jump or move.

Effects in the menu:
  1. Button 7 still works like the Escape key (but non-repeated, i.e. you must press it several times to get back several times).
  2. All other numbered buttons have a very weird effect: it’s like pressing the Enter key and the Up arrow key, and it repeats instantly (Enter, Up, Enter, Up, Enter… as I keep it pressed). The repetition is like when you keep any key pressed, but there is no initial delay before the repetition starts, and it repeats even faster.
  3. Arrow buttons do not work, except the Up arrow, but it moves the cursor when unpressed (instead of moving it when pressed).
  4. Up is triggered when I get back to the main menu (with Escape or button 7) and when I open the ingame menu, so it immediately selects ‘Quit’.
  5. As mentioned above, trying to change the controls of my gamepad does not work.

So here is the straightforward analysis. Violet CLM, do you need more, i.e. do you want to see what happens if I change the controls from JJ2 vanilla and I get back to JJ2+? Or should I test something else with my gamepad?

Thanks in advance.

Last edited by French; Jul 16, 2019 at 01:29 AM. Reason: Add JJ2 version and OS version
Splat

JCF Member

Joined: Jan 1970

Posts: 14

Splat has disabled reputation

Sep 10, 2019, 11:06 PM
Splat is offline
Quote:
Originally Posted by French View Post
Then using the buttons changes the values in the following ways.
  1. Pressing Left changes dwXpos to 0 and pressing Right changes it to 65535.
  2. Pressing Up changes dwYpos to 0 and pressing Down changes it to 65535.
  3. Using the + and − buttons changes dwZpos: 100 ⇔ 0; 75 ⇔ 16383; 50 ⇔ 32767; 25 ⇔ 49151; 0 ⇔ 65535.
  4. dwButtonNumber always shows the number of non-arrows buttons that are pressed, except according to point 6. So it can go from 0 to 7.
  5. Pressing any button gets dwButtons increased of 2 power button number minus 1. Say button number is n, then pressing that button adds 2^(n − 1) to dwButtons, and releasing it removes that same amount. E.g. pressing button 3 adds 4 (which is 2^(3 − 1)), pressing buttons 8 and 1 adds 129 (which is 2^(8 − 1) + 2^(1 − 1)). This is impacted by point 6 just below.
  6. Pressing buttons 1 to 6 at once (so the six buttons at the same time) is identical to pressing just buttons 4 and 6 (no matter which other buttons are pressed), so it increases dwButtonsNumber of 2 instead of 6, and dwButtons of 40 instead of 63.
  7. (Other dw values never change.)

Quote:
Originally Posted by French View Post
65535
Personally, I'm not sure how it's relevant, but -- 65535 is also the ID # of all static objects displayed in the Sound & Music Properties popup dialog in JJ2+ drop-down menu. I'd thus just guess that 65535 is a default ID # for static objects used in JJ2+ .EXE file resources, according to ResEdit ("a resource editor for Windows programs").
Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

Jan 20, 2020, 07:52 PM
Violet CLM is offline
I've made a prospective fix (also in the first post). This fix is limited to the issue of players moving constantly while ingame and does not attempt to solve anyone's individual issues with mouse movement (should be an easy fix but I'm working on it separately) or menu navigation (I don't know what's going on there).
__________________
French

JCF Member

Joined: Jul 2013

Posts: 26

French is doing well so far

Feb 2, 2020, 09:09 AM
French is offline
It doesn’t change anything for me… The very same bugs are still here.
Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

Feb 3, 2020, 06:12 AM
Violet CLM is offline
Obviously the "diagnostics" part of the dll is now showing even more information in the HUD than before, so can you share what that looks like for you now?
__________________
French

JCF Member

Joined: Jul 2013

Posts: 26

French is doing well so far

Feb 20, 2020, 06:09 PM
French is offline
Yep:


It is information about the four joysticks I guess, but I’ve plugged only one.

Another change is that the two dwReserved values are now zero.
Attached Images
File Type: png joystick-debug.png (199.9 KB, 0 views)
Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

Mar 9, 2020, 09:29 PM
Violet CLM is offline
Okay, here's my current theory. Your controller doesn't have an actual directional pad--what it has is an analog stick that looks a lot like a directional pad. Annoyingly, the number it sends to your computer for directional pad data is the same number that a regular controller would use to say that its directional pad is pointing upwards. Vanilla JJ2 isn't affected by this issue because vanilla JJ2 can't be controlled by directional pads at all, only by analog sticks, but JJ2+ introduces directional pad support, and that's interacting badly with your controller. Fortunately, I think I was able to find a windows function to test if controllers actually have directional pads, to avoid querying their directions when the data would be incorrect. Does this work?
__________________
Oktan

JCF Member

Joined: Jan 1970

Posts: 4

Oktan has disabled reputation

Apr 23, 2020, 02:49 PM
Oktan is offline
Quote:
Originally Posted by Violet CLM View Post
Okay, here's my current theory. Your controller doesn't have an actual directional pad--what it has is an analog stick that looks a lot like a directional pad. Annoyingly, the number it sends to your computer for directional pad data is the same number that a regular controller would use to say that its directional pad is pointing upwards. Vanilla JJ2 isn't affected by this issue because vanilla JJ2 can't be controlled by directional pads at all, only by analog sticks, but JJ2+ introduces directional pad support, and that's interacting badly with your controller. Fortunately, I think I was able to find a windows function to test if controllers actually have directional pads, to avoid querying their directions when the data would be incorrect. Does this work?
Hey dude.
I just got an older PC that I've installed Windows XP on for playing old games like these. Anyway, JJ2+ didn't want to recognize my joypad at all, and when I tried using Joy2Key my rabbit kept looking up. I then tried that DLL you posted there and now everything works perfect and my joypad is recognized to start with, this is working great.

However, you know, there's a bunch of debug information cluttering the screen. Is there a way to turn it off, or can you make an update without the debug mode?
French

JCF Member

Joined: Jul 2013

Posts: 26

French is doing well so far

May 2, 2020, 11:06 AM
French is offline
Hello Violet CLM. Sorry for having missed your last message, it looks like I didn’t get the email notification for it. Happens sometimes… And thank you for having continued the process to fix this bug.

Yes, it works! There’s still a minimal problem though: pressing button 7 during game opens the ingame menu. Usually, I use this button to run. I’ve also configured button 4 to run and it works, but it is less handy. In menu screens, button 7 gets back to the previous screen and selects ‘Quit’ in the main menu — so you guess it acts like the Escape key. In Vanilla JJ2, button 7 had no particular effect. Buttons 1, 2, 3 and 4 act like Enter and this was already the case in Vanilla JJ2.

So my joypad has an analog stick, you say? Wow, that’s weird. I never noticed it anywhere, but you might be right (I don’t use my joypad for many things, actually). What does JJ2+ brings with its directional pad support? I don’t see anything about it in the readme…
Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

May 2, 2020, 05:00 PM
Violet CLM is offline
French: So, let's take a look at a more common controller model:

On the top left is the left (primary) analog stick, and below it is the directional pad. Vanilla JJ2 only accepts direction input from the analog stick, but JJ2+ accepts direction input from either one. Your controller only has the area you call "arrows," which from what I can tell sends data coded the same way that the controller above sends analog stick input, rather than the way it sends directional pad input. So, physically it's not a stick, but internally it seems to work the same way as one.

Regarding button 7... from what I recall, vanilla JJ2 did not have any way of pressing Esc using a controller at all? The button I chose to have the Esc functionality is what's commonly represented on other controllers as either Back or Select, rather than being another standard numbered button like on yours. On some level it would be nice to let people rebind it but I think we'll need to have the controls menu recoded first.

Anyway! I'm thrilled to hear the game is working for people now! We'll incorporate these fixes into the next JJ2+ release, which is still being worked on, but in the meantime, here's a 5.6 build that should work with people's controllers more: i.e. it's the same as the plus_controller_diagnostics_3.zip build but without all the debug information getting in the way.
__________________
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 03:04 PM.