Ninjabrain1 / Ninjabrain-Bot

Accurate stronghold calculator for Minecraft speedrunning.
312 stars 43 forks source link

Question about the paper - what is 'snapping'? #61

Closed seungwonpark closed 1 year ago

seungwonpark commented 1 year ago

Hi, thanks for bringing the incredible tool to the MCSR community.

I read your paper but could not understand what 'snapping' refers to. Also, it was said that and biome snapping favors offsets towards the edges but I could not find what 'biome snapping' means. Could you give me some pointers to any resources to learn about them?

Ninjabrain1 commented 1 year ago

Hi! Biome snapping (and stronghold generation in general) is pretty niche so i dont know of any good resource off the top of my head, but I can give an explanation. The game first chooses a random point in the stronghold ring to spawn the stronghold. Then the "snapping/biome snapping" stage occurs, where the chosen point is moved randomly up to 7 chunks away in both dimensions, to a non-ocean chunk. Therefore this is referred to as "biome snapping," the game does this step to try and prevent the stronghold from spawning in the ocean, and will try to snap the stronghold to the land. Note, however, that the snapping step occurs even if the stronghold spawns on land. If all chunks within 7 chunks of the initial point are land chunks, then the stronghold is basically moved randomly to one of the chunks withing the 7 chunk range (with each chunk having approximately the same probability).

seungwonpark commented 1 year ago

Thanks for the detailed explanation! That tells a lot about the paper&code (though I still have a lot to comprehend).

Just one more question -- how did you learn about such a not-so-simple stronghold generation mechanism? Did you read through the MC Java code implementation?

Ninjabrain1 commented 1 year ago

Most of the information was taken from the java code, yes.

seungwonpark commented 1 year ago

I see, thanks for your valuable answers!