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

Possible unintended drag effects under high latency #1

Open
Skeletonxf opened this issue Jan 17, 2021 · 0 comments
Open

Possible unintended drag effects under high latency #1

Skeletonxf opened this issue Jan 17, 2021 · 0 comments

Comments

@Skeletonxf
Copy link

Hi

First of all, thanks for making this mod open source. I found a potential issue while porting the code from new movement physics into my mod.

if(spacetimeDrag) {
    vec3d drag = obj.velocity * spacetimeDragCoefficient * time;
    obj.velocity = obj.velocity - drag;

this snippet in the Mover component that calculates drag might cause an object to fly backwards if time is large enough. The base coefficient is 0.09 so a time of 10 would still leave drag at 0.9, but if there's sufficient lag time could be more than 10, and other mods porting or building on new movement physics can apply their own coefficients on top of the base, so they could make the base coefficient bigger. In either case, you could plausibly end up with a drag which is larger than the object's velocity which would make it flip directions. In a really worst case scenario, if drag ended up larger than two times obj.velocity, this would cause a ship to fly out of the galaxy at increasing speed.

@Skeletonxf Skeletonxf changed the title Possible inintended drag effects under high latency Possible unintended drag effects under high latency Feb 28, 2022
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

No branches or pull requests

1 participant