Zylann / godot_voxel

Voxel module for Godot Engine
MIT License
2.71k stars 251 forks source link

Cave / Objects generation #230

Open havi05 opened 3 years ago

havi05 commented 3 years ago

Hi I think it is possible to generate caves with the VoxelGeneratorNoise. Is that right? Is it possible to generate ovjects like trees or houses random in the World?

havi05 commented 3 years ago

I found this : #19 So a cave generation is not yet programmed?

Zylann commented 3 years ago

I think it is possible to generate caves with the VoxelGeneratorNoise. Is that right?

This produces a kind of terrain that sort of have caves, yes. They will mostly be blobby though, not worm-like.

Is it possible to generate ovjects like trees or houses random in the World?

This depends on a freaking lot of factors. First of all, if you want to put stuff on top of terrain, you can do it whenever you like by instancing as scene when parts of the terrain get loaded, it does not have to be done by this module. If you want to do a Minecraft-like blocky world where such structures are directly made of voxels, it's something to deal with in your voxel generator. In this demo there is a custom generator which is able to make trees: https://github.com/Zylann/voxelgame/tree/master/project/blocky_game

Natural spawning of 3D models such as rocks, trees and grass is a topic I'm working on in https://github.com/Zylann/godot_voxel/issues/223. This is however not suitable for man-made structured generation such as houses, villages or cities.

I found this : #19 So a cave generation is not yet programmed?

19 has nothing to do with cave generation. It is about culling blocks that are hidden or buried away from the viewer, to speed up rendering.

havi05 commented 3 years ago

Will you add a worm like cave generation? Maybe in the style of Minecraft? (maybe 1.17?)

Is this with Godot possible?

Zylann commented 3 years ago

This is possible to make, but it's game-specific so you have to do that yourself, I have no plan of adding this at the moment. I might research that in a demo project.

havi05 commented 3 years ago

Thanks! A demo / tutorial would be helpful.

Thank you for programming something so great.

Zylann commented 3 years ago

The doc now has a section with hints about how to make caves: https://voxel-tools.readthedocs.io/en/latest/procedural_generation/#caves-with-graph-generator It's not well detailed at the moment and examples use VoxelGeneratorGraph, but it should give the idea

havi05 commented 3 years ago

Thank you very much!

Shadowblitz16 commented 1 year ago

@Zylann the caves sections seems to be missing in that link.

Zylann commented 1 year ago

The article moved here: https://voxel-tools.readthedocs.io/en/latest/procedural_generation/#caves-with-graph-generator