pac3 icon indicating copy to clipboard operation
pac3 copied to clipboard

Player Movement speed and gravity values function incorrectly (Further problems with Tickrate)

Open Logzombie opened this issue 5 years ago • 11 comments

Long story short, you don't get what you ask for when setting a number value for speed. For example, you ask for 200 run speed and you end up with: 176. 400 sprint speed: 352.

I would provide an example PAC, but honestly all you have to do is open up the editor, create a player movement part, and immediately test speed values.

How to replicate: See above. You can check your current movement speed by using the console command "cl_showpos 1" and checking the current velocity value at the top right corner.

Furthermore, I wasn't going to report this until I found out that if the hosted server's tickrate is lowered, player movement's inaccuracy in it's default and modified number values becomes even more inaccurate, and sluggish. From a 66 tickrate server where the problems usually aren't too noticeable without the command, to a 30 tickrate server where the default value for gravity (-600) is suddenly low gravity. I had this issue before on a previous server, though never reported it since I could never figure out the cause.

This causes a lot of inconsistency for PACs between servers that alter movement, as well as trying to set speed for a specific, intended value. Attempting to reach 280 speed requires the value to be set to 319 on a 66 tickrate server, for example. Just another one of PAC3's wacky bugs I guess

Logzombie avatar Aug 06 '20 06:08 Logzombie

Sounds like a gmod bug, but can check.

thegrb93 avatar Aug 06 '20 06:08 thegrb93

Just an update, this seems to harshly affect how the friction system works too. It's rather difficult to explain, but it doesn't seem to just be speed values.

Logzombie avatar Aug 06 '20 10:08 Logzombie

This probably has something to do with it https://github.com/CapsAdmin/pac3/blob/develop/lua/pac3/core/shared/movement.lua#L183

thegrb93 avatar Aug 21 '20 01:08 thegrb93

Or this https://github.com/CapsAdmin/pac3/blob/develop/lua/pac3/core/shared/movement.lua#L215

thegrb93 avatar Aug 21 '20 01:08 thegrb93

FrameTime code is correct. Move is called each server tick serverside so lower tickrates are compensated.

DBotThePony avatar Aug 22 '20 06:08 DBotThePony

I agree with that the speed should match what you set it to. The problem seems to be the friction code, which is designed to work against source engine's friction so I can override it.

I've adjusted the code to make it accurate now, but please test if you can. This will make outfits a bit faster, so that would have to be adjusted for. I also made it so walking left and forward does not add up velocity.

Keep in mind the default settings are intended to be an approximation to the vanilla player movement, it's not 100% accurate but should be close enough.

CapsAdmin avatar Jan 23 '21 01:01 CapsAdmin

Testing the newest PAC version, you can't move forwards, backwards, up or down for some reason with Player Movement when floating/flying in the air.

Here's my current movement settings:

image

I also made it so walking left and forward does not add up velocity.

This change might be causing it? Not sure.

Ternax avatar Jan 24 '21 01:01 Ternax

Testing the newest PAC version, you can't move forwards, backwards, up or down for some reason with Player Movement when floating/flying in the air.

Here's my current movement settings:

image

I also made it so walking left and forward does not add up velocity.

This change might be causing it? Not sure.

With those settings, I can move up and down fine.

CapsAdmin avatar Jan 24 '21 02:01 CapsAdmin

Testing the newest PAC version, you can't move forwards, backwards, up or down for some reason with Player Movement when floating/flying in the air. Here's my current movement settings: image

I also made it so walking left and forward does not add up velocity.

This change might be causing it? Not sure.

With those settings, I can move up and down fine.

Okay so I can move now I re-wore, but it's just extremely slow.

Ternax avatar Jan 24 '21 02:01 Ternax

Testing the newest PAC version, you can't move forwards, backwards, up or down for some reason with Player Movement when floating/flying in the air. Here's my current movement settings: image

I also made it so walking left and forward does not add up velocity.

This change might be causing it? Not sure.

With those settings, I can move up and down fine.

Okay so I can move now I re-wore, but it's just extremely slow.

Weirdly, from what I tested, air speed now appears to scale on ground movement. Max air speed now functions like Max ground speed, and overall air speed scales on the values that are linked to ground speed as well. Meaning it's actually now possible to sprint in the air for flight based PACs. I need to test this more with similar settings, but from what I tried, this was less broken and more just completely reworked. The different setups I attempted worked fine in singleplayer, I just need to do some further testing to see what can and can't be achieved.

Logzombie avatar Jan 24 '21 06:01 Logzombie

After recent rework of how max speed and overall movement is calculated, will need a 30-tick server to test this on at some point in the future. Unsure if this still persists as greatly as it did previously.

Logzombie avatar Feb 04 '21 10:02 Logzombie