Author Topic: Better mouse control  (Read 1576 times)

0 Members and 1 Guest are viewing this topic.

Offline LotF

  • 22
I spend the last couple of weeks on implementing better mouse control. This means separate binds for mouse buttons and support for mouse button 4, 5 and the mouse wheel. I've also implemented a "Cursor Flight Mode" similar to Sushi's script, but hopefully a bit improved. It's about time I get some feedback from interested players, so here it is.

https://www.dropbox.com/s/cm8lvthlftje54d/fs2open_better_mouse_control_r1.zip?dl=0

Edit: I forgot to mention you need to bind a key to "Toggle cursor flight mode" in options to enable the flight mode.
« Last Edit: February 23, 2015, 04:21:40 pm by LotF »

 

Offline niffiwan

  • 211
  • Eluder Class
Was this developed against trunk or the antipodes branch? Also, could you post the patch / diff file? :)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Linux OBS Packages: FSO 3.7.0 | FSO BP Build | wxLauncher (?) | PCS2 (?) | wxVPView (?)
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline LotF

  • 22
This was developed against trunk, including the patch file for mantis issue 0003134 (need to subtract that for a proper patch file). But here you go. https://www.dropbox.com/s/rgdkd5fug446hjk/better_mouse_control_r1.patch?dl=0

 

Offline niffiwan

  • 211
  • Eluder Class
Thanks for the patch.  From a quick skim through I have a few thoughts/comments.

1) given the proposed switch to SDL2.0 and unifying the Windows code to use SDL in the next release, it's probably better to base these changes off the antipodes branch rather than trunk
2) I feel that it would be better to have all the formatting changes in a separate patch, makes it easier to review these changes :)
3) there's some changes in the OpenGL code that (at a glance) don't seem related to mouse control, these would be better off in a separate patch
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Linux OBS Packages: FSO 3.7.0 | FSO BP Build | wxLauncher (?) | PCS2 (?) | wxVPView (?)
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline LotF

  • 22
I agree with all these points, and have been anticipating the SDL switch. Should be fairly easy to base this off of that. I'm looking for some feedback on how the new flight mode is experienced by mouse+keyboard players before all that though.

 

Offline niffiwan

  • 211
  • Eluder Class
fair enough, I'll see if I have some time to build a exec from the patch give it a whirl then,
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Linux OBS Packages: FSO 3.7.0 | FSO BP Build | wxLauncher (?) | PCS2 (?) | wxVPView (?)
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline LotF

  • 22
You might want to tweak some local variables in cursor_flight.cpp to see if you can improve the control. There's a slight sensitivity curve and the most important part is the pitch/heading corrections based on actual rotational velocity (see line 58, 61).

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Better mouse control
I believe you forgot some files from the patch; at least hud/hudcursor.* and and playerman/cursor_flight.* seem to be missing.

 

Offline nxc

  • 20
Re: Better mouse control
Very nice.

I've tested this build's cursor mode. I'll provide my impressions as there doesn't seem to be much feedback to date.

Impressions: It seems this implements an invisible cursor with a box as a boundary, and the coordinates control the magnitude of the turning input.

Being able to see the cursor would help a lot. In the ideal scenario, this bounding box should be of a comfortable size given the players screen resolution, screen DPI, and distance from the screen. So a way to control the size of the box would be useful. Sensitivity, in this case distance the visible cursor moves for mouse input, would be useful too.

Further feedback: another possible control system would be to have a displayed cursor which could be moved anywhere on the screen. Moving displayed cursor would turn the ship until the ships velocity matched the displayed cursor. The ship's velocity would need to be indicated by a marker, instead of the center of the screen, and might not be visible unless the player turned around if the player was flying backwards like in a mod like Diaspora. As the cursor comes closer to the velocity marker, the turn rate could be reduced to allow for fine adjustments.

Other improvements:
One thing I've had an issue with is not being able to increase mouse sensitivity high enough. I'm not sure if there is a way to do this that I'm unaware of. Ideal sensitivity is one where players can move the mouse the required distance to engage in dogfights while keeping the distance the mouse moves within comfortable limits. For players with a more restrictive palm or fingertip grip the current FS2 maximum sensitivity can be too low.

Invert mouse might be useful for anyone who switches back and forth between flight sims and space games because of muscle memory.

 

Offline LotF

  • 22
Re: Better mouse control
Thanks for your feedback. The build I provided should definitely show a cursor though, it is instrumental to this control method. I'll have to look into this.