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

Remove pipes spread #84

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bodolaz146
Copy link
Contributor

So, pipes have a random spread for two reasons:

  1. velocity is random
  2. 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
20220112222418_1
y is from [-200; 0] with step 20
20220112222625_1
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.

@ldesgoui
Copy link
Owner

ldesgoui commented Feb 1, 2022

Thanks for the PR, I don't really have time to check it out right now, I'll try to before the end of the ongoing competitive seasons

The reasoning/data for ANGULAR_VELOCITY_Y seems sound to me.

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

Successfully merging this pull request may close these issues.

2 participants