3 ms·
I think the author has two issues in their approach. 1) You should be processing the whole message queue for all types of messages in one go. When using raw i
by YetiSpaghetti 2y ago
I think the author has two issues in their approach.
1) You should be processing the whole message queue for all types of messages in one go. When using raw input, author is peeking for "not input" event types. To me, this seems suspicious for performance. With a raw input device registered, the message queue is going to be huge.
While I don't know the underlying data structure of the message queue, if we assume an array, then the author's code will do a while loop of O(N) lookups for "not input" messages and remove them.
The correct approach is to dispatch the whole queue and ignore messages of types that you don't care about in your message handler.
2) You SHOULD be using the legacy input events for games, not raw input. The OS input massaging (ex: acceleration) is something that should remain consistent between applications. If there's acceleration: that's what users expect. You don't want the mouse to suddenly behave different in your application. Your games tuning values (sensitivity, accel) should apply relative to the OS values.
- munchler 2y ago> You SHOULD be using the legacy input events for games, not raw input. The author claims that this generates an overwhelming number of events for a high-performance mouse. Is this not the case?
- YetiSpaghetti 2y agoOnly when a raw input device is enabled. If I remember correctly, Windows will also send the raw input as legacy input messages. With no raw input device registered, the OG message queue is not bloated.
- Matheus28 2y agoFor shooter games, raw input is preferred. You want the same amount of mouse movement to move your camera the same amount every time. In those type of games, you aren’t controlling a cursor, so there’s no “expected behavior”.
- jamesgeck0 2y agoI'd argue that linear camera movement with mouse _is_ the expected behavior for FPS these days.
- YetiSpaghetti 2y agoIt's more complex than that. There's no right answer and therefore every answer is wrong :( For more critical observers, you're right: raw input is preferred. However, most users (casuals) expect similar settings as their OS. It's probably best left up to the user to decide, but to default things to the OS legacy settings. A more advanced player will know to tune the settings while the less advanced just want to launch and go.
- CrimsonRain 2y agoNo. He's right. No fps gamer expects the game camera speed to "match" mouse movement speed. Raw input-> mouse DPI * in game sense = effective dpi. Everyone has their own preferred edpi. This was you can change mouse or computer or in different games, you always get consistent movement.
- YetiSpaghetti 2y agoEveryone plays fps games. This includes people who wouldn't consider themselves "fps gamers". Users who care about mouse input will go into the settings to target the 'correct' settings for them. For everyone else, there's the OS values. We're not having the same argument, but I didn't clarify in my initial post properly: It's best to launch your app for the first time with the default OS settings. Let the "power users (fps gamers)" tune settings that enable raw input.
- rcxdude 2y agothat's just going to result in the non-power-users having a crap experience and not knowing why. Mouse acceleration is not a good match for FPS at any skill level.