p2sr / SourceAutoRecord

Speedrun plugin for Source engine games.
https://sar.portal2.sr/
MIT License
93 stars 29 forks source link

[suggestion] smooth veccam strafing #71

Closed ThisAMJ closed 2 years ago

ThisAMJ commented 2 years ago

Idea: Add some smoothing to veccam strafe type, so just strafing forward doesn't shake the view It doesn't have to be much, just average the last tick(s)'s velang and the current velang.

Krzyhau commented 2 years ago

I don't see the point of actually interpolating the angles. If the point is to make the smooth-looking TASes, why using veccam on a straight line in the first place?

I solved it by automatically switching veccam to regular vectorial strafing after the turn has been completed: c214f94720aee38be0934ea8b2ba8be137269bf2

It seems that it was the original intention from the beginning (hence why veccam actually checks the target angle and not velocity angle when going in a straight line), but line following algorithm is resetting itself once in a while, which caused these angle flickers. It is intentional though - without resetting it would be easy for an autostrafer to take a wobbly path, which could make movement not optimal.