Enable free roaming in demos while paused#1956
Enable free roaming in demos while paused#1956sm90x wants to merge 7 commits intoNeotokyoRebuild:masterfrom
Conversation
740ffd7 to
4cb3b8a
Compare
|
I'm impressed, there are some issues with the demo playback but I would have to double check whether that's a fault with this pr or if it is on master, I'm heading to bed so i will just jot some things down here for myself to check later. Bots (and most likely players too) repeatedly make footstep noises while the server demo is paused. an early return in CBaseEntity::EmitSound fixes the footstep noises, would need this everywhere where there is a call to g_SoundEmitterSystem.EmitSound( at least I guess, also check if there are any other ways to emit sounds that we want to pause when a demo is paused. Bots (and most likely players too) teleport to the exact position at the given tick when a demo is paused, instead of remaining in the interpolated position they were in just before the pause. This can be fixed in C_BaseEntity::InterpolateServerEntities() by removing the engine->IsPaused() check. The check is there for a reason, probably so when watching demos we can see exactly where any given player was at any given time, might be worth keeping this functionality and adding some kind of cvar to disable it by default? Would need further discussion. The "drone movement" relies on the walk key being pressed. Since user input isn't dealt with when a demo is paused like you said, the player will be stuck in drone movement if they had the walk key pressed while pausing the demo, or stuck outside of drone movement if they didn't, with no way to switch between the two while paused. bDroneMove should ignore m_lastCmd.buttons and instead check if the key assigned to +walk is pressed. You might want to also deal with whether the player is using toggle or hold to walk, as that makes a difference when the demo isn't paused. I'm not suggesting you implement these right away, more testing needs to be done still. (Edit) also the +speed command is used in spectate to slow the spectator down, also not handled when paused (Edit 2) also in drone movement the swim up and down commands are used to move the camera up and down when in drone movement |
|
wrt interpolation, we could just always interpolate during a paused demo, and if someone wants to see the exact position they can toggle cl_interpolate themselves |
AdamTadeusz
left a comment
There was a problem hiding this comment.
looking into the code further, I think you can drop all the vgui stuff. We have a class CInput that keeps track of what buttons the user is pressing even when a demo is paused. You could create a third CreateMove function in CInput that instead takes a CUserCmd created in C_HLTVCamera, like the dummy command in the CInput ::ExtraMouseSample function, populates the command and returns it to be used in place of m_LastCmd in C_HLTVCamera. this should handle all user input regardless of if the player is using a mouse and keyboard or controller or whatever, and means you need very few changes in C_HLTVCamera
slow (+sprint) movement, handle vertical (+moveup +movedown) movement, calc proper velocity by using cl_ speed values
|
I am probably not getting what you mean, but The sound looping issue is present in master. Another issue already in master, is the menu and console key becoming unresponsive. I am not sure how to reproduce, maybe pausing and unpausing, it doesn't happen every time though. |
|
@sm90x are you happy with me opening up a PR to your branch? I can implement my suggestion and you can merge it if you're happy with it |
|
Sure. |
…ckRefactor refactor, bug fixes
|
Looks clean now, thanks. My assumption on not processing inputs was wrong. |
Description
Enables moving around with roaming view in paused demos.
The two impediments to do this were 1) the movement using frametime, which I guess stops when the engine pauses the game, and 2) when paused the engine stops processing in-game inputs so pressing to move forward would do nothing.
Changed the roaming view to use realtime instead of frametime, and added a hacky way to detect movement button presses while paused using vgui.
Toolchain