mojira.dev
MC-207310

large_dripstone's wind is heavily biased towards the northwest

The bug

I was experimenting with the large_dripstone feature's wind_speed value and noticed that stalactites with wind would always point towards the southeast, and stalagmites with wind would always point towards the northwest. This is likely unintended behavior.

The attached datapack has a dimension which illustrates this problem with a large_dripstone feature whose wind_speed is always 1.

How to reproduce

  1. Install the datapack dripstone

[media]
  1. Run /execute in caves run tp 0 64 0

  2. Observe the axis aligned dripstones

Attachments

Comments 11

There's no caves dimension when I use the datapack

I don't believe you enabled it properly. The caves dimension is there.

Code analysis:

In LargeDripstoneFeature.WindOffsetter, the assignment for the windSpeed value goes like this:

this.windSpeed = new Vec3(wind.sample(random), 0.0, wind.sample(random));

This makes the x and z values of the wind speed always positive, causing the northwest bias. If that line were changed to:

float speedX = wind.sample(random);
float speedZ = wind.sample(random);
this.windSpeed = new Vec3(random.nextBoolean() ? -speedX : speedX, 0.0, random.nextBoolean() ? -speedZ : speedZ);

(Code provided under CC0) It would give all directions an equal chance of generating.

Note that the proposed fix still has a slight bias towards the northwest (with both stalagmites and stalactites). This is due to rounding down when the windSpeed is actually added to the position in the "offset" method. To remove all bias, in addition to the fix above, the windSpeed needs to be rounded with e.g. Math.round() when added to the position in "offset".

1 more comments

Despite the fact that it's intended it would still be nice to have some option to control the bias or remove it. For example I might want to make caves with regions of dripstones pointing in different directions using the count_noise_biased decorator.

Perhaps it would be possible to use a noise to gradually change the direction over a distance? That way stalagmites in different parts of the world would point in a different way, although that may not be immediately visible to the player.

Could you make the "wind" different for each cave?

I agree with the above comments. Varying the direction would be a great improvement in my opinion. Two ways I see that this could be achieved, are either (a) per cave if each cave can be instanced as such (not sure that the big regions are), or (b) by sampling super low frequency noise at each, to decide the direction.

The way I would personally implement the noise-based approach, would be to use a simplex based domain warping noise function which outputs a vector2 of bounded magnitude (this is available in some MIT licensed libraries), and use a low frequency instance of that to decide the direction of each stalactite. You could also use two independent ordinary noise instances for nearly as clean of an effect, or other techniques involving noise derivatives. In all 3 of these, there will be mostly places where the directions change slowly and are pointed at angles, and some where they're pointed more straight down. Since the caves already have areas with stalactites and areas without, you could just make it so that the areas that they would point straight down, are just the areas without them.

If there is one thing I would really like to see Minecraft work more to avoid and improve, both in existing features and new features, it's directional bias. This particular instance of it looks straightforward to address.

I hope to not say too much and turn this comment thread into a discussion forum, but I'm just going to share my opinion here.
I like the current design of Dripstone wind being the same for every cave. It might not make sense right now since we only see the Dripstone cave biome as a single biome world so all the dripstone is the same direction, but in a real Minecraft world, where the Dripstone caves are far apart from each other, unless you walk in a straight line from one Dripstone cave to the next, you are probably not going to notice that the large dripstone wind is the same or different from the last cave (since making all the dripstone wind different in one cave wouldn't make sense as Henrik said). Having Dripstone wind be the same for every Dripstone cave also has another benefit because it gives players a way to tell directions without needing to open the debug menu, so you know which way is north west when encountering one of these caves without breaking immersion for some players.

Starmute

migrated

Community Consensus

Normal

World generation

world-generation

20w49a

Retrieved