r/howdidtheycodeit • • Mar 09 '24

Games which generate objects seamlessly between chunks

Like minecraft. In my project I'm trying to split my very large world into chunks based on a noise seed, which is a basic concept and the chunks work. How do I extend this to generate objects in the same way, using Poisson, at a chunk level when the continuity doesn't extend between chunks? You will just end up with a tree or building at the edge of a chunk touching one on the adjacent chunk.

I've attempted to generate the points over the whole world and this seems to work somewhat but it doesn't feel like the right solution because it can take quite a while, then you would have to hold all of that in memory, unless potentially you split it up and saved it for every chunk in the whole world, and only keep loaded the current chunks after the fact.

What'd be the best way of going about this?

12 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/AG4W Mar 09 '24

I was assuming the poisson worked like perlin, that it's infinitely repeating.

1

u/BarberCool4110 Mar 09 '24

I don't believe so - from my knowledge of it anyway

1

u/KdotJPG Mar 13 '24

Ideally noise would not repeat/tile either, at least not at scales smaller than the world size, but this can happen when permutation-based hashes are used internally. If you mean to say that noise naturally extends to arbitrarily large areas while Poisson disc algorithms typically do not, then absolutely.