CubicChunks

CubicChunks

840k Downloads

Fluid collision breaks at extreme heights and depths

muzikbike opened this issue · 10 comments

commented

Version Information

Minecraft version: 1.12.2
Forge version: 14.23.5.2859
Other mods (if applicable): CubicWorldGen, MalisisCore

Steps to reproduce:

  1. Go very far down in the world - the farther the better. The effects can be first seriously seen at 33,554,432 blocks down, but I recommend going down a billion for the full effect.
  2. Enter water or lava
  3. Observe closely

Expected Behavior:
Being in water or lava would physically and visually behave the same way it does at normal heights.

Actual Behavior:
Said effects appear to become localized around the numbers that a 32-bit float accepts. Some of the effects in question:

  • Generation of bubble / splash particles
  • Physical slowdown effect of water on entities
  • Fog effect when under lava
    2023-03-19_19 09 23
    2023-03-19_19 06 40

The following CubicWorldGen preset generates a world at negative 1 billion on the y-axis, with oceans present which can be used for testing:
{
"waterLevel": -1000000000,
"caves": false,
"strongholds": false,
"alternateStrongholdsPositions": false,
"villages": false,
"mineshafts": false,
"temples": false,
"oceanMonuments": false,
"woodlandMansions": false,
"ravines": false,
"dungeons": false,
"dungeonCount": 7,
"lakes": [
{
"block": "minecraft:lava",
"biomes": [],
"biomeSelect": "EXCLUDE",
"surfaceProbability": [
{
"y": -1.0,
"v": 0.06108487769961357
},
{
"y": 0.0,
"v": 0.06108487769961357
},
{
"y": 31.0,
"v": 0.032675087451934814
},
{
"y": 63.0,
"v": 0.007101680152118206
},
{
"y": 95.0,
"v": 0.004936832934617996
},
{
"y": 127.0,
"v": 0.003164479276165366
},
{
"y": 128.0,
"v": 0.003164479276165366
}
],
"mainProbability": [
{
"y": 0.0,
"v": 0.015209125354886055
},
{
"y": 7.0,
"v": 0.015209125354886055
},
{
"y": 8.0,
"v": 0.0151477986946702
},
{
"y": 62.0,
"v": 0.011836133897304535
},
{
"y": 63.0,
"v": 0.0011774806771427393
},
{
"y": 127.0,
"v": 7.849871180951595E-4
},
{
"y": 128.0,
"v": 7.849871180951595E-4
}
]
},
{
"block": "minecraft:water",
"biomes": [
"minecraft:desert",
"minecraft:desert_hills"
],
"biomeSelect": "EXCLUDE",
"surfaceProbability": [
{
"y": -1.0,
"v": 0.25
},
{
"y": 0.0,
"v": 0.25
},
{
"y": 128.0,
"v": 0.125
},
{
"y": 129.0,
"v": 0.125
}
],
"mainProbability": [
{
"y": 0.0,
"v": 0.015625
}
]
}
],
"lavaOceans": false,
"biome": -1,
"biomeSize": 4,
"riverSize": 4,
"standardOres": [],
"periodicGaussianOres": [],
"expectedBaseHeight": -1.0E9,
"expectedHeightVariation": 64.0,
"actualHeight": -9.99999808E8,
"heightVariationFactor": 64.0,
"specialHeightVariationFactorBelowAverageY": 0.25,
"heightVariationOffset": 0.0,
"heightFactor": 64.0,
"heightOffset": -1.0E9,
"depthNoiseFactor": 1.0240000486373901,
"depthNoiseOffset": 0.0,
"depthNoiseFrequencyX": 0.00152587890625,
"depthNoiseFrequencyZ": 0.00152587890625,
"depthNoiseOctaves": 16,
"selectorNoiseFactor": 12.75,
"selectorNoiseOffset": 0.5,
"selectorNoiseFrequencyX": 0.016709277406334877,
"selectorNoiseFrequencyY": 0.008354638703167439,
"selectorNoiseFrequencyZ": 0.016709277406334877,
"selectorNoiseOctaves": 8,
"lowNoiseFactor": 1.0,
"lowNoiseOffset": 0.0,
"lowNoiseFrequencyX": 0.005221649073064327,
"lowNoiseFrequencyY": 0.0026108245365321636,
"lowNoiseFrequencyZ": 0.005221649073064327,
"lowNoiseOctaves": 16,
"highNoiseFactor": 1.0,
"highNoiseOffset": 0.0,
"highNoiseFrequencyX": 0.005221649073064327,
"highNoiseFrequencyY": 0.0026108245365321636,
"highNoiseFrequencyZ": 0.005221649073064327,
"highNoiseOctaves": 16,
"cubeAreas": [],
"replacerConfig": {
"defaults": {
"cubicgen:height_scale": 64.0,
"cubicgen:surface_depth_limit": 9.0,
"cubicgen:water_level": -1.0E9,
"cubicgen:biome_fill_depth_factor": 2.3333333333333335,
"cubicgen:terrain_fill_block": {
"Name": "minecraft:stone",
"Properties": {
"variant": "stone"
}
},
"cubicgen:mesa_depth": 16.0,
"cubicgen:biome_fill_depth_offset": 3.0,
"cubicgen:biome_fill_noise_octaves": 4.0,
"cubicgen:ocean_block": {
"Properties": {
"level": 0.0
},
"Name": "minecraft:water"
},
"cubicgen:biome_fill_noise_freq": 0.0078125,
"cubicgen:horizontal_gradient_depth_decrease_weight": 1.0,
"cubicgen:height_offset": 64.0
},
"overrides": { }
},
"version": 6
}

commented

Time for int64?

commented

This isn't an int issue at all, it's just floats being floats. I don't see a need for any action, honestly. Vanilla Minecraft does similar things near XZ limits.

commented

Just because vanilla does something wrong doesn't mean Cubic should, unless not doing so breaks mods.

Time for doubles?

commented

IMO CC should only be expected to support ±30M y, given that vanilla only supports ±30M x and z.

commented

That's... quite an oversimplification?

I'm sure you could write a mod to change usage of float to double where possible, but it'd be awful for compatibility and largely not accomplish anything meaningful - and of course, it'd be entirely out of scope for CC.

commented

I get that. However, let's not forget that float kinda sucks and double is actually good.

commented

Doubles are double the size, that's it. It won't even fix anything, it would just mean the issues will become apparent later - but they would still be IEEE 754 floating point numbers, with all imprecision that entails. And if we pick a cutoff anyway, why not pick one vanilla already uses and one that doesn't cause any incompatibility issues?

commented

it would just mean the issues will become apparent later

That's literally why doubles were invented.

commented

People can still travel farther. I say add a world border (blasphemy!), but at the same time this is CUBIC Chunks, not Infinitely High Chunks. Someone might think this is a programming error (like OP)

commented

And if we pick a cutoff anyway, why not pick one vanilla already uses and one that doesn't cause any incompatibility issues?