[0.4.0] [Duke3D] Weapon switching using mouse wheel

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.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [0.4.0] [Duke3D] Weapon switching using mouse wheel

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

by mjr4077au » Wed Sep 16, 2020 4:26 pm

Closing this as the weapon selection has been transitioned to CCMDs as desired :)

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

by mjr4077au » Mon Jun 22, 2020 12:09 am

Graf Zahl wrote:I still think that long term any action that doesn't need to check for a held button should be redone as CCMDs like in GZDoom - the main problem is properly clearing them at the right spots.
While this commit solves the immediate problem, it only concerns itself with the most common action put on the wheel, but what if someone wants to put an inventory cycle there, for example.
Completely agreed. If you think it's best to keep this issue open as a reminder that this part of the game requires transition, then that's all good :)

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

by Graf Zahl » Sun Jun 21, 2020 11:44 pm

I still think that long term any action that doesn't need to check for a held button should be redone as CCMDs like in GZDoom - the main problem is properly clearing them at the right spots.
While this commit solves the immediate problem, it only concerns itself with the most common action put on the wheel, but what if someone wants to put an inventory cycle there, for example.

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

by mjr4077au » Sun Jun 21, 2020 11:27 pm

Kinsie wrote:This issue appears to be re-resolved as of this commit. Thanks again for putting up with me through this, mjr!
Awesome, and thanks for reporting your issues so we could make the project better :thumb:.

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

by Kinsie » Sun Jun 21, 2020 11:22 pm

This issue appears to be re-resolved as of this commit. Thanks again for putting up with me through this, mjr!

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

by mjr4077au » Mon Apr 13, 2020 6:14 am

Rachael wrote:I definitely do not think it can be closed - at least until we can confirm that the issues Kinsie has are resolved. And we still haven't figured out what's so special about his mouse that only confuses Raze and we don't even know what other mice might produce this problem.
Apologies, I thought he said it was fine once he changed his FPS limit back to default but I forgot he was still having issues with SW.

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

by Rachael » Mon Apr 13, 2020 6:11 am

I definitely do not think it can be closed - at least until we can confirm that the issues Kinsie has are resolved. And we still haven't figured out what's so special about his mouse that only confuses Raze and we don't even know what other mice might produce this problem.

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

by mjr4077au » Mon Apr 13, 2020 2:36 am

With Sangman, the OP kindly confirming with me on Discord that his issues are resolved and the SDL work around being merged, this can potentially be closed.
Spoiler:

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

by mjr4077au » Sat Apr 11, 2020 12:14 am

That's unfortunate about SW. The issue at hand must just be a specific combo with how the games currently handle the mouse.

The default fps cap is at 200 fps. If yours was at 60 fps, then you either set it to that or didn't reset the right file which is why I made the comment. There's no good reason to not leave it at 200 fps or uncapped with these games and as you've seen right now, it's actually detrimental to set it to something low.

Irrespective, a user should be able to use whatever mouse and frame rate cap these wish. It just needs fixing. I'm glad we've determined a partial work-around for you though.

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

by Kinsie » Sat Apr 11, 2020 12:07 am

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.

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

by mjr4077au » Fri Apr 10, 2020 11:53 pm

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:

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

by Kinsie » Fri Apr 10, 2020 11:47 pm

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.

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

by mjr4077au » Fri Apr 10, 2020 2:24 pm

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.

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

by Kinsie » Fri Apr 10, 2020 9:40 am

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.

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

by Rachael » Fri Apr 10, 2020 6:02 am

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.

Top