Fullscreen Mouse Sensitivity

Discussion in 'Game Development (Technical)' started by chanon, Feb 13, 2007.

  1. chanon

    Indie Author

    Joined:
    Jul 28, 2004
    Messages:
    468
    Likes Received:
    0
    Hi,

    There is one issue that has been on my mind for a while which is related to mouse sensitivity.

    The issue is that, for most games, when they switch to 800x600 fullscreen, the mouse sensitivity goes up. Ie. the distance required to move your hand to move the mouse cursor from the left edge of the screen to the right edge of the screen is less than before switching to fullscreen.

    This is because people normally don't run windows at 800x600, they run it at higher resolutions. And the typical method to get the mouse position is to use the windows api. So instead of the mouse moving around in an area of 1024x768 (or more) it is moving around in an area of only 800x600 instead .. thus the mouse becomes more sensitive.

    I'm running WindowsXP on my notebook at the resolution 1680x1050 and so when a game (including my own) switches to 648x480 or 800x600, the mouse becomes very noticably more sensitive.

    I've seen some games that are not affected by this.

    One of the most recent games not affected by this is Bookworm Adventures. The game does something very strange, more easily noticable on widescreen monitors.

    When 3d acceleration is enabled, instead of switching to 800x600 resolution, the game seems to keep the desktop resolution and it scales the rendering instead. You will notice for example that the mouse cursor (when custom cursors are not enabled) stays the same size when switching to fullscreen. It doesn't get bigger. Also you will notice if you are using a widescreen monitor, that you can move the cursor beyond the left and right edges of the game image.

    By doing this they have kept the mouse sensitivity to the default / same sensitivity as the user's normal desktop.

    To do this amount of scaling at such high/higher resolutions (ex. mine is running at 1680x1050 smoothly) it needs 3D acceleration.

    So you will notice that if you switch off 3d acceleration, this time the game actually changes the screen resolution to 800x600 and the mouse cursor becomes larger and mouse sensitivity goes up.

    I'm wondering what you all think of this approach? Is it a good one?

    One of the negatives is that it may require more graphics memory/fillrate.

    Another method is to not use the actual mouse position in fullscreen mode, but to hide the windows cursor and lock it to the middle of the screen each frame and check the movement each frame and multiply it with a "sensitivity" factor and then draw the mouse cursor yourself. The downside of this is that you won't get to use the hardware cursor, and also the user might not like the sensitivity.

    And finally the other method is to just ignore this issue and assume that "casual" players probably don't set their screen resolutions to higher than 1024x768 (??)

    Any thoughts would be appreciated, thanks!
     
  2. PeterM

    Original Member

    Joined:
    Aug 5, 2004
    Messages:
    343
    Likes Received:
    0
    I can't say for sure, since I'm by no means an input expert, but does choice of API affect this?

    Presumably using DirectInput's raw relative Xs & Ys will cause the issue where on low resultions the mouse moves more distance on screen (but the same number of pixels).

    How about when using Windows' mouse movement WM_ events? Are they scaled or anything depending on the resolution?
     
  3. Anthony Flack

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    2,176
    Likes Received:
    0
    I am doing something similar to this. I check how far the mouse has moved since the last cycle, multiply that by the sensitivity factor and then reset the mouse cursor to the updated position.
     
  4. gosub

    Original Member

    Joined:
    Sep 10, 2005
    Messages:
    151
    Likes Received:
    0
    The DirectInput API gives you the raw mouse delta, bypassing the user settings and screen resolution. How you use this value depends on how your game is setup. If you're working in pixels, you can scale this value by the screen resolution. If your game is scaled by Direct3d (or by something you setup yourself) you would ignore the screen resolution and convert the raw value to your internal measurement system (meters, feet, twips, etc.)

    -Jeremy
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer