Terrain Control Generated world is cuasing Severe stuttering when exploring, Can you help?

Discussion in 'Bukkit Discussion' started by ledhead900, Nov 10, 2011.

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

    ledhead900

    I been playing around on my test server recently and I have these awesome terrains but I just cannot explore more then about 20 radius before the spoutcraft client or vanilla client lock up and pause for long periods before resuming normal operation.

    It only does it in this one world the other worlds on test server work fine.


    At first my co helper thought it was a lighting bug lag issue as we had tons of lighting glitch's but we ran that world chunk generator plugin too self generate all chunk of world and we used the optional command to force a re calculate of all lighting in the world, This cleared up the lighting bugs visibly at least.

    The other thing we thought it could have been was my insane cave holes causing the cave bug I have reduced these a whole lot but its still happening I think they are within safe limits now bit issue remains.

    Any ideas I will share with you my base config for the world. If anyone knows of common reasons why this happens on custom worlds let me know it has to be something with how or what I generated that is doing this.

    PHP:
    # Possible modes : Normal, TerrainTest, NotGenerate, OnlyBiome
    #    Normal - use all features
    #    TerrainTest - generate only terrain without any resources
    #    NotGenerate - generate empty chunks
    #    OnlyBiome - use only TerrainControl biome generator
    Mode:Normal

    #######################################################################
    # +-----------------------------------------------------------------+ #
    # |                    Biome Generator Variables                    | #
    # +-----------------------------------------------------------------+ #
    #######################################################################

    # Integer value from 1 to 15. Affect all biomes except ocean and river
    BiomeSize:4

    # Integer value from 0 to 10. This affect how much lands will be generated. LandSize:0 - mean generates only ocean.
    LandSize:10

    RiversEnabled
    :true

    # List of custom biomes.
    # Example:
    #   CustomBiomes:TestBiome1, BiomeTest2
    # This will add two biomes and generate biome config files
    CustomBiomes:CakeMeteor

    #######################################################################
    # +-----------------------------------------------------------------+ #
    # |                   Terrain Generator Variables                   | #
    # +-----------------------------------------------------------------+ #
    #######################################################################

    # Enable old 1.7.3 terrain generator.
    OldTerrainGenerator:false

    # Set water level. Every empty block under this level will be fill water or another block from WaterBlock
    WaterLevel:64

    # BlockId used as water in WaterLevel
    WaterBlock:10

    # If this value is greater than 0, then it will affect how much, on average, the terrain will rise before leveling off when it begins to increase in elevation.
    # If the value is less than 0, then it will cause the terrain to either increase to a lower height before leveling out or decrease in height if the value is a large enough negative.
    MaxAverageHeight:0.0

    # If this value is greater than 0, then it will affect how much, on average, the terrain (usually at the ottom of the ocean) will fall before leveling off when it begins to decrease in elevation.
    # If the value is less than 0, then it will cause the terrain to either fall to a lesser depth before leveling out or increase in height if the value is a large enough negative.
    MaxAverageDepth:0.0

    # Can increase (values greater than 0) or decrease (values less than 0) how much the landscape is fractured horizontally.
    FractureHorizontal:0.0

    # Can increase (values greater than 0) or decrease (values less than 0) how much the landscape is fractured vertically.
    # Positive values will lead to large cliffs/overhangs, floating islands, and/or a cavern world depending on other settings.
    FractureVertical:0.2

    # Another type of noise. This noise is independent from biomes. The larger the values the more chaotic/volatile landscape generation becomes.
    # Setting the values to negative will have the opposite effect and make landscape generation calmer/gentler.
    Volatility1:0.2
    Volatility2
    :0.0

    # Adjust the weight of the corresponding volatility settings. This allows you to change how prevalent you want either of the volatility settings to be in the terrain.
    VolatilityWeight1:0.1
    VolatilityWeight2
    :0.2

    # Disable all noises except Volatility1 and Volatility2. Also disable default block chance from height.
    DisableBiomeHeight:false

    # List of custom height factor, 17 double entries, each entire control of about 7 blocks height from down. Positive entry - better chance of spawn blocks, negative - smaller
    # Values which affect your configuration may be found only experimental. That may be very big, like ~3000.0 depends from height
    # Example:
    #   CustomHeightControl:0.0,-2500.0,0.0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
    # Make empty layer above bedrock layer.
    CustomHeightControl:0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0

    # Attempts to replace all surface stone with biome surface block
    RemoveSurfaceStone:true

    # Disable bottom of map bedrock generation
    DisableBedrock:false

    # Enable ceiling of map bedrock generation
    CeilingBedrock:false

    # Make bottom layer of bedrock flat
    FlatBedrock:true

    # BlockId used as bedrock
    BedrockobBlock:7

    #######################################################################
    # +-----------------------------------------------------------------+ #
    # |                           Map objects                           | #
    # +-----------------------------------------------------------------+ #
    #######################################################################

    StrongholdsEnabled:true
    VillagesEnabled
    :true
    MineshaftsEnabled
    :true

    #######################################################################
    # +-----------------------------------------------------------------+ #
    # |                      BOB Objects Variables                      | #
    # +-----------------------------------------------------------------+ #
    #######################################################################

    # Enable/disable custom objects
    CustomObjects:true

    # Number of attempts for place rep chunk
    objectSpawnRatio:2

    # Deny custom objects underFill even it enabled in objects
    DenyObjectsUnderFill:false

    # Minimum and maximum time in seconds for growing custom tree from sapling./
    CustomTreeMinTime:60
    CustomTreeMaxTime
    :600

    #######################################################################
    # +-----------------------------------------------------------------+ #
    # |                          Cave Variables                         | #
    # +-----------------------------------------------------------------+ #
    #######################################################################

    caveRarity:8
    caveFrequency
    :3
    caveMinAltitude
    :40
    caveMaxAltitude
    :50
    individualCaveRarity
    :40
    caveSystemFrequency
    :2
    caveSystemPocketChance
    :5
    caveSystemPocketMinSize
    :10
    caveSystemPocketMaxSize
    :30
    evenCaveDistribution
    :false

    #######################################################################
    # +-----------------------------------------------------------------+ #
    # |                         Canyon Variables                        | #
    # +-----------------------------------------------------------------+ #
    #######################################################################

    canyonRarity:3
    canyonMinAltitude
    :50
    canyonMaxAltitude
    :64
    canyonMinLength
    :90
    canyonMaxLength
    :91
    canyonDepth
    :4.0

    #######################################################################
    # +-----------------------------------------------------------------+ #
    # |                  Old Biome Generator Variables                  | #
    # +-----------------------------------------------------------------+ #
    #######################################################################

    # This generator works only with old terrain generator!
    oldBiomeGenerator:false
    oldBiomeSize
    :1.5
    minMoisture
    :0.0
    maxMoisture
    :1.0
    minTemperature
    :0.0
    maxTemperature
    :1.0
    My Biome setup is not too overboard Below is an example of kind of thing I have been working on for a new world come 1.9 this is just an example is far from finished/tuned but most of my biome files are around the same ish height and variation restrictions so far.
    PHP:
    #######################################################################
    # +-----------------------------------------------------------------+ #
    # |                        Taiga biome config                       | #
    # +-----------------------------------------------------------------+ #
    #######################################################################

    # Chance of biome placing. By default it is 0 on Ocean and River biomes.This biome generated by another algorithm, but can be used here too
    # Examples:
    #   You have BiomeChance:1 in Desert and Plains biome and BiomeChance:0 in all other - this mean Desert have 50% and Plains have another 50%
    #   You have BiomeChance:3 in Desert and BiomeChance:1 in Plains and BiomeChance:0 in all other - this mean Desert have 3/4 and Plains have 1/4.
    #   You have BiomeChance:1 in all - this mean each biome have 1/Biome_Count chane to spawn
    # So spawn biome chance is BiomeChance/sum_all_other_BiomeChances
    # This is not good setting, but better than nothing
    BiomeChance:1

    # BiomeHeight mean how much height will be added in terrain generation
    # It is double value from -10.0 to 10.0
    # BiomeHeight:0.0 - mean height controlled only by world config and near 64 if it default
    BiomeHeight:0.2

    # BiomeVolatility similar BiomeHeight, but it adds volatility. Extreme Hills biome made by it.
    BiomeVolatility:0.1

    # Surface block id
    SurfaceBlock:80

    # Block id from stone to surface, like dirt in plain biome
    GroundBlock:80

    # Replace Variable: BlockIdFrom=BlockIdTo[(minHeight-maxHeight)]
    # Example :
    #   ReplacedBlocks:2=3(100-128),13=20
    # Replace grass block to dirt from 100 to 128 height and replace gravel to glass on all height
    ReplacedBlocks:None

    # Disable or enable small lava and water lakes on surface
    disableNotchPonds:true

    #######################################################################
    # +-----------------------------------------------------------------+ #
    # |                          Resource queue                         | #
    # +-----------------------------------------------------------------+ #
    #######################################################################

    # This section control all resources spawning after terrain generation
    # So first line is first resource which will be placed. Second line - second resource.
    # By default this set to be near notch settings.
    #
    # Possible resources:
    # Dungeon(Frequency,Rarity,MinAltitude,MaxAltitude)
    # Ore(Block,Size,Frequency,Rarity,MinAltitude,MaxAltitude,BlockSource[,BlockSource2,BlockSource3.....])
    # UnderWaterOre(Block,Size,Frequency,Rarity,MinAltitude,MaxAltitude,BlockSource[,BlockSource2,BlockSource3.....])
    # CustomObject()
    # Tree(Frequency,TreeType,TreeType_Chance[,Additional_TreeType,Additional_TreeType_Chance.....])
    # Plant(Block,Frequency,Rarity,MinAltitude,MaxAltitude,BlockSource[,BlockSource2,BlockSource3.....])
    # Grass(Block,BlockData,Frequency,Rarity,MinAltitude,MaxAltitude,BlockSource[,BlockSource2,BlockSource3.....])
    # Reed(Block,Frequency,Rarity,MinAltitude,MaxAltitude,BlockSource[,BlockSource2,BlockSource3.....])
    # Cactus(Block,Frequency,Rarity,MinAltitude,MaxAltitude,BlockSource[,BlockSource2,BlockSource3.....])
    # Liquid(Block,Frequency,Rarity,MinAltitude,MaxAltitude,BlockSource[,BlockSource2,BlockSource3.....])
    #
    # Some comments:
    # Block and BlockSource - can be id or name, Frequency - is count of attempts for place resource
    # Rarity - chance for each attempt, Rarity:100 - mean 100% to pass, Rarity:1 - mean 1% to pass
    # MinAltitude and MaxAltitude - height limits
    # BlockSource - mean where or whereupon resource will be placed
    # CustomObject resource - mean where in queue custom object will be trying to place
    # Tree types:
    #      Tree
    #      BigTree
    #      Forest
    #      HugeMushroom
    #      SwampTree
    #      Taiga1
    #      Taiga2
    # TreeType_Chance - similar Rarity. Example:
    #   Tree(10,Taiga1,35,Taiga2,100) - plugin trying to 10 attempts, in each attempt he try place Taiga1 ( 35% chance ) if not he place Taiga2 (100% chance)
    # Plant resource used for place something like flower, small mushrooms, pumpkins
    # Liquid resource is one block water or lava source
    #
    Dungeon(15,100,0,128)
    Ore(SNOW_BLOCK,32,35,20,0,128,STONE)
    Ore(CLAY,32,1,100,0,128,STONE)
    Ore(COAL_ORE,10,5,100,5,95,STONE)
    Ore(IRON_ORE,10,2,100,0,100,STONE)
    Ore(ICE,32,25,100,110,128,SNOW_BLOCK)
    UnderWaterOre(SAND,7,4,100,DIRT,GRASS)
    UnderWaterOre(CLAY,4,1,100,DIRT,CLAY)
    CustomObject()
    Tree(10,Taiga1,35)
    Plant(RED_ROSE,2,100,0,128,GRASS,DIRT,SOIL)
    Plant(YELLOW_FLOWER,2,100,0,128,GRASS,DIRT,SOIL)
    Grass(LONG_GRASS,1,10,100,GRASS,DIRT)
    Plant(PUMPKIN,1,3,0,128,GRASS)
    Liquid(WATER,20,100,8,128,STONE)
    Please does anyone have any suggestions or ideas on things that could cause such horrid pauses even tho the world is 100% pre chunk generated each time I tweak something.

    I tried tweaking java It helped a fair bit for the GC pausing but its on other worlds but its not doing anything for this world.
     
  2. Offline

    Daniel_l94

    Try turning down individual cave rarity to 25 (default) and see if thats whats causing the lag.
    Actually just copy and paste these settings as a test...
    Code:
    caveRarity:7
    caveFrequency:40
    caveMinAltitude:8
    caveMaxAltitude:128
    individualCaveRarity:25
    caveSystemFrequency:1
    caveSystemPocketChance:0
    caveSystemPocketMinSize:0
    caveSystemPocketMaxSize:4
    evenCaveDistribution:false
     
  3. Offline

    ledhead900

    Thanks for the reply will give them a test. I have feeling it is caves as lower I make them and less of them less amount of times I get the issue.

    I am rebuilding the lighting every time I generate the world as well.
     
  4. Offline

    bergerkiller

    @ledhead900 Let's continue here then. :)

    The same lag occurred when not using Async (auto) save. The only solution I have found, is giving the client time to fix the lighting themselves. The only way to do this, is to send the chunks with a set time in between them. This works really well, no 30 second lag spikes, but the downside is that it takes longer for chunks to 'be there'.

    Alternatively, you should fix this at the root, but that's harder than it seems. For example, mountains with edges end up having lighting bugs on the sides. Why? You could go and fire a lighting update during every new chunk loaded, but that is a bit of a CPU killer.

    So, I solve it by controlling the chunks the player receives, it works but is not the best solution.

    Adding to that, it happens to all freshly generated terrain. This makes the client having a hard time rendering the chunks every.single.time. it changes chunks. Even when having an interval of a second between chunks, it still lags badly. I'll consider firing a lighting repair call for every chunk that is being generated or populated.

    EDIT

    I don't know why...but having this in onChunkLoad:
    Code:
    ChunkHandler.getNative(event.getChunk()).initLighting();
    Pretty much fixed all lightning issues. Neither did the server lag because of it..odd

    EDIT2

    Nvm, it only lags when you enter the part of the world getting generated. I'll put it in an async thread, since all of it is in chunk space. (and thus it is safe to do so)

    EDIT3

    Conclusion:
    - Pre-generated world: no lighting issues: no client lag
    - Entering generated part of world: lighting issues: Chunk at wrong positions: client lag: initLighting fails for some reason.
    I don't know where it goes wrong, but without the lighting fixes it lags really badly.
     
  5. Offline

    ledhead900

    @bergerkiller
    Ok good your still on, well yea you know how nolagg crashed my main server that is not with those settings tho my main server has had same world over a year now. its only changing in 1.9.

    That is why I made the new one u see above its constantly being changed and the above code is wrong now as It needs fine tuning. I need to pinpoint what part of the main generation is fucking up tho, as like I said I get the server no spike non responding with client lockup as we talked about in your thread.

    It appears to not happen as a server lock up with nolagg async disabled have not tested again with it on but it is either that or me lowering the caves amount. eaither way the less amount of caves will limit chance of the CAVE BUG that crash's server apparently MC hates caves below 28 or something.

    But I did notice with what I had now I could explore with the odd 1min - 30s pause before it was total 5m+ lockups of server and client.

    But it does take a considerable amount of time between testing a new change due to the fact I need to rebuild the and pre generate at least 600 chunks enough to get a a reading on if screws up or if the overall settings that are global not controlled by biome are a bit dodgy. It would be helpful if you could put to bed if it was nolagg making the server stop responding and corrupting the map tho I still am unsure but I don't have time to muck around with it.

    Edit;
    Oh and its even longer between changes of the settings due to fact it locks up lol, I cant just explore like a SP world I get lockups of client and constant pauses that do not happen on the other worlds on the test sever but they are standard MC 1.8 generated.
     
  6. Offline

    ledhead900

    Fixed - Needed to turn the view distance on server properties to default 10, quite odd issue.
     
Thread Status:
Not open for further replies.

Share This Page