StarMade Dev Update: Soft Borders

    schema

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

    I'm currently working on one of the most complicated features coming to the Universe of StarMade: Soft Borders.

    This basically means, that sectors won't load in right when you change it, but you will be always surrounded by preloading sectors. You will be able to see the objects (even moving ones) of adjacent sectors from your position. This feature will mark a milestone for the engine's core.
    However, it's very complex and complicated to implement. Here are some of the problems the system has to solve:

    • Every player effectively now loads 27 (3x3x3) sectors.


      This means a lot more memory used per player on the server (not a client problem). Current State: I managed to almost cut the size down to the size of one sector

    • a lot more sectors and objects have to be able to load in at the same time. Current State: improved performance by a lot, but still a problem at the moment

    • a lot more data has to be transferred to clients, since the simultaneous "available" objects by player is much bigger. Most of the data is only one time data (e.g. not moving objects don't need updates, and the number of moving objects won't increase from this) Current State: improved performance, though still concerning.

    • every object loaded has be updated, which will beat on the performance. Current State: working single player for fresh universe, not tested for populated universe.

    • Clean up functions: the clean up has to be done a lot more often since more sectors get inactive at once. Current State: good performance for normal universe in single player. not tested with more

    [*]
    Object positions have to be calculated relatively


    • As floating point (even double precision ) values are by far not big enough for the StarMade Universe, the sectors are used to represent a relative system. This means every sector is handled around the absolute zero, which allows for the virtual infinity of the universe. The function that has to be the most robust for the new system is to calculate the positions of objects in the surrounding sectors on the clients. For the server the relative positions don't play any role, since each sector has their own context. Current State: done

    • relative positions also influence sector requests by the client. Current State: working, but sometimes buggy (some objects only start being requested when the client is very near to it)

    [*]
    Physics dilemma: To keep StarMade as modular and extensible, the sector system described above is used. Every sector is using it's own physics context to handle scalability and number limits (float/double problem).


    • There has to be a function for secure transitions of objects from one in the next physics context. This is one of the most complex procedures (although it sounds easy at first): Bigger Objects can intersect the sector border: what sector does it belong to? The sector that has the bigger part of it of course. But now what happens if another object in the sector which the big object doesn't belong to collides with it? ... I basically have implement some kind of "bubble" which is formed around near objects to make sure they are in the same physics context. Current State: none



    Well, so much for what I'm currently working on,
    Thanks for playing StarMade,
    - schema
     
    Joined
    Jan 29, 2013
    Messages
    67
    Reaction score
    0
    • Legacy Citizen 2
    • Legacy Citizen
    We wish you all th ebest in implementation and coding. I look forward to testing it as well.
     
    Joined
    Feb 11, 2013
    Messages
    86
    Reaction score
    0
    Holy crap that sounds epic.
    I like your Idea with the physics context bubble, I don\'t know how I would implement it though. (I can program Java, but I\'m currently struggeling on a 2d physics engine for my entity based game engine)
     
    Joined
    Jun 9, 2012
    Messages
    142
    Reaction score
    0
    Cant wait to test out missle performance with this feature. I\'m sure it\'ll be a real eye opener.
     
    Joined
    Jan 25, 2013
    Messages
    16
    Reaction score
    0
    • Legacy Citizen 2
    • Legacy Citizen
    sounds hard! I hope you have sucsess making it work to whatever standerd you are aming for.
    If you need help testing or anything I would be very glad to help :)
     
    Joined
    Jan 22, 2013
    Messages
    7
    Reaction score
    0
    This is possible the best thing yet. I always wanted all this different stuff to be added to the game, yet I never thought of this.
    I suppose I had just got used to the current method of loading sectors and dealt with it.

    Thank you for being so awesome. We love you!