StarMade Prebuild 0.09398: Physics lag fix

    schema

    Cat God
    Joined
    Feb 17, 2012
    Messages
    1,552
    Reaction score
    2,604
    • Schine
    Good news,

    the lag/fps drop bug has finally been fixed. I also managed to increase the general performance of the physics engine in cube-cube collisions.

    I'm still releasing this as a pre-build to check for eventual bugs from the new system. I'll do a full release of this exact version if there are no problems found in the test.

    http://files.star-made.org/build/pre/starmade-build_20130918_153848.zip

    (as always, "dev" is both password and username)

    Technical: This bug was hard to find since it's trigger seems non-deterministic. The reason for the lag was iteration: When two structures are near each other, they check the area intersecting between their bounding boxes. First a region (8x8x8 segments) test is done, then the segments are iterated with each others. Now when a planet or a huge ships collides with another big structure, empty segments are iterated over bug skipped:

    So for every segment in A, if it is non empty, find the non empty segments that have an intersection with that segment. This works ok for big ships for A and e.g. planets for B. However, the order of what is tested against what depends on the order it was added to physics (and as a precondition must not matter). So when revisiting a sector, the order can change (even likely changes). So suddenly the planet is A and the ship is B, and this caused the problem. If B has a lot of empty segments they are iterated over (but not processed) for all nonempty segments of A. This caused the number of iterations done to skyrocket into the millions for work, that only should have been done once (skipping empty segments).

    The fix now caches for both structures the non-empty segments for each structure that are part of the intersection. This gets rid of the problem completely and improves the general performance (as the additional iterations were always happening, just not slowing down as much. Furthermore this also gave me the opportunity to cache the segment Axis-Aligned Bounding Boxes calculation, which saves a lot of multiplication and branches per iteration.

    With this new system there also is another opportunity to optimize. Ordering the Axis-Aligned Bounding Boxes and doing an axis sweep (like it is done with the general physics broadphase) could further reduce iterations by a lot.

    Thank you for testing,

    and thank you for playing StarMade,

    - schema
     
    Joined
    Jun 20, 2012
    Messages
    231
    Reaction score
    6
    Please release a hotfix patch asap for the constant linux server crashes
     

    schema

    Cat God
    Joined
    Feb 17, 2012
    Messages
    1,552
    Reaction score
    2,604
    • Schine
    I will as soon as I\'m sure this version works
     
    Joined
    Aug 3, 2013
    Messages
    34
    Reaction score
    2
    • Purchased!
    • Legacy Citizen 9
    No clue what you just said, but it sounds cool. :)

    Looking forward to less lag, and fewer crashes! Thanks again for making Starmade.
     

    schema

    Cat God
    Joined
    Feb 17, 2012
    Messages
    1,552
    Reaction score
    2,604
    • Schine
    yes. I should have maybe said that in the article :D
     
    Joined
    Sep 9, 2013
    Messages
    30
    Reaction score
    0
    • Legacy Citizen
    Thank you Schema! Finally!! Me and my brother were having major issues with this as we both love giant ships and planetary bases - which was unthinkable before.
     
    Joined
    Jun 6, 2013
    Messages
    30
    Reaction score
    0
    • Legacy Citizen 2
    • Legacy Citizen
    can you implement a server config line that allows ships of any size and shape to dock on a minimal docking space? (if you havent done that yet)
     
    Joined
    Jul 4, 2013
    Messages
    19
    Reaction score
    0
    • Purchased!
    • Legacy Citizen 2
    • Legacy Citizen
    I think that\'s already been implemented.

    (Also; suggestions go in the suggestion forum)
     
    Joined
    Aug 26, 2013
    Messages
    18
    Reaction score
    0
    • Legacy Citizen
    I\'m quite impressed with your work Schema, even more impressed that you\'re so frequent with these updates. Keep up the amazing job! This fix will help me out alot!
     

    Fum

    Joined
    Jul 1, 2013
    Messages
    54
    Reaction score
    0
    • Purchased!
    Thank you Schema for the continued development and keeping us all informed on an almost daily basis.

    With the physics calculations you mentioned, I came to realise that the most basic and limiting factor for performance of Star Made is that there are millions of tiny calculations to be done when big ships meet.

    Long story short:
    Have you considered using OpenCL as an option for players?

    As far as I know, doing GPU-based physics calculations increases the performance drastically when compared to a CPU.
    I know not all players will be able to take advantage of it, but if you could do a bit of testing and it turns out to be possible and increases performance for large ship clusters, then an option to use OpenCL would be awesome :D
     
    Joined
    Feb 21, 2013
    Messages
    16
    Reaction score
    0
    • Legacy Citizen 2
    • Legacy Citizen
    Will this information be cached client-side or server-side? If client-side, is it going to contribute to client-server data mismatch problems?

    I\'ve seen this problem and frequently need to delete my \\client-database\\DATA folder because of my local data not being accurate with what the server has.



    You find and squish bugs with amazing speed, Schema. Keep up the great work!
     
    Joined
    Aug 21, 2013
    Messages
    5
    Reaction score
    0
    hay schema you should have a youtuber make a video on how to download and to install and back up the files so player can find a way to do it with out geting lost in the files
     
    Joined
    Aug 23, 2013
    Messages
    6
    Reaction score
    0
    people who dont know how to download, install and backup pre-builds. should not use pre-builds
     

    schema

    Cat God
    Joined
    Feb 17, 2012
    Messages
    1,552
    Reaction score
    2,604
    • Schine
    This is different problem. I\'m looking to redeign the client request protocol soon to be a lot faster, and also a lot more robust so these kind of issues are no more hopefully
     
    Joined
    Jun 20, 2012
    Messages
    231
    Reaction score
    6
    Omg 12 hours later can u just release a hotfix already so our vps servers can stay online for linger then 5 mins
     
    Joined
    Jun 24, 2013
    Messages
    1,491
    Reaction score
    20
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen 10
    Once again, you are straight on the tail of these bugs.

    I love this game, and this bug really annoyed me. But now that this bug is getting removed, i will be able to watch titans just blast each over into oblivion.

    Thanks Schema. :)
     
    Joined
    Jun 25, 2013
    Messages
    85
    Reaction score
    1
    • Legacy Citizen 2
    • Legacy Citizen
    i am sure that those of us who build planet dwarfing ships, will still have lag issues. though i hope lesser craft will put less stair on the servers, so we can build yet bigger :P