StarMade 0.09272: Collision System Level-Up (Hotfixed)

    schema

    Cat God
    Joined
    Feb 17, 2012
    Messages
    1,552
    Reaction score
    2,604
    • Schine
    Hello there,
    This update is dedicated to the physics collision system, as it was glitching a lot lately. It also was the main cause for servers to become unplayable.
    With this new update I hope that there is finally a LOT less glitches (there might be some leftover that didn't fall into my testing). Also in case of two object getting stuck in each other, there is now finally an automated method that will warp an object out of the other in case of a slow down.
    Note: those fixes are purely for the physics system, and the bug where stuff overlaps on docked structures might still be there. Undocking however seems to be glitch free now, and doesn't cause any falling-through-stuff.
    Here is a more technical changelog:
    - fixed bug where huge lag could occur when entering/exiting a structure multiple times

    - Physics stability&performance increased by a huge amount. Fixed hardest physics-bug yet:
    -- Symptoms:
    --- Glitches like falling through planets, clipping into stations, etc
    --- Huge performance decrease over time when using dock/undock enter/exit ship, leaving/entering active sector
    -- Reproduction:
    --- Docking a single core multiple times on the same dock on a planet and exiting it near another ship,
    that was just set down normally caused both ships to fall through the planet when undocking and exiting the ship.
    Further research confirmed that the error only happens when the undocked ship is in the radius of the player physics-activation
    -- Search:
    --- Complete physics library searched for inconsistency. Broadphase, Narrowphase, even collision-algorithms where taken apart
    one by one.
    After 25 hours, finally first inconsistency spotted, when switching off player physics on the server
    so the bug persists to happen because the client object would be snapped back by the server:
    The persistent manifolds for the broadphase pairs of the two ships were NOT delivered to
    the sequential impulse resolver of the CollisionIsland callback. Further narrowing down showed that the manifolds
    in question were in fact tried to be delivered, but got overwritten by manifolds from older instances, that seem to
    have occurred every time objects were added/removed on the physics (which also happens in case of dock).
    There were manifold leftover from old bodies, that were never cleaned up, causing the physics to ignore the
    real ones randomly (since the order of manifolds not fixed). The piling up of manifold also impacted the
    performance immensely.
    -- Solution:
    --- Checking for leftover manifolds, pairs, and algorithms everytime a proxy was deleted from the physics
    resolved the issue


    - added security method that will automatically check for stuck objects and warp them out of collision if necessary

    Thanks for playing StarMade,
    - schema

    EDIT: I once again forgot to remove a debug method which lead to a partial server crash on dedicated servers. I apologize :(. Hotfix is uploading