Hello, i would like to make a terrain system like space engineers or astroneer(without the low poly count).
But i honestly have no clue how to make such a system, I would like to see in my system; mining terrain like in space engineers so im guessing it has to do something with marching cubes. but the biggest problem might be generating the resources in the terrain/on the terrain so i could have them as materials to craft just like minecraft and have caves. I have tested cubiquity and thats pretty much what i expect from the mining but it didnt procedurally generate and it was without materials. I’m not a beginner coder im somewhere inbetween intermediate in my opinion.
I am very grateful for any guidance/assistance thanks.
EDIT: and is there a way possible to make it into a planet aswell? i think unity doesnt support that though just a question.
You can generate a terrain with either perlin noise or some other algorithm
And hey, it just so happens, that I wrote a tutorial few days ago, that creates a Diamond-Square Algorithm, that works well with terrain generation (Shameless self-advertising)
Here’s the link Diamond-Square Algorithm – Gorbit's Projects
The most common way of dealing with ores and caves (minecraft does it as well) is having a 3d perlin noise (Unity doesn’t support that, so you have to download a library yourself. I would suggest a C# implementation of LibNoise, that works great and it has so many different noisetypes, that you can experiment with as well) After this you check the values of this noise and if it’s let’s say below 0.2 you generate a cave or if it’s between 0.5 and 0.6 that’s copper, and so on.
A game like space engineers is called a voxel game, where every block is a single value in a 3d coordinate system. You can visualize these values in multiple ways:
You can have cubes like in minecraft
Or you can have marching cubes. And again in a few days a tutorial about marching cubes algorithm will be on my site as well, so stay tuned for that (Shameless self advertising again, I will stop now, sorry)
And your last question can be easily answered:
It’s hard, but you can obviously. You just need to map the values of the noises onto a sphere, I’m sure there are a lot of tutorials online
So lets say that i’m choosing to make a spherical voxel world. Assuming that space engineers doesnt use trickery to make it look like a planet. I would be able to create it with libnoise?
But how would I do the terrain mining part? And generate the caves on terrain that are part of a mountain. I don’t know I’m so curious and don’t know nothing about this stuff.
Edit: Also does libnoise support smooth voxels? I wouldn’t just want to make a spherical minecraft.