cl_run is not synced

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

cl_run is not synced

Postby Marisa Kirisame » Sun Jul 19, 2020 1:07 am

So, couple people found a desync issue with a mod of mine, apparently caused by autorun. As it turns out... the state of cl_run for remote players is always false. I depend on a cl_run check to play the correct walk/run animations on a custom player, and it seems that a desync quickly happens if one player has autorun enabled and they walk around for a bit.

What I'm saying is:

- Player 1 has cl_run set to true, reading their client cvar returns that it is true
- Player 2 reads the same cvar, from player 1, but it returns that it is false
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: cl_run is not synced

Postby Graf Zahl » Sun Jul 19, 2020 1:50 am

This is not a bug. cl_run, as the name implies, is a "CLIENT" CVar, its value gets applied to the player input on the client side and is surely not safe to access on the game side of things, especially when you look at how it gets used:

Code: Select allExpand view
   speed = buttonMap.ButtonDown(Button_Speed) ^ (int)cl_run;


In short: Even it it was synchronised you wouldn't get what you want out of it anyway! The best that could be done here is to somehow transmit the 'speed' bit in the network packets in a way that honors both BT_SPEED and cl_run and any other future addition to control the run state.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: cl_run is not synced

Postby Marisa Kirisame » Sun Jul 19, 2020 4:06 am

This would be ideal, yes (since just checking for BT_SPEED isn't enough).
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: cl_run is not synced

Postby Graf Zahl » Sun Jul 19, 2020 4:13 am

Yes, I noticed that. I'd consider that part a bug but changing it now is bound to cause even more problems, so we need another flag.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: cl_run is not synced

Postby Matt » Sun Jul 19, 2020 11:48 am

Would using player.cmd.forward/sidemove work in this particular case?

EDIT: i.e., check if the absolute number is the higher or lower one and you'll know which run/walk animation would be appropriate.
Last edited by Matt on Sun Jul 19, 2020 4:24 pm, edited 1 time in total.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: cl_run is not synced

Postby Graf Zahl » Sun Jul 19, 2020 11:58 am

No, they can vary depending on the player's properties or even on the RunHealth setting.
If you want a reliable info "player input was in run mode" you need a new bit, but always keep in mind that this information by itself does *NOT* tell you that the player is actually running, it only tells you that the client input was made while run mode was on.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: cl_run is not synced

Postby Zhs2 » Mon Jul 20, 2020 9:56 am

Guncaster ran into the issue of checking cl_run in the player class a long, long time ago, for footstep interval immersion. To fix it, I ended up disabling it if the multiplayer variable was true. It's interesting to see this pop up for multiplayer support consideration now.
User avatar
Zhs2
Power of meh.
 
Joined: 07 Nov 2008
Location: Maryland, USA, but probably also in someone's mod somewhere
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: ATI/AMD with Vulkan Support


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests