BLOODWOLF333 / Brutal-Doom-Community-Expansion

A combined community expansion for the latest version of Brutal Doom. All of the latest bug fixes and new features in a single place to create the most polished and stable product.
173 stars 13 forks source link

Tactical class runs out of stamina faster in Multiplayer than in Singleplayer #454

Closed ShadowMosesIsland closed 1 week ago

ShadowMosesIsland commented 3 weeks ago

For clarification, this does NOT seem related to #453

Version

Latest snapshot

Environment

Computer

Port

Zandronum

Description

If you play as a tactical class, used stamina variable reaches its limit much faster in multiplayer than singleplayer.

Steps to reproduce:

  1. Launch Zandronum in offline mode, either through command line, ZDL, or Doomseeker. (Make sure you don't launch it with map parameter, explained why below)
  2. Start a new game, choose tactical class, launch any map for testing.
  3. Hold shift, and start moving forward until you run out of stamina. Take note of the distance you've ran using sprint.

Make sure to use the same difficulty, like Ultra-Violence to avoid any player speed modifications.

  1. Host a Zandronum server.
  2. Connect to the server.
  3. Join with Tactical class selected.
  4. Hold shift, and start moving forward until you run out of stamina. Compare the distance you ran using sprint.

Here's a video presentation of this bug: https://youtu.be/JzbAvIbSB9Q

An interesting observation If you launch Zandronum in an offline mode with a map parameter, and you spawn with Tactical class (this can be achieved if you set it in player setup options beforehand), the sprint will also be drained faster than normally. If you start a new game through menu, stamina drain will return to its normal singleplayer speed.

This is a very strange behavior, at first I suspected it could be caused by how Zandronum handles ACS scripts in Online vs. Offline mode, but the observation above made me doubt it. I'm still not sure what causes it. This did not seem to occur in the original brutal v21 mod, but I need to test it further.

ShadowMosesIsland commented 2 weeks ago

Tested in brutalv21.pk3, it does happen there as well.

Looking at DECORATE, the only solution I can think of is creating a running state specifically for multiplayer that drains stamina slower.

I'll try different things as well and see if something else works.

BLOODWOLF333 commented 2 weeks ago

Its Netcode witchcraft with latency allowing the code to skip around I suspect. I'm not really concerned about this issue its weird but not exactly broken

ShadowMosesIsland commented 2 weeks ago

That's what I suspect as well. It's not broken, but it is annoying in multiplayer sessions.

I was thinking, since stamina (in singleplayer as intended) lets player run such a great distance, and regenerates very quickly, would it make such a big difference to just remove it, and let the player run as much as they want to? The player can't shoot while running anyways, and I don't think there are any maps made specifically with that BD feature in mind. I've also noticed this version of BD adds a delay between pressing forward+sprint keys and actually starting to sprint, I think that's enough of a nerf for this.

BLOODWOLF333 commented 2 weeks ago

Honestly yeah I would like to remove the stamina mechanic because it overcomplicates crap and i dont like it but, other players would cry if I removed it

BLOODWOLF333 commented 2 weeks ago

image And thats 40 files and 994 lines I would have to modify and remove which is a tedious headache for something that someone else is going to immediately and bug report and complain about if I remove it.

ShadowMosesIsland commented 2 weeks ago

I see, can't satisfy everyone I guess.

One workaround I came up with would be to give player an item using ACS IsMultiplayer function, and based on the item's presence in player's inventory, the right amount of UsedStamina is given to get the closest duration of sprint between SP and MP. So in multiplayer the stamina drain could be halved, and I assume that would be enough to get it at least very close to SP.

The other, perhaps less headache to implement (but I'm not sure whether it'll actually change anything), would be to call A_GiveInventory("UsedStamina", 1) less often, and lower the amount of UsedStamina needed to jump to StopSprintTired state. The code skipping could be caused by calling the function too often, but that's just my uneducated on netcode guess.

BLOODWOLF333 commented 1 week ago

Im going to implement a compromise but its going to take days to complete