Oolite Bulletins

For information and discussion about Oolite.
It is currently Mon Sep 24, 2018 7:46 pm

All times are UTC




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Fri Apr 20, 2018 11:15 am 
Offline
Competent
Competent
User avatar

Joined: Sat Jan 03, 2015 2:32 am
Posts: 51
Location: Yep, stuck in Oresrati. Again...
Hey guys

Firstly, thanks for adding this new function, really cool. However, it takes 16 scrolls to move from full to no thrust. Maybe I have a weird play style, constantly speeding up and down, or my mouse is horrible, but is there a setting somewhere which I can change, to make the scroll wheel more sensitive in game? (In game only, I don’t need a system wide change which makes me scroll to the bottom of my seventy page assignment when I move the scroll wheel 2 millimetres.)

Thanks in advance

_________________
Now with 100% less Wonderworm!


Top
   
PostPosted: Fri Apr 20, 2018 11:25 am 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5237
Afraid not. We do not process the mouse wheel delta at the moment, so it basically works as if pressing a key. I am pretty sure it can be fixed though, just need to find some time to play with this (I think hoqllnq already has a solution for it on the Mac, need to find the equivalent solution for Win and Lin).


Top
   
PostPosted: Fri Apr 20, 2018 5:44 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Mon Apr 27, 2015 9:03 pm
Posts: 297
Ha. This works so-so:
Code:
diff --git a/src/Core/Entities/PlayerEntityControls.m b/src/Core/Entities/PlayerEntityControls.m
index b9e0c4e..4bc93fc 100644
--- a/src/Core/Entities/PlayerEntityControls.m
+++ b/src/Core/Entities/PlayerEntityControls.m
@@ -912,20 +912,37 @@ static NSTimeInterval	time_last_frame;
 				// DJS: Thrust can be an axis or a button. Axis takes precidence.
 				double reqSpeed=[stickHandler getAxisState: AXIS_THRUST];
 				// Updated DJS original code to fix BUG #17482 - (Getafix 2010/09/13)
+				double MouseSpeedFactor = 5;
+				BOOL MouseIncreaseSpeed = (mouse_control_on)&&([gameView mouseWheelState] == gvMouseWheelUp) && !([UNIVERSE viewDirection] && [gameView isCapsLockOn]);
 				if (([gameView isDown:key_increase_speed] ||
 						joyButtonState[BUTTON_INCTHRUST] ||
-						((mouse_control_on)&&([gameView mouseWheelState] == gvMouseWheelUp) && !([UNIVERSE viewDirection] && [gameView isCapsLockOn])))
+						MouseIncreaseSpeed)
 					&& (flightSpeed < maxFlightSpeed) && (!afterburner_engaged))
 				{
-					flightSpeed += speed_delta * delta_t;
+					if(MouseIncreaseSpeed)
+					{
+						flightSpeed += (speed_delta * MouseSpeedFactor) * delta_t;
+					}
+					else
+					{
+						flightSpeed += speed_delta * delta_t;
+					}
 				}
 				
+				BOOL MouseDecreaseSpeed = ((mouse_control_on)&&([gameView mouseWheelState] == gvMouseWheelDown) && !([UNIVERSE viewDirection] && [gameView isCapsLockOn]));
 				if (([gameView isDown:key_decrease_speed] ||
 						joyButtonState[BUTTON_DECTHRUST] ||
-						((mouse_control_on)&&([gameView mouseWheelState] == gvMouseWheelDown) && !([UNIVERSE viewDirection] && [gameView isCapsLockOn])))
+						MouseDecreaseSpeed)
 					&& (!afterburner_engaged))
 				{
-					flightSpeed -= speed_delta * delta_t;	
+					if(MouseDecreaseSpeed)
+					{
+						flightSpeed -= (speed_delta * MouseSpeedFactor) * delta_t;
+					}
+					else
+					{
+						flightSpeed -= speed_delta * delta_t;
+					}
 					// ** tgape ** - decrease obviously means no hyperspeed
 					hyperspeed_engaged = NO;
 				}
You need to apply this git patch to the 1.86 branch, likely adjust the MouseSpeedFactor to suit your ship/system settings/mouse, and build the game.

_________________
warning sound if a missile is inbound: Missile warning


Top
   
PostPosted: Mon Apr 23, 2018 10:01 am 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5237
I have managed to get the mousewheel delta working on Windows, but I am not sure how portable that will be. I had to make changes to SDL.dll in order to achieve this result, which means that similar changes to the library will have to be made Linux-side and the game should be fed the wheel delta information in the same way as it was done for Windows.

Maybe Anonymissimus' way could be an easier to implement solution (and more cross-platform too, although obviously not as good as proper wheel delta handling), with a little modification: rather than hard-coding a MouseSpeedFactor, we could maybe make it a .GNUstepDefaults setting, so there would be no need to recompile the game in order to change it.


Top
   
PostPosted: Mon Apr 23, 2018 3:58 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Mon Apr 27, 2015 9:03 pm
Posts: 297
Quote:
I had to make changes to SDL.dll
Regardless of portability, this looks IMHO like a too expensive thing to do. It means the dev team has to maintain an own project-specific version of SDL. Once you want to upgrade to SDL2 or similar you have big problem.
EDIT
Linux-side modification to SDL is not possible in this manner, unless you include SDL in the oolite git repository and set up the build process to use it, see above. The dependency for compilation (libsdl1.2-dev) is downloaded from the distribution's repositories when setting up the build environment (on Ubuntu). I suppose the windows build package includes the SDL code ?!

My code above is hack-ish. A better solution should probably pre-modify the delta_t passed to that function. I guess that's what you tried.

A similar problem exists for how mouse movement translates into roll/pitch/yaw btw., which is also not configurable, and which I solved by modifying the
#define MOUSEVIRTUALSTICKSENSITIVITYFACTOR
This could be a similar configurable option.

_________________
warning sound if a missile is inbound: Missile warning


Top
   
PostPosted: Mon Apr 23, 2018 4:09 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5237
Quote:
Quote:
I had to make changes to SDL.dll
Regardless of portability, this looks IMHO like a too expensive thing to do. It means the dev team has to maintain an own project-specific version of SDL. Once you want to upgrade to SDL2 or similar you have big problem.
We have been maintaining our own SDL on Windows since about 2007. Time and again, being able to make direct changes to the library without having to wait for upstream to apply fixes or be compatible with what we wanted to do, has proven invaluable. As for SDL2 migration, problems are expected no matter what; it is never a completely smooth transition. Actually, the SDL2 migration attempt that had been started a while ago on github as a pull request by an external collaborator seems to have stalled early so I don't think we'll be upgrading any time soon.


Top
   
PostPosted: Mon Apr 23, 2018 9:01 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5237
In case there is interest in testing the new mousewheel handling on Windows, here is the link containing the new SDL.dll and the game exe that uses it (64-bit, 1.87 trunk): https://drive.google.com/open?id=1bxq7Y ... AIYFxkwQ5Y


Top
   
PostPosted: Sat Jun 16, 2018 8:33 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5237
Mousewheel handling adjusted to match original post request. It will be in for tomorrow's nightly.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited