Snowiiii / Pumpkin

Empowering everyone to host fast and efficient Minecraft servers.
https://snowiiii.github.io/Pumpkin/
MIT License
3.31k stars 118 forks source link

"populate noise" step of chunk generation #319

Open kralverde opened 5 days ago

kralverde commented 5 days ago

This PR implements (most of) the "populate noise" stage of chunk generation

The blender (for smoothing (i think)) and the beardifier (for leaving space for world structures) are not implemented in this PR

This PR changes the default world gen to this noise generation

Checklist

kralverde commented 4 days ago

The chunk noise generation and population each take like 0.5 seconds, so 1 second per chunk. I'll now start a deep dive into finding optimizations

kralverde commented 3 days ago

Chunk gen times are now ~0.1sec which i think is good enough for now

OfficialKris commented 3 days ago

This is a very large PR. I'm just curious, what was the methodology of this implementation?

kralverde commented 3 days ago

What do you mean by methodology?

kralverde commented 3 days ago

But basically I would look at the source code, write an equivalent in rust, and then write a bunch of unit tests for correctness. It was not fun lol

kralverde commented 2 days ago

If this PR is merged as-is, the default world generation would become that of the populate noise

kralverde commented 2 days ago

Final bench is ~80msec per chunk on my machine. Can likely be improved but I think its good enough for now

kralverde commented 1 day ago

~60msec/chunk on my machine with the unsafe code

Q2297045667 commented 20 hours ago

Report BUG "populate noise" step of chunk generation

kralverde commented 20 hours ago

Report BUG

"populate noise" step of chunk generation

I don't think this is necessarily relevant to this PR, as this PR does not change any spawning code. It might illustrate an upstream bug though

kralverde commented 17 hours ago

~There's a regression somewhere in here for terrain gen, don't merge this PR yet.~

Isolated the issue to https://github.com/Snowiiii/Pumpkin/pull/319/commits/68949ec8d360144b9eb0c607315919ac19a233b4 likely line 539. I'll make a fix and add a test later today.

kralverde commented 7 hours ago

currently benching at ~55msec/chunk now, I think thats adequate for this PR