TerraBlender (Forge)

TerraBlender (Forge)

62M Downloads

VanillaParameterOverlayBuilder seems to be shifting the points

maityyy opened this issue · 2 comments

commented

What's the issue you encountered?

My goal is to replace Biomes.RIVER with CustomBiomes.GRAVEL_RIVER (in some places). I get Biomes.RIVER placement points and decide to place CustomBiomes.GRAVEL_RIVER on them using VanillaParameterOverlayBuilder, but for some reason it shifts the points, causing CustomBiomes.GRAVEL_RIVER to be placed not only where Biomes.RIVER should be, but also in other places, which seems to be incorrect behavior.

Vanilla:
2024-05-19_19 48 02

Custom:
2024-05-19_19 44 53

As you can see, CustomBiomes.GRAVEL_RIVER is placed where Biomes.TAIGA is, although I'm only using Biomes.RIVER points

How can the issue be reproduced?

The code:

var riverPoints = RegionUtils.getVanillaParameterPoints(Biomes.RIVER);
var overlayBuilder = new VanillaParameterOverlayBuilder();
riverPoints.forEach(point -> overlayBuilder.add(point, CustomBiomes.GRAVEL_RIVER));
overlayBuilder.build().forEach(mapper);

Seed:
5030393227310356141

Coordinates:
/tp -250 110 250

Logs

No response

Mod Version

3.5.0.4 for Fabric 1.20.6

Additional information

No response

commented

I decided to check one of the parameters (weirdness) that affects the width of the rivers - VanillaParameterOverlayBuilder does shift the points. Vanilla: -500 to 500, custom: 500 to 10000 and -10000 to -500. I know there is indeed an offset in the code, but as far as I understand it, it's still a bug. Well, this class has pretty bad docs, I'd say no docs at all, so I could be wrong... correct me if I am.

The code:

var riverPoints = RegionUtils.getVanillaParameterPoints(Biomes.RIVER);
var overlayBuilder = new VanillaParameterOverlayBuilder();
riverPoints.forEach(point -> {
    overlayBuilder.add(point, CustomBiomes.GRAVEL_RIVER);
    System.out.println("before build = " + point.weirdness());
});
overlayBuilder.build().forEach(entry -> {
    mapper.accept(entry);
    System.out.println("after build = " + entry.getFirst().weirdness());
});

Result:

before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
commented

You’ve printed parameter ranges but not what they actually correspond to. If those parameters are for DEFERRED_PLACEHOLDER biomes then that is correct behaviour, given they are intended to fill to gaps in parameter ranges to whatever you have provided