Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix long standing jump bug & movement lag based on FPS #755

Closed
wants to merge 13 commits into from

Conversation

ShadowsAdi
Copy link
Contributor

@ShadowsAdi ShadowsAdi commented Apr 29, 2022

// Legacy movement. The new one fixes FPS based jump and movement.
// 0 - Legacy behavior
// 1 - New behavior
//
// Default value: "0"
sv_legacy_movement 0

IT SHOULD BE TESTED MORE, I TESTED IT ONLY IN SINGLE PLAYER

ValveSoftware/halflife#81
ValveSoftware/halflife#682

https://github.com/pmrowla/hl2sdk-csgo/blob/master/game/shared/gamemovement.cpp#L1211

I'm sorry for the build.yml changes, just tested a few ways of achieving this.

@RauliTop
Copy link
Contributor

RauliTop commented May 9, 2022

@ShadowsAdi have you already test this on multiplayer? Working well?

This will change the behaviour of gameplay, probably a cvar to disable should be great.

@ShadowsAdi
Copy link
Contributor Author

ShadowsAdi commented May 9, 2022

have you already test this on multiplayer? Working well?

Yes, it's working just fine on multiplayer too, on a 32/32 server.

This will change the behaviour of gameplay, probably a cvar to disable should be great.

I don't think it requires a cvar because it fixes something that it's kinda broken. That slow was just annoying while using lower or higher FPS than 100.

@RauliTop
Copy link
Contributor

have you already test this on multiplayer? Working well?

Yes, it's working just fine on multiplayer too, on a 32/32 server.

This will change the behaviour of gameplay, probably a cvar to disable should be great.

I don't think it requires a cvar because it fixes something that it's kinda broken. That slow was just annoying while using lower or higher FPS than 100.

Physics are dependant from FPS, yes, it's a bug.

But some mods use this logic, for example KZ or HNS. If you have less fps, like 20, your slowdown jump is less than having 80-100 fps.

Consider adding the cvar, please. It's not for me, I'm talking about other players

@ShadowsAdi
Copy link
Contributor Author

But some mods use this logic, for example KZ or HNS. If you have less fps, like 20, your slowdown jump is less than having 80-100 fps.

This fix should help especially these mods because you can't gain more speed while bhopping ( as before ) it just fix the movement slow after jumping.

Consider adding the cvar, please. It's not for me, I'm talking about other players

I still don't see the relevance of adding a cvar just to fix something that was broken. This implementation is still under REGAMEDLL_FIXES macro so it's behaviour can be always changed as it was before.

@fred0r
Copy link

fred0r commented May 20, 2022

been using this for about ~1,5 weeks now and it seem to work correct.
a cvar would indeed be nice to make it easier to check the changed behavior, since there would be no need to stop the server and replace the cs.so every time.

@Garey27
Copy link

Garey27 commented May 21, 2022

There will be same behaviour no matter frametime * 1000 or msec.
https://github.com/s1lentq/ReGameDLL_CS/blob/b9cccc691bdabbf9cb573be8ee5e39c9a4f70c4a/regamedll/pm_shared/pm_shared.cpp#L2841
So tell me what a difference between this logic:

  • reduce timers by cmd.msec
    or
  • reduce timer by frametime which are calulcated also by cmd.msec ? This PR is useless.

@Garey27
Copy link

Garey27 commented May 21, 2022

Also if u look in csgo CGameMovement::ReduceTimers there global frametime not players one. Which is wrong for Half-Life/CS because we simulate shared movement code where timers reduces by player fps! not server one.

@ShadowsAdi
Copy link
Contributor Author

https://github.com/s1lentq/ReGameDLL_CS/blob/b9cccc691bdabbf9cb573be8ee5e39c9a4f70c4a/regamedll/pm_shared/pm_shared.cpp#L2841

I know, but it seems working correctly as it is now.

There will be same behaviour no matter frametime * 1000 or msec.

  • This PR is useless.

