Hedgewars goes crazy with custom mouse sensitivity

12 replies [Last post]
Lyberta
Lyberta's picture
User offline. Last seen 5 years 30 weeks ago. Offline
Joined: 2016-09-10
Posts: 177

I have this script that i run during login to set custom mouse sensitivity:

xinput --set-prop 12 "Coordinate Transformation Matrix" 1.65 0 0 0 1.65 0 0 0 1

However, now Hedgewars thinks I have insane mouse sensitivity, if I move a mouse a tiny bit, it moves the camera through the whole map or uncountable copies of the map in case of repeating map.

nemo
nemo's picture
User offline. Last seen 2 weeks 4 days ago. Offline
Joined: 2009-01-28
Posts: 1863

In the end we get that data from X via SDL.
Maybe you could try in latest dev to see if SDL2 is handling that better?

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Lyberta
Lyberta's picture
User offline. Last seen 5 years 30 weeks ago. Offline
Joined: 2016-09-10
Posts: 177

I've just pulled latest revision and rebuilt the game. Same problem. Hmm, strange, another SDL game - Xonotic - works fine.

nemo
nemo's picture
User offline. Last seen 2 weeks 4 days ago. Offline
Joined: 2009-01-28
Posts: 1863

https://hg.hedgewars.org/hedgewars/file/89423b1db329/hedgewars/uMisc.pas#l49

welp. there's the SDL call.

It could be that the other game has sanity caps on dx/dy.

You could add some logging there to see what SDL is giving us. My guess is the values are enormous.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Lyberta
Lyberta's picture
User offline. Last seen 5 years 30 weeks ago. Offline
Joined: 2016-09-10
Posts: 177

So I set it to identity matrix and everything works fine, but when I set it to say 1.1, mouse gets broken, the higher the value, the more broken it gets.

Wuzzy
Wuzzy's picture
User offline. Last seen 49 weeks 20 hours ago. Offline
Joined: 2012-06-20
Posts: 1310

Lyberta: Are you sure you used the SDL version of Xonotic?

Xonotic has two modes: GLX and SDL: xonotic-glx and xonotic-sdl.

Hi, I am a Hedgewars developer. Smile

Wuzzy
Wuzzy's picture
User offline. Last seen 49 weeks 20 hours ago. Offline
Joined: 2012-06-20
Posts: 1310

OK. I was now able to reproduce this. I was just too stupd to use xinput. Big Grin

I'm trying now to debug this.

Hi, I am a Hedgewars developer. Smile

Lyberta
Lyberta's picture
User offline. Last seen 5 years 30 weeks ago. Offline
Joined: 2016-09-10
Posts: 177

Interesting. I wonder what the actual bug is.

Oh btw. Xonotic GLX is broken with custom mouse sensitivity. I have to use SDL.

Yes, you read that right. Hedgewars SDL and Xonotic GLX are broken. Xonotic SDL is not.

Wuzzy
Wuzzy's picture
User offline. Last seen 49 weeks 20 hours ago. Offline
Joined: 2012-06-20
Posts: 1310

Sorry to say this, but I am still too puzzled about this bug.
I just can't find the cause of it.

Hi, I am a Hedgewars developer. Smile

Wuzzy
Wuzzy's picture
User offline. Last seen 49 weeks 20 hours ago. Offline
Joined: 2012-06-20
Posts: 1310

For your interest: Ths bug is tracked here:
http://issues.hedgewars.org/show_bug.cgi?id=512

As we don't know a real solution yet, maybe try to find a workaround? Is xinput the only way you can change your mouse speed?

Can you list the available properties of xinput? I read somewhere there's another property to change the mouse speed.

If --list-props shows you “Device Accel Constant Deceleration”, try to go with that one instead.

Hi, I am a Hedgewars developer. Smile

Lyberta
Lyberta's picture
User offline. Last seen 5 years 30 weeks ago. Offline
Joined: 2016-09-10
Posts: 177

No, I don't have that one.

Wuzzy
Wuzzy's picture
User offline. Last seen 49 weeks 20 hours ago. Offline
Joined: 2012-06-20
Posts: 1310

I have looked again into that and have decided to rework the mouse code a bit.

I finally managed to fix the bug you reported, the camera now works normally with any xinput value.

However, this is only a partial fix. Another, smaller, issue popped up:
If you enter the Quit or Pause menu, and move the mouse, the cursor jumps once. This can be annoying, but it is no longer game-breaking.

https://issues.hedgewars.org/show_bug.cgi?id=538

Hi, I am a Hedgewars developer. Smile

Lyberta
Lyberta's picture
User offline. Last seen 5 years 30 weeks ago. Offline
Joined: 2016-09-10
Posts: 177

Ok, now I can at least move the camera. But now selecting weapons is very hard. I have 1.7 sensitivity in xinput and I think the mouse in weapon selection moves 1.7 times faster than on desktop.

I have reported it here: https://issues.hedgewars.org/show_bug.cgi?id=185 but maybe it deserves a separate bug. Weapon selection sensitivity should match desktop sensitivity.

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]