Lighting Updates Cause Lag ...

Discussion in 'Plugin Development' started by Jacek, Sep 2, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Jacek

    So I just added a simple looking ocean floor to my skylands world, it looks really cool, and is kinds nice not to lose all your stuff if you fall off !

    The problem is that the shadows of the islands on the causes loads of "More than 1000000 updates, aborting lighting updates" to be spammed to the terminal and the server lag horribly ! This only happens when someone logs in and they are in a area that has not had any players in it for a while.

    I guess there is not much I can do anything this, but thaught I may as well ask :D

    Any ideas ?
     
  2. Offline

    Timberjaw

    How are you updating/replacing blocks? If the new blocks don't have updated lighting info, you can end up with a huge area with invalid light info. As soon as something happens that causes a block ANYWHERE in that area to update, it will cause a cascade across the whole region, resulting in lag and warnings.
     
  3. Offline

    Jacek

    @Timberjaw At the moment I am using a block populator to set the bottom layer to bedrock and the 3 above it to water. I think that initial lighting calculations are done after all the populators have been called for the chunk, when you first log in to the newly generated world the islands have black shadows under them, this then becomes lighter and it seems to be that causing the lag.

    I guess I could set the light level for the blocks directly under an island to what it blends to after the login manually, but would that even prevent the calculations being done ?
     
  4. Offline

    Timberjaw

    @Jacek It does a full lighting pass after the initial generator phase. When the decoration phase rolls around (which is where the block populators are executed), the populators use the API methods (setType, etc) which should locally update lighting I believe.

    You could try getting a handle to the chunk and running initLighting() after your block populator runs.
     
  5. Offline

    Jacek

    I will try that thanks. I guess a populator would not normally add such large terrain features, unfortunately there is no way around doing so, well I could rewrite the entire skylands generator but that would take a long time :(

    I guess there may just be no solution :s

    Update: calling initLighting() after creating the floor seemed to double the world generation time, and the server basically crashed still when someone joins a new bit of the world, hmm.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
Thread Status:
Not open for further replies.

Share This Page