Skip to content

Possible unintended drag effects under high latency #1

Description

@Skeletonxf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions