r/howdidtheycodeit • u/BarberCool4110 • 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?
View all comments
Show parent comment
1
u/BarberCool4110 Mar 09 '24
So if I take an area that spans over the middle chunk and portions of the surrounding chunks, and then if when generating those chunks poisson points, they will detect that there are trees already there and won't be able to place them. That's how I understand what you say - you don't necessarily need to generate over and discard correct?