Search Unity

TerraVol: volumetric/voxel terrain system. Dig holes caves in your terrains!

Discussion in 'Assets and Asset Store' started by Amfu, Apr 9, 2013.

  1. wolfen231

    wolfen231

    Joined:
    Apr 22, 2014
    Posts:
    402
    It says on the store it supports heightmaps on finite terrains. Can you give any more detailed information on that? Can I import an exported heightmap from Unity terrain for example? Any size limits on the heightmap? Etc.

    Thanks and nice work. It looks awesome!
     
  2. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    How do i generate prefabs? i have bought models and i cant use them as they are prefabs and do not have a mesh render er on the main peice
     
  3. niraj

    niraj

    Joined:
    Feb 14, 2013
    Posts:
    56
    Hello i have got this asset from my client for developing infinite run game project like "Into the Dead". Your demo videos looks awesome. But after importing your package i am getting following errors:

    Assets/TerraVolPack/TerraVol/Scripts/Generator/TerraMapGenerator.cs(448,34): error CS1501: No overload for method `Generate' takes `1' arguments

    and

    Assets/TerraVolPack/TerraVol/Scripts/Thread/GeneratorThread.cs(33,25): error CS0029: Cannot implicitly convert type `TerrainGenerator' to `TerraVol.TerrainGenerator'

    Please help me to solve this problem.

    Thanks and Regards
    Niraj Vishwakarma
     
  4. nexusproductions998

    nexusproductions998

    Joined:
    Dec 25, 2013
    Posts:
    1
    I think the reason for this is you have another script called TerrainGenerator. If you remove that old script, it should work.
     
    niraj likes this.
  5. niraj

    niraj

    Joined:
    Feb 14, 2013
    Posts:
    56
    There is only one TerrainGenerator file. Would you like to share the new file you talking about. If you can share only the new TerrainGenerator.cs file then it would be of great help. My mail id nirajv21@gmail.com

    Thanks and Regards
    Niraj Vishwakarma
     
  6. hobstob

    hobstob

    Joined:
    Dec 18, 2013
    Posts:
    20
    There is no way that you can use a mesh that a user imports in and turn that in a usable TerraVol? This would be extremely powerful feature.
     
  7. xiongmaoboshi

    xiongmaoboshi

    Joined:
    Mar 15, 2012
    Posts:
    44
    Hi,

    I'm considering buying this, but I would really like to know first if there is a means to smooth the terrain where you edited it?
     
  8. VicToMeyeZR

    VicToMeyeZR

    Joined:
    Jun 3, 2012
    Posts:
    427
    Hasn't been any updates in a long time? How is it going?
     
  9. Baccus

    Baccus

    Joined:
    Aug 12, 2014
    Posts:
    2
    Hi Amfu,

    First of all, I'm loving the TerraVol tool. It's a great asset, and a steal for the price. I'm doing a fairly good job of following your code, which is very clean and well documented, but I'm having a problem implementing a customization.
    I want to set up a biome system within TerraVol that not only changes the block style, but changes the terrain variation as well. I'd like to code a biome system that can vary the roughness, granularity, max heights and coes of hills and cliffs for different regions of the generated infinite terrain based on x and z location parameters. I have been trying to do this by adding if statements to the GenerateProcedurally method in TerrainGenerator, or by trying the same approach in UpdateAround or GenerateColumn in TerrainMapGenerator, but I haven't been successful yet.

    In your estimation, is this possible through customization of the TerraVol code, without requiring a vast re-writing? If so, how would you recommend I go about it? Thanks for your help!
     
  10. mikezenox

    mikezenox

    Joined:
    Oct 18, 2012
    Posts:
    55
    Are there any plans to add an option to edit vegetation or other details in the In-Editor Builder? I'm using terravol along with a height map to create my map and need more control over my tree placement than the current method.
     
    DJ_Design likes this.
  11. Alahmnat

    Alahmnat

    Joined:
    Feb 1, 2008
    Posts:
    65
    Does anyone using this asset have tips on creating smoother terrains using the sculpting tools? Every time I try, I get stuff that looks ragged and rough, unlike the nice smooth surfaces that auto-generate using the random noise inputs.
     
  12. nekidfrog

    nekidfrog

    Joined:
    Aug 27, 2014
    Posts:
    2
    Hi Amfu, was curious about your asset. Does yours have a way to generate spherical planets? I'm trying to build a voxel planet of a pretty decent size and all of the other assets besides the ruaumoko and cubiquity can do spherical voxels system. Cubiquity tho is very limited on spherical size and Ruaumoko while great... developer is MIA from that asset.

    If not then I'm going to have to continue to build my own. Right now I have the ability to generate a spherical planet however I'm also limited on size. Apparently generating a 32*32*32 chunk size 14*14*14 times causes unity to start getting heap allocation errors. My perlin3d noise is really harsh on the system.
     
  13. jrhtcg

    jrhtcg

    Joined:
    Jul 13, 2013
    Posts:
    34
    I bought this asset a couple of months ago. I decided to check to see if there were any new updates. I am not seeing information posted about any future plans or update time lines. The questions on this forum also seem to be going unanswered as of late.

    Can we get a quick update as to the status of this project? Are there new features on the horizon?
     
  14. EkkiVandenhayes

    EkkiVandenhayes

    Joined:
    Sep 6, 2014
    Posts:
    2
    I have buy this asset few days ago. As i resume. No smoothe terrain, no saving of own build sets, not possible to build from the scratch. this isnt working. please reply to help or send my money back.
     
  15. _Eli_

    _Eli_

    Joined:
    Aug 28, 2014
    Posts:
    10
    Hi Amfu (and everyone else),

    I have bought your asset and it is just wonderful.
    I have been able to make it a multiplayer game, by generating the same map for both players with a seed implementation. The changes are send through RPC's. So both players can edit the map in realtime.

    I'm struggling with one problem though: I'd like to generate a town in each biome, now I've seen the biome tutorial but it only shows how to change the texture.
    How do I (randomly) build a single town into a biome, how can I manipulate the engine to make sure the ground is flat in one particular place so the town can be build?

    I was thinking it must be something in the 'OnChunkBuildAfter' or 'OnChunkBuildBefore' method.

    The way I see how this can be accomplished is to either make sure the ground is flat, or to find a flat piece of ground.
    But if I have to make the ground flat, wouldn't that mess up the rest of the map? And to find a piece of ground that is flat is not always in option, as it is random.

    Any Idea's on how to approach this? because this will be the most important aspect. If you can build towns, than you can build anything, think of player spawns, monsters, quests, etc. Just need to know where to begin.

    Thank you Amfu and the Unity Community.
     
  16. VicToMeyeZR

    VicToMeyeZR

    Joined:
    Jun 3, 2012
    Posts:
    427
    Sadly, I think he is GONE. no reply or updates in a very long time
     
  17. _Eli_

    _Eli_

    Joined:
    Aug 28, 2014
    Posts:
    10
    Are you sure? It does look like it, maybe you can bring enlightenment to the subject? Or maybe you know another engine that does support this?
     
  18. VicToMeyeZR

    VicToMeyeZR

    Joined:
    Jun 3, 2012
    Posts:
    427
    I can't help you, as I haven't really used it very much. I was really waiting to see who (with all the voxel assets) came up with water first.
     
  19. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    This doesn't necessarily need to be built into the voxel engine - there is a plugin here which can add water to existing voxel systems.
     
  20. _Eli_

    _Eli_

    Joined:
    Aug 28, 2014
    Posts:
    10
    So because no one answered I decided to put my code here.
    This code is for finding flat grounds in your randomly generated world in order to build something like houses/town/bonfires/spawnplaces/etc...

    In TerraVolEnchance script

    1. Add this global variable (List --> need 'System.Collections.Generic'-namespace)

    Code (CSharp):
    1.  List<Vector3> myFlatBlocks = new List<Vector3> ();
    2. After the chunk is build execute our methods

    Code (CSharp):
    1.     public void OnChunkBuildAfter (Chunk chunk)
    2.     {  
    3.         //here you can locate in which biome it is (chunk.transform.position > blablabla)
    4.         //if so build a town/bonfire/monument/etc.. in an empty space
    5.         buildTown (chunk);
    6.     }
    3. Our function for searching the flat ground in order to build something. (the flat grounds are just cube spawning for example purposes)


    Code (CSharp):
    1. public void buildTown(Chunk myChunk)
    2.     {
    3.         //Get Chunk Position
    4.         Vector3i cpos = myChunk.ChunkData.Position;
    5.      
    6.         // Compute position offset from Perlin noise
    7.         float offset = -4f * Mathf.PerlinNoise (cpos.x, cpos.z);
    8.      
    9.         // Loop over X & Z to find flat spaces
    10.         for (float x = 0; x < Chunk.SIZE_X_TOTAL; x ++) {
    11.             for (float z = 0; z < Chunk.SIZE_Z_TOTAL; z ++) {
    12.              
    13.                 // Get current world position
    14.                 Vector3 wpos = Chunk.ToWorldPosition (cpos, new Vector3 (x, 0, z));
    15.              
    16.                 // Compute Perlin noise at this position
    17.                 float perlin = Mathf.PerlinNoise (wpos.x, wpos.z);
    18.              
    19.                 //prepare raycast
    20.                 Ray ray = new Ray (wpos + new Vector3 (offset * (perlin - 0.5f), Chunk.SIZE_Y_TOTAL, perlin * (offset - 2f)), Vector3.down);
    21.                 RaycastHit hit = new RaycastHit ();
    22.                 RaycastHit hit2 = new RaycastHit ();
    23.                  
    24.                 // Perform raycast to check if we the ground is flat at this position
    25.                 if (Physics.Raycast (ray.origin, ray.direction, out hit, Chunk.SIZE_Y_TOTAL) && hit.transform.GetComponent<Chunk>() != null)
    26.                 {
    27.                     //Draw a raycast (testing purposes)
    28.                     Debug.DrawLine(ray.origin, hit.point, Color.red, 60,false);
    29.  
    30.                     //No flatgrounds? add this one the list
    31.                     if(myFlatBlocks.Count == 0)
    32.                     {
    33.                         myFlatBlocks.Add(hit.point);
    34.                     }
    35.  
    36.                     //Is the y-position approximatly the same as the previous block? (mathf.round/floor/ceil... take your pick)
    37.                     if(Mathf.Round(myFlatBlocks[myFlatBlocks.Count -1].y) == Mathf.Round(hit.point.y))
    38.                     {
    39.                         //add this block to the list...
    40.                         myFlatBlocks.Add(hit.point);
    41.                     }
    42.                     else
    43.                     {
    44.                         //So our Y-value isn't the same anymore (because of a cliff/mountain/etc...)
    45.                         //then we look if we have enough flatground..
    46.  
    47.  
    48.                         //HERE YOU PUT YOUR PARAMETERS
    49.                         //So for example: If we need atleast 64 unit (8x8) we can build / spawn something there
    50.                         //You can also make it random by literally making it random, so not every flat space will spawn an object
    51.                         if(myFlatBlocks.Count >= 64)
    52.                         {
    53.                             foreach(Vector3 pos in myFlatBlocks)
    54.                             {
    55.                                 if(pos.x != 0f && pos.z != 0f && pos.y != 0f)
    56.                                 {
    57.                                     GameObject cuby = GameObject.CreatePrimitive(PrimitiveType.Cube);
    58.                                     //Set gameobject posistion
    59.                                     cuby.transform.position = pos;
    60.                                     //Make it child of the chunk so that if the chunk dissapears, the gameobject also dissapears!
    61.                                     cuby.transform.parent = myChunk.transform;
    62.                                 }
    63.                              
    64.                             }
    65.                         }
    66.                         //Clear the list and add this block to the list
    67.                         myFlatBlocks.Clear();
    68.                         myFlatBlocks.Add(hit.point);
    69.  
    70.                     }
    71.  
    72.                 }
    73.             }
    74.         }
    75.     }
     
  21. _Eli_

    _Eli_

    Joined:
    Aug 28, 2014
    Posts:
    10
    @DavidWilliams LiquidVoxels is for Cubiquity? I guess no implementation for TerraVol, or atleast not in a cubic format?
     
  22. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    @_Eli_ - It's supposed to be independent of the underlying voxel engine. Currently there are implementations for Cubiquity and for Voxwell, as well as for user's personal engines. I believe adding a new implementation is supposed to be straightforward.

    However, so far they are indeed only cubic engines, though the author has expressed interest in extending the system to smooth terrain (I can understand this is complex). But really my point is that systems such as water can be built on top of voxel engines rather than needing to be part of them.
     
  23. _Eli_

    _Eli_

    Joined:
    Aug 28, 2014
    Posts:
    10
    @DavidWilliams Ok, good to know. Do you perhaps know of any plugins that is smooth water to implement in my current Voxel Engine (TerraVol). I would like to take a look at it.
     
  24. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    I'm afraid I don't know of any real voxel water plugins for smooth terrain, but depending on your needs perhaps you could try an general fluid simulation plugin? Something like Fluvio maybe? I guess it should work if you have a collision mesh, but won't do everything that voxel water does.
     
  25. VicToMeyeZR

    VicToMeyeZR

    Joined:
    Jun 3, 2012
    Posts:
    427
    That's kind of my point ^^ Every makes a voxel engine, and says how coll it is, but then makes no water for it, still claiming that it is easy to make water, but "just haven't had the time"... Still no water. GUess its not so easy, and there is a bunch of liars. SO I wait. When someone actually does it, that's who I will support
     
  26. VicToMeyeZR

    VicToMeyeZR

    Joined:
    Jun 3, 2012
    Posts:
    427
    either way. It appears this product is dead. Amfu has never gone this long without an update.
     
  27. Amfu

    Amfu

    Joined:
    Apr 9, 2013
    Posts:
    180
    No, TerraVol is not dead. However, support cannot be done as quick as before due to personal issues.
    I'm sure you can understand that. Also, TerraVol is quite mature and stable now, and all the source code is included so everyone can improve it for their needs.
    I still give support and answer questions, it's just that I can't always answer quickly (and just so you know, I receive a lot of questions by email).

    About water, you have to know this is very complicated and it won't be added to TerraVol, at least for now.

    The big majority of TerraVol users are happy with TerraVol which makes me happy too :) I hope this will still be the case in the future.
     
    Deleted User likes this.
  28. ArloR

    ArloR

    Joined:
    Feb 22, 2014
    Posts:
    10
    I do not have this asset yet, but am very interested in it. I saw a few posts regarding using it with liquids. I was looking at a great looking asset called surface waves https://www.assetstore.unity3d.com/en/#!/content/19139
    Has the author or anyone here tried to incorporate these two assets in a project if so can you share thoughts or a web player demo. these both look like amazing assets, hope to see both of them grow and hopefully work together. I am having much fun playing around with Voxels in "Landmark" (everquest) which relies on an editor from a company called Voxelfarm and hope to find the ability to play around with voxels in Unity for an affordable price. TerraVol looks like a great tool, perhaps the best for playing with voxels in Unity at the moment. Just hope it evolves and matures.
     
  29. Amfu

    Amfu

    Joined:
    Apr 9, 2013
    Posts:
    180
    Unfortunately I haven't tried Surface Waves (looks like a great asset btw) but I don't see any reason why it wouldn't work with TerraVol. Did someone else try this asset?
     
  30. ArloR

    ArloR

    Joined:
    Feb 22, 2014
    Posts:
    10
    Amfu thanks for the reply. As far as I know no one has combined these two assets. The author was quick to reply to a message I sent him. Perhaps the two of you might exchange info and try out some tests? If it works my bet is you would both have a great web player demo.
     
  31. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    211
    Hi Amfu,
    'Save Map' is not working on the 2.5 Scene in the current release.
    Cheers
     
  32. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    211
  33. Amfu

    Amfu

    Joined:
    Apr 9, 2013
    Posts:
    180
    Link on the blog has been fixed (the one on the first post of this thread was correct). Thanks for your feed back.
    About the 'Save Map' issue, does it happen on a blank project where TerraVol has been freshly imported?
     
  34. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    How do i use height maps i cant find any info in the docs
     
  35. Qmaks2

    Qmaks2

    Joined:
    Jun 2, 2012
    Posts:
    25
    I find error in webbuild. Can you fix it? I found 5-6 place like that when i tested build
     
  36. Amfu

    Amfu

    Joined:
    Apr 9, 2013
    Posts:
    180
    @PvTGreg You have to use a gray scaled texture as an heightmap in the terrain inspector :)

    @Qmaks2 I think this can occur when specific normal values prevent the shader from interpolating textures well. I guess this will be hard to fix...
     
  37. Qmaks2

    Qmaks2

    Joined:
    Jun 2, 2012
    Posts:
    25
    But for commercial games this bug is critical...
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It's triplanar shader world normal blending issue. I ran into the same issue working on standalone triplanar shader for my Relief Terrain Pack. In my case I believe I solved this :) (yes - shameless plug, I know).

    ATB, Tom
     
    DarkArts-Studios and VicToMeyeZR like this.
  39. Dalyon

    Dalyon

    Joined:
    Oct 31, 2014
    Posts:
    1
    Shameless endorsement (and no tomaszek is not paying me)... I have not seen this error when using the Relief Terrain Pack with TerraVol. I can also attest that the RTP is awesome and plugs in seamlessly with TerraVol. A definite must-have if you are shooting for more graphical realism/immersion.
     
    DarkArts-Studios likes this.
  40. Amfu

    Amfu

    Joined:
    Apr 9, 2013
    Posts:
    180
    Thanks for those answers. That is what I thought, but I'm not good at dealing with shader. Tomaszek is the shader expert here :)
     
    DarkArts-Studios likes this.
  41. furiouslol

    furiouslol

    Joined:
    Aug 19, 2014
    Posts:
    19
    Hi there!

    Just a quick question regarding TerraVol with RTP

    It seems the current settings for using RTP with TerraVol might have changed, and Im not quite sure what's up

    Im using the recommended Vertex colours (Default: Red, Digged: Green, Sand: Blue), however my textures are mixed up? For example, Rock/Cliff is where the Grass should be, and vice versa.

    Anyone have the same problem/possible solution to fixing this?

    Edit: This might explain what I mean a bit better
    http://pbrd.co/10pHlBM
     
  42. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    You need to configure ReliefTerrainPMTriplanarStandalone.shader

    By default: this is part of defines section in shader:
    Code (csharp):
    1.  
    2. // forces 3 layers only, side is first layer, top (floor) is 2nd layer, bottom (ceil) is 3rd layer
    3. //     #define WNORMAL_COVERAGE_XZ_Ypos_Yneg
    4. // forces 3 layers only, X side is first layer, Z side is 2nd, top (floor) + bottom (ceil) is 3rd layer
    5. //     #define WNORMAL_COVERAGE_X_Z_YposYneg
    6. // forces 4 layers X side is first layer, Z side is 2nd, top (floor) is 3rd, bottom (ceil) is 4th layer
    7. #define WNORMAL_COVERAGE_X_Z_Ypos_Yneg
    8. // forces 2 layers X side is first layer,  top (floor) + bottom (ceil) is 2nd layer
    9. //     #define WNORMAL_COVERAGE_XZ_YposYneg
    10.  
    As you see #define WNORMAL_COVERAGE_X_Z_Ypos_Yneg is active (uncommented) so vertex colors are not used for coverage but it's done automatically. You need to comment this define to make it working at full control.

    Tom
     
  43. furiouslol

    furiouslol

    Joined:
    Aug 19, 2014
    Posts:
    19
    Thanks for the fast reply Tom!

    I'll give it a crack and let you all know how it turns out, thanks again :)

    Edit: This worked perfectly, thank you so much
     
    Last edited: Nov 6, 2014
  44. Sphelps

    Sphelps

    Joined:
    Jun 9, 2013
    Posts:
    243
    Would it be possible to create a similar system like 7 days to die their voxel system
     
  45. Sphelps

    Sphelps

    Joined:
    Jun 9, 2013
    Posts:
    243
    ok thanks moving on!
     
  46. VataRaven

    VataRaven

    Joined:
    May 24, 2013
    Posts:
    180
    Would you be interested into coding this for the Unreal Engine?

    I know people on the forums over there said they would be interested in more useful assets, you know, the things that aren't models and textures
     
  47. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    if you buy it for unity im sure it wont be too difficult to read it over and convert it to whatever unreal uses
     
  48. Theekshana-A

    Theekshana-A

    Joined:
    Sep 27, 2014
    Posts:
    81
    I am having a issue, the terrain does not have a underground for like caves and dungeons. Could you please add a underground?
     
  49. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    you can do that your self using the editor script
     
  50. Theekshana-A

    Theekshana-A

    Joined:
    Sep 27, 2014
    Posts:
    81
    where in the editor script?