Search Unity

Voxeland - Voxel Terrain Tool

Discussion in 'Assets and Asset Store' started by Wright, Jun 25, 2013.

  1. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    what does the Voxelith and Voxelump project do ?
     
  2. crimsonmortis

    crimsonmortis

    Joined:
    Feb 21, 2016
    Posts:
    63
    Was looking for a roadmap/Trello listing of work in progress planned features is there one? I have been looking over the http://www.voxeland.idea.informer.com/ page.

    I have been looking for a physic solution for the runtime terrain parts that are left hanging in the air and have begun to understand there is no easy or processor (CPU/GPU) friendly way to handle them. Is there any news about this? Just a wishlist item as it does not overly effect anything other then it looks odd.

    I thought I saw something about Unistorm support or was that in Mapmagic? I love the drop down/support enabled options when products work together so well. Plus I want an excuse to grab Unistorm to use it for easier farming/plant growth suppoort over my current weather time of day system.

    Voxeland was the first review I have submitted on the asset store and was very happy to do so!
     
  3. P_Jong

    P_Jong

    Joined:
    Jun 14, 2017
    Posts:
    58
    I'm getting this one as well and another at line 186. I think this began after I upgraded to 2017.2.
    For me I just compile twice, and I don't get the error the second time I compile.
     
  4. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    Will-D-Ramsey, are you using the textures included with Voxeland - not MapMagic? They look the same, but MapMagic has a different alpha channel. It seems to be a problem with the heightmap that is stored in alpha.

    Fix, fix.
    Yep, that seems to be only Unity 2017.2 related issue. It's very odd to have it gone after the second compile. Anyways I've freed texcoord 0 for some queer Unity purpose in shadow pass.

    Here is Voxeland issues/ideas page. IdeaInformer is very user-friendly, but I find it hard to use as an issue tracker.

    There are still no easy way to determine if a block floats in the air or not. Well, it's pretty easy for the single blocks, but what if it's some kind of bridge over several chunks? Moreover, there is no way to determine if blocks were hanged in the air accidentally or was it conceived - for the floating islands, for example.

    I do remember compatibility posts in Unistorm thread, but cannot find them now. I'm pretty sure it was about MapMagic.

    It's still just an idea. I want to make a voxel mesh engine. You create a single block (lump) in scene and then sculpt it the way you like. To make stones, asteroids, caves - all that stuff. Kinda Voxeland with size is limited to a chunk instead of the infinite terrain. It will be a standalone asset, but will use a copy of Voxeland engine. "Voxelith" and "Voxelump" are just the name variants for this project.
     
    _Jens, P_Jong and Jeremy-Borton like this.
  5. Deleted User

    Deleted User

    Guest

    This worked like a charm. Thanks! Here's what I did for others' reference in order to get the voxeland object translatable:
    Code (CSharp):
    1. //In Land TextureArray.shader at bottom of Properties{}
    2. _SpecialOffset("Special Offset", Vector) = (0,0,0,0)
    3. //in SubShader{}
    4. float4 _SpecialOffset;
    5. //in surf()
    6. float3 newinwpos = IN.wPos + float3(_SpecialOffset.x, _SpecialOffset.y, _SpecialOffset.z);
    7. //used newinwpos in place of IN.wPos for rest of surf()
    8. //used material.SetVector("_SpecialOffset", runningoffset) on scripting end
     
  6. Will-D-Ramsey

    Will-D-Ramsey

    Joined:
    Dec 9, 2012
    Posts:
    221
    Thanks alot man that fixed it I was indeed using the MapMagic textures. now I have more of a question then an error. Im doing cave generation but im struggling to find a way to prevent floating land artifacts (circled in red) where the caves meet the surface. any tips?
    upload_2017-12-1_18-46-40.png
     
    SkygodGames likes this.
  7. Will-D-Ramsey

    Will-D-Ramsey

    Joined:
    Dec 9, 2012
    Posts:
    221
    And oh boy the Ultimate Survival/Voxeland integration doesnt work anymore since ive started using MapMagic. There's nothing specific im missing right? Sorry for all the questions but I just got MapMagic.
     
    Freshmeat911 likes this.
  8. _Jens

    _Jens

    Joined:
    Apr 26, 2015
    Posts:
    5
    Thank you, those fixes work like a charm!
     
  9. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    There is "remove thin layers" option in settings.
     
    Will-D-Ramsey likes this.
  10. Will-D-Ramsey

    Will-D-Ramsey

    Joined:
    Dec 9, 2012
    Posts:
    221
    Yeah ive been messing with it and doesnt seem to work consistently. Works in some places and doesnt in others.
     
  11. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    NP! By the way you can apply the texture offset in vertex shader instead of the surface one to make it a bit faster (just a tiny bit, but anyways).

    I have not tried Ultimate Survaval yet, but it would be great if you could open up an issue with a description about how this bug reveal itself so I could keep it in mind when start MM-US integration.

    It just removes the layer only if it's thinner than "remove thin layers" value. For instance, if you've got floating blocks layer thickness of 3, and remove value 2 - they will not be removed. Try increasing this value along with making cave entrances more sheer.
    There are still no easy way to determine if a block floats in the air or not. Well, it's pretty easy for the single blocks, but what if it's some kind of bridge over several chunks? Moreover, there is no way to determine if blocks were hanged in the air accidentally or was it conceived - for the floating islands, for example.
    I'm having a strange case of déjà vu, just wrote it a post above. I will think about the way to solve this problem since it's got pretty much demand lately.
     
    Will-D-Ramsey likes this.
  12. Victor_cross

    Victor_cross

    Joined:
    Dec 16, 2015
    Posts:
    41
    work2.jpg Hi guys,
    When I increased the terrain object x,y,z scale to 3 the object nettles etc where lost underneath main terrain blocks even after re build its like they where stuck on the location where the 1 scale terrain used to be.
    and there is a 'aabb.IsFinite()' error coming up also.
     
    Last edited: Dec 13, 2017
  13. Victor_cross

    Victor_cross

    Joined:
    Dec 16, 2015
    Posts:
    41
    Is it possible to import a heightmap into voxeland and if so How.
     
  14. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Just curious. Can this be used in a low poly style vertex or flat ?
     
  15. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    I can see you've got an error in the console? Could you open up a new issue and paste it there?

    You've got to use heightmap generate type to do that.

    For now I'm not aware of any low-poly shader that is 100% compatible with Voxeland, but I was going to experiment with flat shading myself (don't know ETA. though).
     
  16. Apposl

    Apposl

    Joined:
    Nov 27, 2017
    Posts:
    50
    Is anyone using this with Ultimate Survival? I have a small issue and am looking for just a little guidance. I followed Messy Coder's tutorial on integration, but am unable to actually dig into the terrain, I just mine stone from the ground, cut the grass a bit, and also mine stones from the trees. Is this because I am using the Voxeland free evaluation version, or my own error somewhere? If someone has encountered or covered this and could point me in the right direction it would be greatly appreciated. I really like what I see with Voxeland so I just want to make sure I can actually make this work before I purchase. Thought I'd ask. Thanks!
     
  17. David-Kimball

    David-Kimball

    Joined:
    Sep 18, 2014
    Posts:
    8
    umm what did I toggle and how do I toggle it back? :) Thanks in advance!! what.PNG
     
  18. Coltenney

    Coltenney

    Joined:
    Mar 10, 2015
    Posts:
    25
    I am trying to get a preview ghost voxels. Instead of just seeing the side of the voxel you are placing on, I want to see a 'preview' of what it would look like after placement. This would include seeing how surrounding voxels would smooth in response.

    Ive done this in other voxel engines by just quickly placing and removing a designated ghost voxel as you scan over the terrain, but this is not performant.

    Do you have any ideas on how to achieve this?
     
  19. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @Wright speaking of ETA do you have an estimation of when we might see the first implementation of full Megasplat support on gitlab? thanks.
     
    Jossgasm likes this.
  20. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    I haven't tried Messy Coder's tutorial, but I'd like to mention that evaluation version has no differences with the full one except some interface changes. So that should not be a cause of the issue.

    Looks like MapMagic's preview mode. If you are using MapMagic - right click anywhere in the graph and select preview - clear.
    However there should not be any blue spots in a preview mode. Odd.

    I don't know the other way to do except building actual voxels. Yep, it's very inefficient, especially if done each frame. I'd rather give up this idea, maybe there's the other way to highlight blocks?

    I wish I knew. I'm currently trying to implement splines (no, I'm not "reticulating splines") in MapMagic, so have not even yet started this. I'll try to start it this month, but I can't guarantee it.
     
    Ascensi and Apposl like this.
  21. Apposl

    Apposl

    Joined:
    Nov 27, 2017
    Posts:
    50
    Figured it was my error. Love your asset, thank you.
     
  22. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    That sounds awesome if it is what I think you're adding - "add or subtract Voxel volume or paint strokes based on the spline path? if so that would be cool to have them attach to each other like a tree to produce tunnels, rivers or walking paths etc. -magnetic spline nodes

    Anyway I appreciate your answer, it's good to know what's happening/what stage you're at and can only hope first signs of megasplat arrives before the new year even if it's not quite complete ;) would be cool but no stress upon you.
     
    Jeremy-Borton likes this.
  23. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    @Wright I tried your free unitypackage and it spikes a lot on terrain change, physx collision data update mostly. Does voxeland have a custom representation of collision that I can use instead of physx?
     
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    Glad you are enjoining Voxeland!

    That's right. But for a start it will just sculpt/paint MapMagic terrains to create rivers, then I'm going to create road meshes for MapMagic with splines, and then make it available to set Voxeland blocks. So it will take time.

    I wish I could do something with this. Updating physx meshes should be done in main thread, and it's rather resource intensive operation. Unfortunately, you cannot make a terrain walkable, you even cannot aim the terrain without baking it's collision.
    If someone have an idea of how this could be by-passed - feel free to share. For now I have no better thoughts than splitting chunk in 4 to distribute physx baking in 4 frames - however this will not make the peaks 4 times lower (each baking call has it's own overhead).
     
  25. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    Maybe chunks/areas could be generated as a larger size but with progressive collision generation (slowed down/incremental) That way a person could be traveling to the next chunk and it quietly allocates a small set memory and CPU to create the land/chunk rather than doing it instantly. This is how dialup internet in the old days worked with website graphics loaded to keep visitors from leaving otherwise the webpages would remain empty while the customers waited for the graphics to instantly load. The progressive view of textures would slowly reveal themselves. So in terms of of chunks loading, progressive loading and rendering maybe key in this area to prevent spikes.
     
  26. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    agreed on overhead but w don't know so before Splitting workload you need to benchmark the difference between changing within one chunk and changing four chunks. Also Look at Terravol how they do it.
     
  27. Craptastic

    Craptastic

    Joined:
    Dec 15, 2016
    Posts:
    8
    Anybody have any experience using alternate vegetation managers? uNature for example? I'm just curious about GPU options for grass. Unity grass tanks my FPS.
     
  28. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    For any objects I'd recommend using the asset "InstantOC" It renders only what the camera sees, everything else behind you or hidden behind something else the rendering becomes disabled. This might allow you to keep working with you have if you'd rather not have to sacrifice one asset for another and works with dynamic/moving objects.
     
  29. Craptastic

    Craptastic

    Joined:
    Dec 15, 2016
    Posts:
    8
    Cool, I'll look into it.
    Unrelated note, Wright, are there any parameters I can tweak to get less terracing on slopes? Something so that ledges one block higher can blend into a slope instead of sudden tiny plateaus?
     
  30. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    good news: 2017.3 physx mesh update takes half the time. still spikey
     
  31. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    This will require threaded collision update, that, unfortunately, isn't possible. The picture could be downloaded without a lag while you are viewing through the page, while the collision should freeze the game anyways.

    Voxeland does not use Unity grass. However it's still pretty simple (just a grass meshes batched together).

    This setting is called Relax Iterations. However using large values can result in seams between chunks. It's not a big problem since they could be removed with increasing a Mesh Margin value.

    Really good news.
    BTW how much time it takes to mesh.bake collision data in your case?
     
  32. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    19ms
    on a 8400
    I want to test what happens in a more realistic scenario: where the cursor is a few voxel wide, how do I change the script to do that?
     
  33. RockingGameDeveloper

    RockingGameDeveloper

    Joined:
    May 28, 2015
    Posts:
    18
    Are they ever going to upload a tutorial on how to use the NEW version of Voxeland. The tutorials online don't help much with what i'm doing. I'm trying to teach myself how to use it and I am getting kinda far. I just wish the developers who be more up-to-date with what they developed in terms of teaching developers how to use what they bought.
     
    ftejada likes this.
  34. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    I'm thinking that it could be setup so it loads far away from the player quietly that the background will have loaded by the time the player gets close enough to "see the next chunk" not through it but you are saying you think it would just stall and freeze the game? The idea would be that once collision starts generating that it would have to finish completely and if the player perhaps walks diagonally to a chunk corner maybe it will be forced to start two being generated at a time. I wish the colliders were created like how a distanced based tessellation shader works but I guess you need the collision generated for plants and trees to be populated as side from the players and bots falling through. Anyway it's just an idea you would know more than I, I'm not a programmer.
     
    laurentlavigne likes this.
  35. Deleted User

    Deleted User

    Guest

    Hey i want create a Low Poly Terrain, i have Voxeland and Map Magic, is it possible with this Assets?
     
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    Switch the brush to volume mode. But I suppose the results would be more or less the same: unless the brush size is smaller than chunk size (32) it will cause 4 chunks to rebuild, and they will apply the collision one by one.

    Here are some pages you can find handy: basic principles, quick start guide, using the brush. They are not videos, though, so I'll think of recoding a new tutorial.

    Unfortunately mesh.bake collision data does not work this way. It works in main thread only, and done in one frame per mesh. This means that there is no "while player gets close enough". The games stops for 19ms while collision mesh updates, and there is no way to render anything or read any controls while it's calculating. 19ms is not a big amount of time, at least it's 53 FPS even if it happens each frame, but it barely noticeable freeze anyways.

    I have not tried using Voxeland with flat shaders, so it's better ask a community:
    2ALL: Has anyone got the experience of creating flat faceted look with Voxeland or MapMagic?
     
    Ascensi likes this.
  37. Deleted User

    Deleted User

    Guest

    Me and the Team want make a very big Terrain with dungeons, its a low poly Game so we need this special look and also a Methode to Bake the Terrain, i try out to Build a Static Terrain with a Terrain Size of 4980 units ( we need way more ) but Unity closes before the Bake was finish, so does Voxeland handle big terrains without a runtime generation?
    If not how does we get the terrain generated really fast, we don't need all this beautiful details and we also don't need a normal map, the question is how shredder Voxeland to get the best performance, we also can edit the source when its needed.

    Also for the low poly look is there a way to reduce the faces in the Mesh with Voxeland or is there a way to reduce the details on the terrain?

    EDIT_:
    Is there a way to make holes in the Terrain of Map magic ( some external tools are also okay ), then we can Mask the full terrain made with map magic and create a second terrain with Voxeland only for the Dungeons and use the holes as dungeons entry, what do you think?
    Because make Map Magic low poly is not the problem, i made this with a custom material and lowered the Resolution
    2017-12-13 13_52_10-.png
    The problem what i have is to make the Dungeons and in this case Voxeland will be perfect for this job

    EDIT AGAIN_: the team decide to make the dungeons in blender so we use Voxeland for a other project but also thank you
     
    Last edited by a moderator: Dec 13, 2017
    P_Jong likes this.
  38. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    ouch! that's very expensive, you need to take care of that GC spike and uh all this mesh rebuilding should be on the other thread, like terravol
     
    MarkusGod and ftejada like this.
  39. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    423
    Hello.
    How can I generate custom voxel area using a code?
    I want to generate an asteroid instead of terrain. So I need just a voxel sphere in the center of voxel area.

    I tried the next code in order to test a possibility of custom generator:

    Code (CSharp):
    1. void Generate () {
    2.  
    3.         Voxeland voxeland = Voxeland.instances.Any ();
    4.  
    5.         for (int x = 0; x < Size; x++) {
    6.         for (int y = 0; y < Size; y++) {
    7.         for (int z = 0; z < Size; z++) {
    8.  
    9.             voxeland.data.SetBlock (x, y, z, 0);
    10.         }
    11.         }  
    12.         }
    13.  
    14.  
    15.         voxeland.Generate (true);
    16.     }
    But:
    1. It have no effect. Everything is unchanged.
    2. It is extremely slow. If Size = 20, the Unity will freeze for a 10 seconds.
     
    ftejada likes this.
  40. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @Wright

    I just bought Voxeland and I'm learning how to use it.

    I am looking at the documentation but I can not find how to establish my Character in the third person, so that the calculations of an infinite terrain, etc... in voxeland, go on him character and not on the camera ...

    Can you tell me how I can do it?

    I have seen another problem. When I walk through the Voxeland terrain, my character in the third person there are times that the feet go through the ground.
    I guess it's because the meshCollider of each "Chunk" is not well adapted to the visual mesh it represents.

    ProblemasColliders.jpg

    My game is in the third person and it is very important to solve this problem. How can I solve that?


    regards
     
  41. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    laurentlavigne, actually, the mesh rebuilding is done in the other thread. The orange spike you see - it's the collision update, it should be executed in main thread only. You can try adjusting chunkSize value in Voxeland.cs (it's not exposed in settings), but note that each time you change this value - a completely new voxeland object should be created.

    Artaani, the code seems to be okay except one detail. You should call Rebuild instead of Generate. Generate re-writes your changes.

    Here is far more efficient way to set large amount of blocks:
    Code (CSharp):
    1. CoordDir min = new CoordDir(0,0,0);
    2. CoordDir max = new CoordDir(20,20,20);
    3.  
    4. Matrix3<byte> m = new Matrix3<byte>(min, max-min);
    5.  
    6. for (int x=min.x; x<max.x; x++)
    7.     for (int y=min.y; y<max.y; y++)
    8.         for (int z=min.z; z<max.z; z++)
    9. {
    10.     m[x,y,z] = 0; //if you want to fill it with first block type
    11.     m[x,y,z] = Data.emptyByte; //to fill it with 'air'
    12. }
    13.  
    14. Voxeland voxeland = Voxeland.instances.Any();
    15. voxeland.data.SetMatrix(m, pin:true); //pin will prevent the area from re-generating
    16. voxeland.Rebuild();
    Just clarifying if you have an empty area around the place where you set the blocks. Obviously, you can't see any change underground.

    ftejada, try commenting out (removing) line 516 of Chunk.cs:
    Code (CSharp):
    1. //offset lo border verts to prevent seams
    2. ChunkMesh.OffsetBorderVerts(loWrapper.verts, loWrapper.normals, rect.size.x, -0.15f);
    Just to see if it's related.
     
    Artaani likes this.
  42. Jeff_CoderDads

    Jeff_CoderDads

    Joined:
    Mar 25, 2017
    Posts:
    11
    I'm not sure what I'm doing wrong, or if these two products have just changed since then but I'm trying to follow the MapMagic/Voxeland Tutorial on youtube here:



    The problem I'm having is when I get about halfway through, and I'm trying to generate the caves, what I have, and what the tutorial has are very different.

    This is what the tutorial looks like
    TutorialImage.png


    And this is what my screen looks like.
    ExampleImage.png

    And here's what the map looks like
    Editor.png


    I've tried this about 3 times today, so at this point it's a pretty bare bones scene. Added MM/VL, created the Voxeland Asset, added land blocks from the voxel land demo land assets, then followed the tutorial.

    Any ideas?
     
  43. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    GC collect isn't physics, that's the bulk of the time spent in this one spike and about half of the others, that, I'm sure isn't intended
     
  44. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    423
    Amazing! Thanks you for quick reply. Great support : )

    Also, is there a way to reduce size of chunk in order to improve performance during modification of terrain? So smaller area will be recalculated each time after modification.
     
  45. David-Kimball

    David-Kimball

    Joined:
    Sep 18, 2014
    Posts:
    8
    Hello Wright, thanks for being so responsive to everyone its confidence inspiring. I have been having issues since going to RTP for my whopping 4 textures (but detailed PBR ones) and now that I am trying to add tree objects I am not able to get anything to show up, grass is working however tree objects I am getting object reference not set to an object when I build the solution having an output type of object present. Do you know where I can find any examples of Map Magic + Voxeland and objects/grass? since the output part is different I want to be sure I am getting similar results when I go through map magic magic videos for ideas and reference.
     
    laurentlavigne likes this.
  46. SkygodGames

    SkygodGames

    Joined:
    Feb 23, 2014
    Posts:
    18
    Say if I wanna use an Asteroid as an VOxel, how will I go about doing that?

    Spherical support?
     
    Last edited: Dec 15, 2017
  47. David-Kimball

    David-Kimball

    Joined:
    Sep 18, 2014
    Posts:
    8
    here is the error, this is from adding 1 object layer and dragging the rock metal prefab over it for the transform binding. Let me know if you think I missed something along the way.

    NullReferenceException: Object reference not set to an instance of an object
    MapMagic.VoxelandGrassOutput.OnLayerGUI (MapMagic.Layout layout, Boolean selected, Int32 num) (at Assets/Terrain/MapMagic/Generators/VoxelandOutputs.cs:697)
    MapMagic.Layout+<DrawLayer>c__AnonStorey0.<>m__0 (MapMagic.Layout tmp) (at Assets/Terrain/MapMagic/Main/Layout.cs:1588)
    MapMagic.Layout.GetBackgroundRect (System.Action`1 onGUI, Boolean fullWidth) (at Assets/Terrain/MapMagic/Main/Layout.cs:1550)
    MapMagic.Layout.DrawLayer (System.Action`3 onGUI, System.Int32& selectedNum, Int32 num, Int32 heightSpacing, Int32 widthOffset) (at Assets/Terrain/MapMagic/Main/Layout.cs:1588)
    MapMagic.VoxelandGrassOutput.OnGUI (MapMagic.GeneratorsAsset gens) (at Assets/Terrain/MapMagic/Generators/VoxelandOutputs.cs:679)
    MapMagic.MapMagicWindow.DrawWindow () (at Assets/Terrain/MapMagic/Editor/MapMagicWindow.cs:541)
    MapMagic.MapMagicWindow.OnGUI () (at Assets/Terrain/MapMagic/Editor/MapMagicWindow.cs:327)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:285)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:278)
    UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:245)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
     
  48. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    423

    Wright helped me with the same task in this comment:
    https://forum.unity.com/threads/voxeland-voxel-terrain-tool.187741/page-33#post-3322744

    Here is my code to generate simple sphere:
    You may modify it as needed.


    Code (CSharp):
    1. void Generate () {
    2.  
    3.         CoordDir min = new CoordDir (5 , 5 , 5);
    4.         CoordDir max = new CoordDir (200, 200, 200);
    5.  
    6.         Matrix3<byte> Array3D = new Matrix3<byte> (min, max-min);
    7.  
    8.         for (int x = min.x; x < max.x; x++)
    9.         for (int y = min.y; y < max.y; y++)
    10.         for (int z = min.z; z < max.z; z++) {
    11.  
    12.  
    13.             Vector3 Center    = new Vector3 (100f, 100f, 100f);
    14.             Vector3 ThisPoint = new Vector3 ((float)x, (float)y, (float)z);
    15.  
    16.             float Distance = Vector3.Distance (Center, ThisPoint);
    17.  
    18.             if (Distance < 70f) {
    19.                 Array3D[x,y,z] = 0;              // if you want to fill it with first block type
    20.             }
    21.             else {
    22.                 Array3D[x,y,z] = Data.emptyByte; // to fill it with 'air'
    23.             }
    24.  
    25.         }
    26.  
    27.         Voxeland voxeland = Voxeland.instances.Any ();
    28.         voxeland.data.SetMatrix (Array3D, pin:true); //pin will prevent the area from re-generating
    29.         voxeland.Rebuild ();
    30.  
    31.     }
    But I noticed that chunk is not cubical. They are like in the minecraft. Much larger on vertical axis. It means that Voxeland designed to be a tool for landscapes, but not for asteroids or very large and deep net of caves.
    It is not too critical but it decreases a performance in several times.
     
    SkygodGames likes this.
  49. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @Wright

    It does not solve the problem....

    Regards
     
  50. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,278
    Jeff_CoderDads, you've got a horizon mesh on and quite a limited "true voxel" view range. Try increasing the terrain size or view range in Mode and Ranges.

    You can try experimenting with chunkSize value (Voxeland.cs), but note that new Voxeland object has to be created from scratch after any value change. Generating each chunk require some overhead, so setting the half value will not make the chunk generate four times faster. 30 seems to be the best ratio between generate speed / overhead.

    This issues seems to be related with the grass. Please check if you've got the grass mesh assigned for all of the grass blocks.

    laurentlavigne, didn't notice the spike under selection. I though you were talking about the four spikes around. I don't really know what's allocating so much memory in Update, I'll take a look into it. How often does this spike happen? Could you please make a screenshot of voxeland settings (or email me the scene)?

    Tried to find the scene I've made during that tutorial, but it looks that it has been overwritten. I think I'll follow my own tutorial to re-create it.

    That's right. I'm thinking of a special asset that will be suitable for asteroids (Voxelump, you can find discussions about it dozen posts above). Voxeland is really better suits for creating the landscapes.

    ftejada, is your character falling through all of the terrain or it happens in some particular places? Is fall depth is always the same?
     
    Artaani likes this.