Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Spherical Voxel Engine (CC-BY)

Discussion in 'Works In Progress - Archive' started by Sven-Frankson, Jul 26, 2014.

  1. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27


    Hi there,

    First release of Planet Builder, a spherical voxel engine allowing you to build Minecraft-like planets.

    Using an interesting way for mapping the surface of the planet, it offers quite a nice result for voxels shapes, reducing the artefacts at poles or "corners" you might experience with other sphere mapping.

    It features a height-cubeMap generator, making it very easy to generate random planets, and several generation-option to get the planet you wish in a few clicks. All generation options are documented in the editor.

    Generated planet is editable block-by-block, both in editor and runtime mode.





    You may download the Unity Package here : https://docs.google.com/file/d/0B2P3KCl2M5gOUkFWcXNvdmhqWEU/edit

    Here a video tutorial showing how to use Planet Builder in your Unity project. It will also work with Unity free.





    It still suffers a lack of optimization, so you may want to save your scene before trying to push it to far (big planets, block by block edition), but as far as I tested it, it's quite stable.

    Feedback appreciated, especially about performances issues !

    Have a nice day,

    Sven Frankson

    Update 0.2 here : Spherical Voxel Engine (CC-BY)
     
    Last edited: Aug 4, 2014
    nasos_333, Beennn, balaam and 2 others like this.
  2. sandboxgod

    sandboxgod

    Joined:
    Sep 27, 2013
    Posts:
    366
    Wow that looks really cool will have to check this out sometime. What I saw in the video looks very cool
     
  3. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Wow that looks pretty nice
     
  4. Callski

    Callski

    Joined:
    Feb 3, 2013
    Posts:
    130
    Wow you put this out for free! Thank you so much! You should consider adding this to the asset store as a free package as well. I think it would be a hit.
     
  5. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27
    Hi, thank you all for the kind words !

    @Callski. Yeah, I intend to send it on the Asset Store someday, but I have to solve some performance issues first.
    Many triangles are generated between each chuncks, and the chosen algorithm to convert coordinates from world space to indexes in the blocks grid is the worst I could imagine (and yet, the only one I've been able to implement so far).

    Have a nice day !
     
  6. IndieLegion

    IndieLegion

    Joined:
    Jul 6, 2014
    Posts:
    6
    Hi Sven, congratulations on this release!

    I've been working on something similar myself for some time and might be able to help with your world space <=> indexes issue. Yell out if you'd like a hand!
     
  7. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Stunning! Saving this page for a future project. Brilliant work.
     
  8. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27
    Hi,

    Update 0.2 coming, with vegetation and embedded tutorials window.



    Planet Builder now comes with 8 low-poly vegetation elements, which can be placed on generated planet as any block.

    Planet Editor now features a Vegetation Wizard, allowing to populate your planet's flora, with options determining each plant's frequency and height range.

    Also, all (two) video tutorials are now reachable from inside Unity.


    Update v0.2 :
    - Adding 8 vegetation prefabs.
    - Adding "Vegetation Wizard" window.
    - Adding "Tutorials and Documentation" window.
    - Adding "Clear Vegetation" option on Planet Inspector.
    - Adding warning if Planet is still connected to prefab (which cause planet edition failure after serialization)


    Demo/Tutorial video is available here :



    And you still may download package here :

    https://docs.google.com/file/d/0B2P3KCl2M5gOUkFWcXNvdmhqWEU/edit

    AssetsPreview might misbehave while importing the package (showing models with no materials in previews while okay on scene). Instanciating prefabs and then hitting "Apply" solves the issue. I'll try to solve it automatically next time...

    Thanks for watching and have a nice day !
     
    Last edited: Aug 4, 2014
  9. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    wow awesome!
     
  10. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Amazing! Superb package by the looks of it, some really interesting games could be made with this!
     
  11. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27
    Hi,

    @IndieLegion : Forgot to reply yesterday.
    About converting coordinates from world position to local grid, the main issue is in the fact it's not an orthogonal projection of a subdivided cube on a sphere (each face is divided in 128*128 and projected on a sphere), but several steps involving at each time a subdivision and an orthogonal projection (it looks like how you build an icosphere by subdividing an icosaedron, but with squares), resulting a mesh I don't know how to parametrize.

    But I think the result is like 6 parts of a planet, where each part is a grid made with "horizontal and vertical latitudes". If that's the solution, it should be solved by the next update...

    @im and @mimminito : Thanks !
     
  12. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27
    Bumping for a quick demo of the last update.



    As said in video description, there has been quite a lot of optimization concerning performance issues, allowing to enlarge generated planets significantly. Finally found the math function from world position to grid indexes.

    - Runtime collider generation is smarter.
    - Vertex count by chunck is divided by a 6 factor.
    - Chuncks are baked to reduce draw calls.
    - Texture atlas, which also drastically reduces draw calls.

    I still have to clean and document it before updating package, and there are still a few things i'd like to fix before releasing it. Mostly...

    - The size of .scene file is huge, as all meshes are stored. Unity compress it very efficiently, then a 700MB scene is built up into a 17MB .exe game.
    - Vegetation still causes huge draw calls rising. In the video, two cams are used to render only the closest plants, but it still causes cpu overhead in Unity Editor, when trying to select/delete/move thousands of gameobjects at the same time...

    Thanks for reading ! Have a nice week !
     
  13. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    cant wait! thanks!
     
  14. SirStompsalot

    SirStompsalot

    Joined:
    Sep 28, 2013
    Posts:
    112
    Man, this is so wildly cool. Hope to see an asset released, I'll buy it for sure.
     
  15. Amon

    Amon

    Joined:
    Oct 18, 2009
    Posts:
    1,384
    Agreed with the majority. This looks awesome.
     
  16. Andrew-Kraken

    Andrew-Kraken

    Joined:
    Sep 12, 2014
    Posts:
    2
    I checked this out last night. Good work this is very impressive!
     
  17. scriptonite

    scriptonite

    Joined:
    Mar 4, 2014
    Posts:
    1
    Hey, this looks awesome! The link no longer works though because too many people have accessed it, any chance of a reupload?

    Keep up the great work, can't wait to see the next iteration.
     
  18. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27
    Hi,

    You now may download it here : https://github.com/SvenFrankson/PlanetBuilder

    I'm currently working on a wizard to build cities. For given buildings, it generates path according to splines.


    I'll add more later, just saw about the dead link and came to edit this... Thanks for reading and have a nice day !
     
  19. SirStompsalot

    SirStompsalot

    Joined:
    Sep 28, 2013
    Posts:
    112
    I like the cities idea. It's a really nice touch.
     
  20. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    Hi

    I'm really loving this idea but i have a few queries about it first.

    Can it be made empty, with individual blocks filled in but NOT from the center
     
  21. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27
    Hi,

    I'm not sure I understood your question Valrik.

    It's spherical, so any block has its position defined according to a center...

    Nop, just can't understand your question ^^ A quick drawing maybe ? Thanks for your interest anyway !

    (Yep, project seems dead, but I'm still available for questions, PM or mail. I lately switched on asp.net app because my boss has (sadly) no interest in Planet Engines, but might be back on Unity projects soon, with a few ideas involving cubispherical planets)
     
  22. cfpperche

    cfpperche

    Joined:
    Apr 4, 2015
    Posts:
    1
    I'm looking for your project in github.

    I'm a noob game programmer,

    Do you may create a tutorial about how to create the basics about this project ?

    Like rendering of the sphere and the process of how to voxels are generated ?

    Thanks

    Sorry for my poor english
     
  23. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27
    Hi,



    This video describes the basic use of the pluggin.

    The way voxels are generated is not documented. The planet surface is divided into 6 parts, each one being a "spherical square" with 120° corners, each of theese parts is divided into 2^n smaller squares. Then it's just procedural mesh generation, which is not a very interesting part of the code (build vertices list, build triangles list, build normals list...) as it's too specific.

    Have a nice day,
     
  24. CoderFrom1966

    CoderFrom1966

    Joined:
    May 3, 2015
    Posts:
    2
    Dear Sven,
    i first used an older version... the new one on github is totally awesome.
    The performance of your engine is ultracool ;)
    Kind Regards, Ururgrossopa

    PS.: but i'm still falling thru the planet :/ No collision mesh?
     
    Last edited: May 3, 2015
  25. CoderFrom1966

    CoderFrom1966

    Joined:
    May 3, 2015
    Posts:
    2
    imo he wants a hollow sphere, with additional voxels being rendered once the user starts digging
     
  26. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    really nice!!! you could make a game featured by your asset. Save some extras for your self and make something awsome!!!

    Also, when I first read the title, I remembered Planets³!
     
  27. Dean Avanti

    Dean Avanti

    Joined:
    Oct 21, 2012
    Posts:
    12
    This looks cool, but has anyone done this with hexagons instead of cubes?
     
  28. phil-harvey

    phil-harvey

    Joined:
    Aug 27, 2014
    Posts:
    75
    Is this still being updated? I see that github has not been touched for a while.
     
  29. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27
    Hi,

    No, it will not be updated. I still answer any of your questions concerning the project, but I don't think I'll update it anytime soon.

    Mostly, because any functionality I tried to add after initial planet generation increased scene storage and cpu consumption beyond acceptable limits... Height Map and Meshes are serialized, and there is no runtime generation, hence it can't deal with planet scaling in number and size.

    Good news is that I worked on another project about planet generation, without Voxel (also it should be doable), but correcting all the issues about oversized scenes and LoD management. Repo is here : https://github.com/SvenFrankson/WorldMaker

    Have a nice day !
     
  30. ddaversa

    ddaversa

    Joined:
    Sep 18, 2015
    Posts:
    4

    That is pretty amazing. I'm trying to learn how to generate these kinds of works just for fun ... tried looking for some tutorial/document to get a bit of help starting (or at least pointing me in the right direction), but I've had no luck at all so far... I'll have to peek at your code to learn how to do this ! :)