I'm experiencing a weird bug in super8... the first time the client spawns in single-player, viewangles are wrong, possibly zeroed-out. But restarting the map (or any map) sets viewangles correctly. As the next step I'll track messages during and right after sign-on in case it's a protocol error.
What makes the very first sign-on different from later sign-ons?
Anyone ever come across this behavior?
client viewangles at spawn
Re: client viewangles at spawn
I got that before but can't remember how I fixed it. Seem to recall it might be something to do with auto-centering of the mouse following a movement, and the window position/size not being updated correctly, but that's the best I can do. If you've been working on any of the globals stored all over the place recently (window_center_x and friends) some of this may sound familiar.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
Re: client viewangles at spawn
This happens to me when i load singleplayer and the m_raw_input is initialized. Only with that.qbism wrote:I'm experiencing a weird bug in super8... the first time the client spawns in single-player, viewangles are wrong, possibly zeroed-out. But restarting the map (or any map) sets viewangles correctly. As the next step I'll track messages during and right after sign-on in case it's a protocol error.
What makes the very first sign-on different from later sign-ons?
Anyone ever come across this behavior?
U can veifiy this by turning off raw input then restarting the map, mostly i spawn at '-80 0 0', i suspect the -80 is forced due to client limitations, ya know.
Re: client viewangles at spawn
Thanks, the idea of centering based on window and raw mouse input might be related. The screenshot is exactly what I'm getting. High and to the left. I don't have "m_raw" but "m_filtered" cvar and "newmouseparams" array which I changed to disable mouse acceleration (or at least request that).
Mouse-centering based on a bogus resolution may be occurring before the screen dims are calculated. I don't know but that's what I'll check.
Mouse-centering based on a bogus resolution may be occurring before the screen dims are calculated. I don't know but that's what I'll check.
Re: client viewangles at spawn
Getting warmer...
This is the view on 1st map load (1st single player client spawn):
View if SetCursorPos is commented out in function IN_ActivateMouse:
View after second map load/ spawn, the correct view (45 degree rotation):
This is the view on 1st map load (1st single player client spawn):
View if SetCursorPos is commented out in function IN_ActivateMouse:
View after second map load/ spawn, the correct view (45 degree rotation):
Re: client viewangles at spawn
High and to the left seems to suggest I'm on the right track with my recollection. If your window rect was stored as {0, 0, w, h} that would happen in windowed modes; it would also happen if w and h had values that were too small (this would be valid for both windowed or fullscreen modes). I'm willing to bet that if you did a GetWindowRect each frame and updated these globals based on that, this problem would go away (GetWindowRect should be very fast so this shouldn't be a performance problem). Maybe set a breakpoint on that SetCursorPos call and see what values window_center_x and window_center_y have. Also check your ClipCursor call.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
Re: client viewangles at spawn
Great, I've been looking forward to the new Makaqu! I'll also look at GetWindowRect, may solve certain other occasional view direction glitches.
Re: client viewangles at spawn
Code: Select all
...
window_width = vid.width;
window_height = vid.height;
VID_UpdateWindowStatus ();
if (host_initialized) // mankrip
SetCursorPos (window_center_x, window_center_y); // mankrip - center the mouse, to avoid false movement detection
CDAudio_Resume ();
...
Re: client viewangles at spawn
this bug has annoyed me forever. Glad it's finally been tracked down!