Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

VOXEL TUTORIAL

Discussion in 'Scripting' started by Reeceg, Jun 10, 2015.

  1. Reeceg

    Reeceg

    Joined:
    May 14, 2014
    Posts:
    30
    Doe anybody know of a good voxel tutorial that is smooth not like minecraft.
     
  2. Sean-Powell

    Sean-Powell

    Joined:
    Dec 18, 2014
    Posts:
    87
    not sure what you mean
     
  3. ChrisSch

    ChrisSch

    Joined:
    Feb 15, 2013
    Posts:
    763
    He means like "7 Days to Die". And yeah I'm curious about tutorials like that too. Saw one like MC here on the forums a while back, and it had a section on how to make it smoother, but I didn't understand it at the time.

    EDIT: I think I found it in this thread. Probably more than one tutorial there.
     
  4. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    you'd probably do better with a question like this in the teaching section of the forums... scripting is more about getting help on specific (smaller scope) code issues, i.e. you've built half of a voxel system but it's not working in a way you like etc.
     
  5. Boz0r

    Boz0r

    Joined:
    Feb 27, 2014
    Posts:
    419
    Try looking into manual mesh generation, and make a prototype that can generate a simple mesh from a 3D array, or something.
     
  6. Reeceg

    Reeceg

    Joined:
    May 14, 2014
    Posts:
    30
    Your right I should have done that. Sorry.
     
  7. Reeceg

    Reeceg

    Joined:
    May 14, 2014
    Posts:
    30
    I have done something like this but I couldn't find a way to increase the amount of voxels at a certain point for digging.
     
  8. Boz0r

    Boz0r

    Joined:
    Feb 27, 2014
    Posts:
    419
    I'm not sure what you mean by this, but if you can get a prototype running where you can generate mesh from an array of booleans (ground or air), when you then dig, it should just be a matter of regenerating the mesh.
     
    Reeceg likes this.
  9. Reeceg

    Reeceg

    Joined:
    May 14, 2014
    Posts:
    30
    You know Ive been working on this for over a month and so far ive been using a float array with each float being a vert so theres a finite amount but if they where booleans then I could have an infinite amount and just turn them off/on. Just this one thing and all my issues are gone, I think I might be the most dense person in the world.
     
  10. Boz0r

    Boz0r

    Joined:
    Feb 27, 2014
    Posts:
    419
    It's always obvious in retrospect :p

    If you get it to work, you can later expand it to an Enum or something, if you want different terrain types.

    And if your terrain gets larger, and you don't want to regenerate all the mesh every time you dig, you could make sure it only regenerates the blocks right next to the dug block.
     
  11. Reeceg

    Reeceg

    Joined:
    May 14, 2014
    Posts:
    30
    Thanks for your help.:D
    Boz0r Has helped me with my problem but I feel like people looking for a tutorial on voxel terrains it wont help them all that much so if you know of a good one feel free to post it.