Terrain Control

Terrain Control

235k Downloads

Some BO3 Branches can get skipped during generation

riddle opened this issue · 9 comments

commented

We are creating a custom mineshaft made out of BO3 branches and hit a wall:

ss 2014-11-08 at 10 46 54

This is a missing tunnel piece, but as you can see it is just skipped when “pasting” into the world – there is another piece coming out of it on the left side.

Here’s a slightly better shot:

ss 2014-11-08 at 09 58 41

The piece with 4 Nether Brick columns is the origin/root piece. It has 4 emerald blocks which can spawn 4 more tunnel pieces (branches). Those branches can spawn their own (and they are also marked with emerald blocks for posterity).

The problem happens in other parts too:

ss 2014-11-08 at 10 15 08

As you can see, an entire branch seems to have been skipped, but a branch is still spawned on the end of where that would be.

I’m sorry I’m reposting this from forums, I just think this is a technical issue (or a bug), not a brainstorming/feature discussion. If it’s in the wrong spot, I apologize.

commented

On top of that we found that:

  1. We haven’t seen two pieces missing one after another.
  2. Other BO3 branched structures don’t affect this case (we have custom glowstone crystals done using a similar technique, appearing near the ceiling)
  3. Only tunnel pieces are missing (stairs and intersections were fine) – they are 12 blocks long, 4 wide, 4 high.
  4. Every missing tunnel piece (out of 12 we investigated) spans two chunks (exists on a chunk border). The issue here is obviously that any further piece (after the missing one) is also very likely to generate on a chunk border… but they don’t get eaten up.

ss 2014-11-09 at 10 19 02

We found that the gap between end of the chunk and next piece (which miraculously generates) after the missing one is always 2-3 blocks.

The origin piece is 16 by 16 but doesn’t fit in the chunk precisely:

ss 2014-11-09 at 10 22 43

commented

@rutgerkok I also want to mention that if you want to see what’s wrong yourself and debug, we have all configuration files in a private GitHub repo (competitive reasons) and will add you if you mention it. I decided against adding you involuntarily because—well—I don’t want to spam you or presume your interest.

commented

We also found that all vertically aligned tunnel pieces will fail to appear in the structure.

ss 2014-11-09 at 11 41 44

The only one that appears above is not aligned with the ones below – it goes from a different direction.

ss 2014-11-09 at 11 43 12

commented

Awesome, thank you for investigating this.

commented

Thanks! I managed to reproduce this myself with a 16-blocks long piece:

2014-11-09_18 15 36

It doesn't seem to happen with shorter pieces. TC doesn't spawn the whole piece if one single block touches an unloaded chunk. I'll try to debug this today, 16 blocks should fit exactly.

commented

It's more difficult to fix than I thought. I made an image to illustrate it:

Illustration

Orange area: potentially unloaded chunks.
Gray area: chunks guaranteed to be loaded.
Green area: area where population happens.

The BO3 drawn here (the rectangle) is 16 blocks wide - not too wide, you'd think? Well, because the origin of BO3 isn't exactly at the center it can sometimes extend into unloaded chunks. This causes this BO3 not to be spawned at all.

I think I will be able to fix this - the rest of the BO3 needs to be finished later on. This work will also result in BO3s of any size being able to spawn in structures.

commented

Great, I’m glad we could provide enough info in this report. :)

Thanks for looking at it and thinking how to fix it. This part excites me too:

This work will also result in BO3s of any size being able to spawn in structures.

:D!

commented

Unfortunatily, splitting a BO3 over multiple chunks wasn't possible. Structures are allowed to have objects spawn with the origin on the highest block. Determining the highest block is not possible when the origin of the BO3 is in an unloaded chunk...

But the original issue is now fixed. TC now calculates the dimensions of each object on server start and uses those to find the best chunk to spawn the object in. Objects part of a structure will now always be spawned, as long as they aren't larger than 16x16 blocks on the x/z axis.

Download

commented

All of this has been terrific. Thank you so much!