RegionScanner icon indicating copy to clipboard operation
RegionScanner copied to clipboard

world scanner crashes in `spectrum:deeper_down` due to deeper down generating below y=-64

Open walksanatora opened this issue 1 year ago • 15 comments

the spectrum deeper down generates between y=-64 and y=-320 which causes world scanner assertion to fail

 INFO  region_scanner > Starting to scan dimension: spectrum:deeper_down, at /home/walksanator/.local/share/PrismLauncher/instances/Hextest-1.0.0/.minecraft/saves/New World/dimensions/spectrum/deeper_down/region.
 INFO  region_scanner > World version detected as at least 1.18.
 WARN  region_scanner > Region (-2, -2) failed to load! Error: LoaderError("io error: Error { kind: UnexpectedEof, message: \"failed to fill whole buffer\" }").
 INFO  region_scanner > Processing region (-2, -1).
 INFO  region_scanner > Processing region (0, -2).
 INFO  region_scanner > Processing region (1, 0).
 INFO  region_scanner > Processing region (1, -2).
 INFO  region_scanner > Processing region (-2, 0).
 INFO  region_scanner > Processing region (1, -1).
 INFO  region_scanner > Processing region (-2, 1).
 INFO  region_scanner > Processing region (-1, -2).
 WARN  region_scanner > Region (1, 1) failed to load! Error: LoaderError("io error: Error { kind: UnexpectedEof, message: \"failed to fill whole buffer\" }").
 INFO  region_scanner > Processing region (0, 0).
 INFO  region_scanner > Processing region (0, -1).
 INFO  region_scanner > Processing region (-1, -1).
 INFO  region_scanner > Processing region (0, 1).
 INFO  region_scanner > Processing region (-1, 0).
 INFO  region_scanner > Processing region (-1, 1).
 INFO  region_scanner > Tried to scan 16 regions. Succeeded in scanning 14.
 INFO  region_scanner > Nonempty chunks counted: 6075, around 37.08% of the zone specified.
 INFO  region_scanner > Area on each layer: 1555200
 INFO  region_scanner > Blocks counted: 398131200
 INFO  region_scanner > Elapsed: 18.04s for 16 regions, average of 1.29s per scanned region, or 3.04s per 1024 scanned chunks.
 INFO  region_scanner > Filtered results by normalized frequency. 463 block-dim pairs out of 565 were retained.
The application panicked (crashed).
Message:  assertion failed: *freqs.keys().min().unwrap() >= min_y
Location: src/lib.rs:267

walksanatora avatar Mar 12 '24 16:03 walksanatora

removing assert works but all it does is generate a empty string

walksanatora avatar Mar 12 '24 17:03 walksanatora

I'm getting this same crash even with only trying to generate for the overworld

ArticulatedDrunk avatar Mar 12 '24 18:03 ArticulatedDrunk

 INFO  region_scanner > Starting to scan dimension: minecraft:overworld, at C:\Users\Ozymandias\AppData\Roaming\PrismLauncher\instances\Imagination_integration-V1984\minecraft\saves\a\region.
 INFO  region_scanner > World version detected as at least 1.18.
 INFO  region_scanner > Processing region (1, 0).
 INFO  region_scanner > Processing region (-1, -2).
 INFO  region_scanner > Processing region (-2, -1).
 INFO  region_scanner > Processing region (0, 1).
 INFO  region_scanner > Processing region (-2, -2).
 INFO  region_scanner > Processing region (0, 0).
 INFO  region_scanner > Processing region (1, -1).
 INFO  region_scanner > Processing region (-2, 0).
 INFO  region_scanner > Processing region (0, -1).
 INFO  region_scanner > Processing region (0, -2).
 INFO  region_scanner > Processing region (1, -2).
 INFO  region_scanner > Processing region (1, 1).
 INFO  region_scanner > Processing region (-1, -1).
 INFO  region_scanner > Processing region (-1, 1).
 INFO  region_scanner > Processing region (-2, 1).
 INFO  region_scanner > Processing region (-1, 0).
 INFO  region_scanner > Tried to scan 16 regions. Succeeded in scanning 16.
 INFO  region_scanner > Nonempty chunks counted: 16384, around 100.00% of the zone specified.
 INFO  region_scanner > Area on each layer: 4194304
 INFO  region_scanner > Blocks counted: 1677721600
 INFO  region_scanner > Elapsed: 8.51s for 16 regions, average of 0.53s per scanned region, or 0.53s per 1024 scanned chunks.
 INFO  region_scanner > Filtered results by normalized frequency. 493 block-dim pairs out of 686 were retained.
The application panicked (crashed).
Message:  assertion failed: *freqs.keys().min().unwrap() >= min_y
Location: src\lib.rs:267

ArticulatedDrunk avatar Mar 12 '24 18:03 ArticulatedDrunk

Hmm, I don't think it would be a good idea to add the export of levels below y=-64 since JER doesn't support it anyway. I didn't realise some mods changed this limit though, I'll change the assertion to a warning that levels below y=-64 will be cut.

RundownRhino avatar Mar 15 '24 10:03 RundownRhino

@ArticulatedDrunk I'm assuming this is modded too, and your overworld extends below y=-64?

RundownRhino avatar Mar 15 '24 10:03 RundownRhino

after modifying so I made a patch patch.diff.txt (not gonna pr this since it is very opnionated and is overall bad)

but after making a Y-Level override for spectrum deeper down

{
        "spectrum:deeper_down": [-320,-64]
}

the range is now from -256 -> 0 but as I mention in https://github.com/way2muchnoise/JustEnoughResources/issues/468 it is unable to load the generated json.

walksanatora avatar Mar 15 '24 15:03 walksanatora

world-gen.json which the generated json from my patched version (after filtering for block ids containing ore)

walksanatora avatar Mar 15 '24 15:03 walksanatora

Since v0.3.4 RegionScanner will now ignore the blocks below the depth limit instead of panicking. So scanning a dimension like Deeper Down that's entirely below the depth limit just produces no entries. Can't really do much else unless JER starts supporting such worlds, though. I'd still like to know what can cause the overworld to have the wrong depth, though.

RundownRhino avatar Mar 15 '24 19:03 RundownRhino

after modifying so I made a patch patch.diff.txt (not gonna pr this since it is very opnionated and is overall bad)

A lot of the levels in your world-gen.json are negative, which is likely why JER refuses to load it. If you want to get this to work, you should have your overrides modify offset - so for that dimension, y=-250 should get stored as 70. The idea of the JER format is that all the levels in the world-gen.json file are always nonnegative (and JER, when loading it, will subtract the offset from them). If you do that, JER will probably load the file successfully, and the the plot will just be shifted right by 256 blocks compared to reality.

RundownRhino avatar Mar 15 '24 20:03 RundownRhino

so instead make a y-offsets json and override the y-offset that way?

walksanatora avatar Mar 15 '24 20:03 walksanatora

lemmy try this

walksanatora avatar Mar 15 '24 20:03 walksanatora

yep that works. aside from the y-values being wrong it works I may just PR this

walksanatora avatar Mar 15 '24 20:03 walksanatora

patch.diff.txt heres the diff. makes it so y-override-json takes a json in the format of

{
    "dim": y-offset-override
}

walksanatora avatar Mar 15 '24 20:03 walksanatora

@ArticulatedDrunk I'm assuming this is modded too, and your overworld extends below y=-64?

I'm pretty sure it doesn't. We ended up making a file by using the previous release but apparently jer doesn't even support ores on 1.20.1 so it's overall kinda pointless.

ArticulatedDrunk avatar Mar 18 '24 01:03 ArticulatedDrunk

apparently jer doesn't even support ores on 1.20.1 so it's overall kinda pointless

It does - I've been using JER on 1.20.1 with world-gen.json generated by RegionScanner without issues (though I haven't had any dimensions that go beneath -64).

RundownRhino avatar Mar 18 '24 11:03 RundownRhino

Fixed a while ago when the assertion was changed to a warning, so I'm closing this.

RundownRhino avatar Jan 13 '25 09:01 RundownRhino