-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to define new objects in NOA engine. #194
Comments
Hi, so this voxel engine doesn't impose any particular rules on what voxels can go where - so the task of making "plausible" voxel worlds, like where trees don't grow out of water, is entirely up to the game logic above the engine. One common approach is to pick a y value for the world's water level, then have a general height-map function that defines a value for terrain height everywhere in the world, and then assign land/water/tree blocks depending on whether each voxel is above or below the terrain or water heights. That's what the stress-test code above is doing, so for example if you wanted to not have "pillars" spawn on top of water, you'd want to skip that bit (or set the pillar height to But it's a big topic and there are lots of possible ways to go - you might like to check out |
Thanks for that. How would I go about making trees? |
Making large structures is a bit thorny, because if a tree is at the edge of a chunk then parts of it will need to be generated at different times. In my own content I went through several iterations. One relatively easy approach is to just only generate trees on the "internal" parts of a chunk, not at the edges. If you don't have very many trees this winds up not being that noticeable. But the more robust thing to do is something like:
Then at runtime, for each chunk you'd get a list of nearby trees (2), and for each tree you draw it (3) into the current chunk, relative to the terrain height (1) at the tree center (which is where the trunk starts). But note that all of the logic involved needs to be deterministic - if tree locations are random then you'll have half-trees at chunk borders. Or at least, that's what I wound up doing. There may be better ways! |
Ok. I'm a beginner trying to make sense of this lol. |
My main problem is actually adding leaves on the pillars |
I have this, https://mineblox3.blueify.repl.co, and I'm using the stress test generation but I'd like to stop the water from going under the dirt, and I want to prevent trees from spawning in the water. How could I go about this?
The text was updated successfully, but these errors were encountered: