angular velocity is also random (except when we have Loch-n-Load)
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
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.