How can I make mineable terrain?

So, I’m making a survival game and I would like to be able to mine terrain. Example like 7DaysToDie or Valheim, something like that with using something like a pickaxe, where you can dig into the terrain and terraform.
I have tried looking around for something like this but haven’t been able to find anything.
Is there a special way you will have to make the terrain or does it not really matter.

I would really appreciate if anyone could atleast point me in a direction.

@Plott_ im just wondering what type of game are you making and are you going to release it?

@Plott_ lol I don't have discord I made chat as a question if wanna talk though also im a begginer I mean I am 11 yrs old

2 Answers

2

@Plott_ im afraid this is incredibly hard to do I tried to do this but couldn’t find anything when I first started game development but here’s a video that has a GitHub link for there project I hope this helps

How To Use Marching Cubes in a Game (Unity 2020) copy and paste this into the YouTube search bar hope this will work for you

@EvilBob99 yes I have discovered that it will be hard, anything from Voxel map, marching cubes, meshes.. unfortunately is that I have already decided on this and will continue to try and find something even if it takes me a year, but I did set a limit. If I dont find anything I can work towards before the end of the year I will start to look for alternatives. Can I ask how you got around doing this or what did you do to solve it or other alternative? I will check out the video and come back

lol that's the thing I COULDN'T DO IT I spent nearly an entire year going through everything I've only stumbled across this video recently and by now I've moved onto other stuff but I do plan on coming back to this after I've finished my game honk bonk

lol that's a cool idea sadly Im not sure if that would work unless your using some kind of teardown style game the better option would be to reduce the value of which ever vertices a recast from your crosshair hit. the video also has a GitHub link that will give you the code you want im sorry I couldn't help you much more than this

oh yeah I just remembered there's a YouTube who disappeared ages ago but he has a video that sheds some light on this their called samhogan and they made Minecraft but without blocks that will help a lot for you go check out the video

I am also working on a game like 7DaysToDie. I am using Voxel Play from the Asset Store and heavily modifying it to suit my needs. This includes:

  • writing a custom file serialization function to work with larger map sizes
  • writing the functions for RequestVoxel, RequestChunk, BreakVoxel, and PlaceVoxel on both client and server (server authoritative)
  • wrapper that connects the VoxelDefinition to my existing inventory system
  • inventory hotbar system that allows for hotkeys
  • tieing all the small features like the “block damage” effect into my own code
  • writing a custom load/unload chunk system on client and sever that automatically requests all chunks around the player, and unloads them when unneeded

I think this would be impossible unless you are extremely organized and show good foresight in coding. Once you get a system this big, it can start breaking faster than you create it. I wrote all of my networking code myself, which took several years to complete, so I already knew exactly what to do after I bought Voxel Play.

The voxel system must be rendered directly on the GPU with no GameObjects. You will have to deal with shaders, camera frustrums, runtime collider mesh and navmesh generation, and many other obstacles. The code has to be extremely well optimized, which takes in-depth knowledge of advanced C# features.

Needless to say, it’s a huge system, and it might be easier not to reinvent the wheel and just get a package like Voxeland or Voxel Play. I’d recommend building up a knowledge of Unity and networking by fleshing out the rest of your game first if you haven’t already. Good luck!

yeah figured I would need to know a lot more of C# and everything. Thanks a lot for this comment,