Test it out, compare the results by yourself and reply to this thread again.

@Garey27
Copy link

Garey27 commented May 21, 2022

Ok i was tested and its absolutely same behaviour as without fix. Notice the slowdown with 500 fps and no slowdown with 20 fps. (jump crouched > unduck when touch ground and hold +forward).
There no difference.
https://user-images.githubusercontent.com/4866813/169670327-1272b3f0-8c08-4bdd-a645-4b13862741a4.mp4

.

@ShadowsAdi
Copy link
Contributor Author

ShadowsAdi commented May 22, 2022

Ok i was tested and its absolutely same behaviour as without fix. Notice the slowdown with 500 fps and no slowdown with 20 fps. (jump crouched > unduck when touch ground and hold +forward). There no difference. https://user-images.githubusercontent.com/4866813/169670327-1272b3f0-8c08-4bdd-a645-4b13862741a4.mp4

.

After some debuggings, I found out that the windows version of the ReGameDLL is not based on any of the additional preprocessor defs. It is just a pure version without any additional fixes.

In linux, it seems to build it using the preprocessor definitions.

https://github.com/s1lentq/ReGameDLL_CS/blob/master/regamedll/msvc/ReGameDLL.vcxproj#L959

Also, check this out: https://github.com/ShadowsAdi/ReGameDLL_CS/runs/6542189855?check_suite_focus=true
It can't get the sv_legacy_movement ( a cvar created for this PR ) pointer address because it is under REGAMEDLL_FIXES
https://github.com/s1lentq/ReGameDLL_CS/blob/master/regamedll/dlls/game.h#L135

@fred0r
Copy link

fred0r commented May 23, 2022

pls approve workflow

@lespaul64
Copy link

lespaul64 commented May 31, 2022

Finally someone willing to fix this issue. This is a game bug, fix is a must.

Yes i noticed this bug too especially when playing fps more than 100~120. The only way to get fast jump penalty is to use fps_max 60, 60fps to play fps game haha this is terrible. With 60fps i can't even climb a pyramid, but with 256fps i can easily climb but this jump penalty bug is annoying. In certain mode for example ZE, we all know this mode is base on speed, but with so many obstacle that need to jump and duck i lost because of jump penalty.

I play csgo too, but csgo doesn't have this bug, i can play more than 300fps.

Where is the compiled binary for this latest PR? can't even find it. I wanna test too.

Edited
Wait do not approve yet, I've compiled the source and tested, this PR is changing game behavior, it doesn't have slowdown at all whether with 60 or 200fps. This is similar to use fuser2 = 0.0 in PlayerPreThink. A bit hard to jump on small platform because it's too smooth you will easily fall down.

@ShadowsAdi
Copy link
Contributor Author

ShadowsAdi commented May 31, 2022 via email

@ShadowsAdi
Copy link
Contributor Author

@lespaul64 could you test it after changes and review it?

@RauliTop
Copy link
Contributor

Please @ShadowsAdi, explain that new magical numbers

@lespaul64
Copy link

lespaul64 commented Jun 1, 2022

@lespaul64 could you test it after changes and review it?

Ok the new patch is acceptable for me, can feel the different. Playing with 256fps now feel a bit similar to 60fps jump penalty behavior. Maybe need so tweaks on the magic numbers & calculations. BTW where did you get that numbers?

@ShadowsAdi
Copy link
Contributor Author

Please @ShadowsAdi, explain that new magical numbers

Ok the new patch is acceptable for me, can feel the different. Playing with 256fps now feel a bit similar to 60fps jump penalty behavior. Maybe need so tweaks on the magic numbers & calculations. BTW where did you get that numbers?

I tested some values locally, on a windows build running at 1000 FPS + client running at 700-900 FPS.
These values seemed to fix the issue, I will do some more math to gain better results.

https://github.com/s1lentq/ReGameDLL_CS/pull/755/files#diff-2aeae34eebf30e19694d07e23caecbe3a34e1d0fdc4cec2fd75fd14b34a1c10bR2781

From my tests, cmd.msec values will be greater than 10 while client is running at < 150 FPS and will be lower than 10 from 150 FPS above.

@SmileYzn
Copy link

SmileYzn commented Jun 1, 2022

Sorry for noob question, but why not put a cvar to enable/disable this FPS fix with cvars to control these values if fix is enabled on server?

Soo someone can approve workflow to run the server testing values instead of a lot of builds.

@ShadowsAdi
Copy link
Contributor Author

Sorry for noob question, but why not put a cvar to enable/disable this FPS fix with cvars to control these values if fix is enabled on server?

Because that value should not be modified, same as other important values in gamedll.

dist/game.cfg Outdated Show resolved Hide resolved
regamedll/dlls/game.cpp Outdated Show resolved Hide resolved
@SmileYzn
Copy link

SmileYzn commented Jun 1, 2022

Sorry for noob question, but why not put a cvar to enable/disable this FPS fix with cvars to control these values if fix is enabled on server?

Because that value should not be modified, same as other important values in gamedll.

In your tests you changed values, OK

In my tests i can't change values? why?

I did not understand, ReHLDS ecosystem has a lot of these 'magical' values by cvars. What is the problem?

I really understand that variables and values are really important, but the reason to give the cvars for change according cvars that do not make sense to me.

Also other thing, is really a BUG because the original HLDS do not have values fixed and other small changes in code. Bug let's threat this as feature than a bug is not a better way in this case?

@SmileYzn
Copy link

SmileYzn commented Jun 1, 2022

I forgot to mention, in first release of this fps fix, the step sounds is a bit accelerated in remote server with pingboost 3, sys_ticrate 1000 and rate 100000 and updaterate & cmdrate 102.

First build from here: https://github.com/s1lentq/ReGameDLL_CS/actions/runs/2247829843

I did not know if fix is not complete in first build.

@ShadowsAdi
Copy link
Contributor Author

In your tests you changed values, OK

In my tests i can't change values? why?

I did not understand, ReHLDS ecosystem has a lot of these 'magical' values by cvars. What is the problem?

Right now, this is reGameDLL, it hasn't "magical" values by cvars when you shoot with a weapon, or when you reload one. They are hardcoded values for a reason.

Also other thing, is really a BUG because the original HLDS do not have values fixed and other small changes in code. Bug let's threat this as feature than a bug is not a better way in this case?

If more people complain for that, it's not a feature.

@ShadowsAdi
Copy link
Contributor Author

ShadowsAdi commented Jun 1, 2022

I forgot to mention, in first release of this fps fix, the step sounds is a bit accelerated in remote server with pingboost 3, sys_ticrate 1000 and rate 100000 and updaterate & cmdrate 102.

Fixed, thank you for report!

@SmileYzn
Copy link

Sorry for bump, but i want to test these changes.
Some news?

Thanks 👍

@SergeyShorokhov
Copy link
Member

@SmileYzn You can test with artifact releases 🧐

@SmileYzn
Copy link

@SmileYzn You can test with artifact releases monocle_face

Yes but it has requested changes, anyway i think will not change anything with

@ShadowsAdi
Copy link
Contributor Author

@SmileYzn You can test with artifact releases monocle_face

Yes but it has requested changes, anyway i think will not change anything with

It shows that because it hasn't been reviewed yet. I added the suggestions proposed by @wopox1337.

@fred0r
Copy link

fred0r commented Oct 11, 2022

5.21.0.573-dev on linux 
-pingboost 3
-sys_ticrate 1016
schedtool with SCHED_RR

players complain that they can jump further/higher than before - clients were running at 100 fps (dflt).

SergeyShorokhov

This comment was marked as duplicate.

@SmilexGamer
Copy link

Will this request be pushed soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants