[0.4.0] [Duke3D] Weapon switching using mouse wheel

Moderator: Raze Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by sinisterseed »

mjr4077au wrote:All the games feel good to play. I think Duke is now a cut above the rest with those latest cherry picks from upstream. Blood's vertical look axis scaling is off to me, looking up and down is ~50% faster than looking side to side.
Agreed about both points, especially Blood. Up/Down is really off in this game - or maybe it's the other way around, left/right that are the problematic parts, because they're nowhere near as responsive as up/down?
User avatar
mjr4077au
Posts: 834
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by mjr4077au »

The scaling is also off in the SDL versions of the game. Duke felt funky to me on Linux until I adjusted one of the axes via the console. Haven't got around to reporting it because I was going to try to bisect the issue a bit first.
Manuel-K
Posts: 75
Joined: Wed Mar 15, 2017 11:43 am

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by Manuel-K »

mjr4077au wrote: What version are you using?
b1ebb897e88ae262462eb6624b0a93cd40a367ed
mjr4077au wrote: The commits that change the input code are post 0.5.1 so you'd have to compile again from the latest git head to test.
I know.
User avatar
mjr4077au
Posts: 834
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by mjr4077au »

Manuel-K, you're right the scroll wheel doesn't work at all for weapon selection on Linux. This is different to the issue on Windows, as it worked intermittently on that platform. Interestingly enough, I can re-bind MWheelUp or Down with the menu, so the input is recognised.

I'll take a look to see if I can identity the issue.
User avatar
mjr4077au
Posts: 834
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by mjr4077au »

@Manuel-K, can you please compile from this branch in my fork? This has been tested on Arch Linux. https://github.com/mjr4077au/Raze/tree/ ... lectionFix

@Graf, if you happen to see this, any thoughts on the changes I've made prior to me sending a formal PR? It's not the right fix by any means, but you've already discussed how the input needs significant revamping. Not sure how else to skirt around it other than doing that revamp.
Manuel-K
Posts: 75
Joined: Wed Mar 15, 2017 11:43 am

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by Manuel-K »

mjr4077au wrote:@Manuel-K, can you please compile from this branch in my fork? This has been tested on Arch Linux. https://github.com/mjr4077au/Raze/tree/ ... lectionFix
Not that surprisingly it also works on my Arch Linux system.
User avatar
mjr4077au
Posts: 834
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by mjr4077au »

Manuel-K wrote:Not that surprisingly it also works on my Arch Linux system.
Excellent, thanks for confirming, and excellent choice on distro :wink:.

I've already pushed this fix in another branch to the main project and am just waiting a review on it.
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by Kinsie »

This still doesn't work properly for me on 0.6.0 using Windows 10 x64. Am I alone in this?

EDIT: Fiddling further, it looks like it's less the mousewheel and more the "next weapon" and "previous weapon" keybinds. Binding them to keys or using the associated console command both seem to have no luck. Auto-switch on weapon pickup and using the number keys to change weapon slots both work fine.
User avatar
mjr4077au
Posts: 834
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by mjr4077au »

Will continue this here instead of Discord. Because the Build games don't use CCMDs for binding keys, calling +Next_Weapon despite resolving is not a valid way of changing the weapon, etc.

Binding next/prev weapon to any key on my keyboard works fine for me. I recommend deleting your configuration file completely and running the game fresh, then testing again.
User avatar
Rachael
Posts: 13965
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by Rachael »

I gave Kinsie a build that had this change in it:

Code: Select all

diff --git a/source/rr/src/player.cpp b/source/rr/src/player.cpp
index cdaaa867f..e50e5ee0a 100644
--- a/source/rr/src/player.cpp
+++ b/source/rr/src/player.cpp
@@ -3383,9 +3383,19 @@ void P_GetInput(int const playerNum)
         weaponSelection = 14;
     else if (buttonMap.ButtonDown(gamefunc_Alt_Weapon))
         weaponSelection = 13;
-    else if (buttonMap.ButtonDown(gamefunc_Next_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel > 0))
+    else if (buttonMap.ButtonDown(gamefunc_Next_Weapon))
+    {
+        buttonMap.ClearButton(gamefunc_Next_Weapon);
+        weaponSelection = 12;
+    }
+    else if ((buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel > 0))
         weaponSelection = 12;
-    else if (buttonMap.ButtonDown(gamefunc_Previous_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel < 0))
+    else if (buttonMap.ButtonDown(gamefunc_Previous_Weapon))
+    {
+        buttonMap.ClearButton(gamefunc_Previous_Weapon);
+        weaponSelection = 11;
+    }
+    else if ((buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel < 0))
         weaponSelection = 11;
     else if (weaponSelection == gamefunc_Weapon_1-1)
         weaponSelection = 0;
Kinsie said that it worked in Blood and I saw Blood clears the input state of those keys, so I attempted it in the RedNukem code and now it works "sometimes". I'm at a loss trying to figure out what the problem is, but I figured posting my work here might get us closer to a solution. I'm not committing this to the repository since the fix is unreliable.
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by Kinsie »

mjr4077au wrote:I recommend deleting your configuration file completely and running the game fresh, then testing again.
Good call. Unfortunately, it didn't change anything.
User avatar
mjr4077au
Posts: 834
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by mjr4077au »

Rachael wrote:I gave Kinsie a build that had this change in it:

Code: Select all

diff --git a/source/rr/src/player.cpp b/source/rr/src/player.cpp
index cdaaa867f..e50e5ee0a 100644
--- a/source/rr/src/player.cpp
+++ b/source/rr/src/player.cpp
@@ -3383,9 +3383,19 @@ void P_GetInput(int const playerNum)
         weaponSelection = 14;
     else if (buttonMap.ButtonDown(gamefunc_Alt_Weapon))
         weaponSelection = 13;
-    else if (buttonMap.ButtonDown(gamefunc_Next_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel > 0))
+    else if (buttonMap.ButtonDown(gamefunc_Next_Weapon))
+    {
+        buttonMap.ClearButton(gamefunc_Next_Weapon);
+        weaponSelection = 12;
+    }
+    else if ((buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel > 0))
         weaponSelection = 12;
-    else if (buttonMap.ButtonDown(gamefunc_Previous_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel < 0))
+    else if (buttonMap.ButtonDown(gamefunc_Previous_Weapon))
+    {
+        buttonMap.ClearButton(gamefunc_Previous_Weapon);
+        weaponSelection = 11;
+    }
+    else if ((buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel < 0))
         weaponSelection = 11;
     else if (weaponSelection == gamefunc_Weapon_1-1)
         weaponSelection = 0;
Kinsie said that it worked in Blood and I saw Blood clears the input state of those keys, so I attempted it in the RedNukem code and now it works "sometimes". I'm at a loss trying to figure out what the problem is, but I figured posting my work here might get us closer to a solution. I'm not committing this to the repository since the fix is unreliable.
Heh looks like we worked out the same thing as I have this open PR to do nearly the same thing. This does fix the SDL versions for now. I gave Kinsie a build with that PR included but it apparently didn't help (kind of didn't expect it to either)
Kinsie wrote:
mjr4077au wrote:I recommend deleting your configuration file completely and running the game fresh, then testing again.
Good call. Unfortunately, it didn't change anything.
Can you please try playing without vaync on and without a frame rate limit? Just let the game run as fast as possible and tell me if that helps.
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by Kinsie »

mjr4077au wrote:Can you please try playing without vaync on and without a frame rate limit? Just let the game run as fast as possible and tell me if that helps.
With VSync and framerate limit turned off (I previously had it at 60fps), weapon switching in Duke 3D works perfectly in Raze 0.6.0 (even without Rachael's modified build). Shadow Warrior remains unchanged.
User avatar
mjr4077au
Posts: 834
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by mjr4077au »

Ok that's good. I'd recommend playing with zero frame rate cap and just have vsync on to cap it. The frame rate cap is game-side so that means if you cap the game runtime, you only get input 60 times/second. If you let the renderer cap the game via vsync, you'd still be getting input at 400 times/second or whatever you happen to get on your device.

Can you try Shadow Warrior with the build I gave you on Discord yesterday? Rachael's patch only does RR, the build I gave you patches the "big three".
Kinsie wrote:
mjr4077au wrote:I recommend deleting your configuration file completely and running the game fresh, then testing again.
Good call. Unfortunately, it didn't change anything.
And if I may be so cheeky, sounds like you didn't try the game exactly "fresh", did you? :wink:
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: [0.4.0] [Duke3D] Weapon switching using mouse wheel

Post by Kinsie »

mjr4077au wrote:Can you try Shadow Warrior with the build I gave you on Discord yesterday? Rachael's patch only does RR, the build I gave you patches the "big three".
Gave it a shot, didn't notice any appreciable changes in behavior in Duke or SW - they both function more or less the same as they did in 0.6.0 with the framerate limiter disabled.[/quote]
mjr4077au wrote:And if I may be so cheeky, sounds like you didn't try the game exactly "fresh", did you? :wink:
Dunno what to say man, I used the default INI file generated by Raze when an INI isn't present.
Post Reply

Return to “Closed Bugs [Raze]”