Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, pipes have a random spread for two reasons:
Fixing the velocity is pretty easy. We just need to recalculate it, knowing the speed of the projectile and the eyes angles.
Now, to the second part (the part that sucks).
Formula for angular velocity is (600, y, 0), where y is a random int from the closed interval [-1200; 1200]. The simplest solution would be to use a vector (600, 0, 0) for each pipe.
Unfortunately, the angular velocity affects the trajectory quite a lot due to the simulation of air drag. Here are some examples:
y is from [-1200; 0] with step 200
y is from [-200; 0] with step 20
I have added the sm_cf_show_projectiles_traces command to illustrate the trajectories, i hope you don't mind.
It turns out that the closer y is to 0, the farther the pipes will fly, which makes this approach pretty bad.
So, I decided to try another method - calculate the average horizontal distance that the pipes travel from 45 degree angle, and then find the y value that gives the average result (or close to it).
I made a small plugin to calculate that: link
It basically spams tons of pipes and calculates the average distance (for int values). And this is how I got the value of ANGULAR_VELOCITY_Y.
My full results are here: L20220121 (copy).log
Have fun.