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
  4. Dismiss Notice

Planetary Terrain: Quadtree Planets for Unity

Discussion in 'Assets and Asset Store' started by simitro, Nov 10, 2017.

  1. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Are you using continuous collision detection on your rigidbody?
     
  2. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    A suggestion for your next version, please remove the dependency on using the main camera. We should be allowed control over that. Your script fails hard if no camera is tagged as mainCamera.
     
  3. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Sure, that's easy to change.
     
    Innovine likes this.
  4. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    863
    Why are there only 8 different triangle configurations in BaseQuadMeshes (9 with no endge fans)? As I understand it should be 16. Or you are rotating quads with mirrored configurations?
     
  5. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    No rotating is done, there just aren't cases where quads need more than two fans, or two fans on opposing sides. This is since always two of the neighbors were part of the same parent quad, and therefore can't have a lower subdivision level.
     
  6. Susihiisi

    Susihiisi

    Joined:
    Jan 11, 2018
    Posts:
    32
    Can you give any suggestions on water shaders that works with the ocean? I have tried some, but I haven't found anything good. Or maybe I just didn't know how to configure them properly.
     
  7. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Sorry, haven't found anything outstanding myself yet. Only thing I can think of is Unity-Proland water, as that's also where the atmosphere shader is from. Most water shaders are designed for flat terrain unfortunately, your configuration is likely not the problem.
     
  8. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    403
    Try looking at up-coming Poseidon by EarthShaping.
     
  9. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    352
    Is there a reason why a planet would not generate sometimes? No errors thrown. (If I move the desert planet into another scene it does not generate) Can't find anything in the docs...

    Also instead of hiding the quads in the hierarchy wouldn't it be better/simpler to just allow to specify a parent for them?
     
  10. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Only reason I can think of for the planet not generating is the camera being in the wrong place. Try placing it at a distance of a bit more than the radius.

    Hierarchical quads would be nice, but they need to be independently moveable of one another, otherwise I can't do the positioning with doubles.
     
  11. Dolzen

    Dolzen

    Joined:
    Mar 26, 2014
    Posts:
    90
    Hey there! Are you planning to incorporate a new algorithm that takes advantage of marching cubes?
     
  12. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Not really, sorry. Would definitely be a candidate for a potential PT2 though. TheWolf on the discord implemented voxel planets (check #showcase), perhaps he could give you some tips!
     
  13. Dolzen

    Dolzen

    Joined:
    Mar 26, 2014
    Posts:
    90
    @simitro Thanks! I can't find the discord channel tho, where's the link? thanks.
     
  14. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
  15. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    Has anyone written a script for spawning individual ground objects? Like a single prefab somewhere on the surface, rather than the existing vegetation feature? I'm useless at code but would love this feature for my project.
     
  16. Tegleg

    Tegleg

    Joined:
    Jun 10, 2013
    Posts:
    79
    hi
    how do biomes work?
    any info how to set them up would be appreciated, thanks

    edit:
    after some testing and experiments i see the splat map separates biomes.
    however, after a quick glance at the code i see there is no way to assign different vegetation to different biomes, its either on or off for each.
    there is no way at the moment of having, for example, grasslands and a forest.

    is this something you are planning for future updates or do i need to code that myself?
     
    Last edited: Mar 25, 2020
  17. Tegleg

    Tegleg

    Joined:
    Jun 10, 2013
    Posts:
    79
    is this no longer being developed?

    anyway, heres a test mash of planetary terrain and ultimate survival
     
  18. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    It would be nice if generated quads were assigned the same layer as the object the Planet script is on, instead of assuming "Default"
     
  19. scradsleep

    scradsleep

    Joined:
    Nov 7, 2019
    Posts:
    21
    hello!! great asset love it been playing around with different noise and planets, heaps of fun!! was wondering if you can have multiple players? say one on the other side of the planet then the other is there a way to do this? also is there a way to make collisions more acurate? seems that if i have a cliff the collision slopes gradually up the cliff not being abrupt to said cliff? nothing but good words from me tho was just wondering if these things can be done or not?
     
  20. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Absolutely! You can place as many planets as you want in a scene, just copy existing ones or create new ones and move them wherever you want them to be. For accurate collisions: Go to Planetary Terrain/Scripts/Pools.cs and edit line 118 to

    rquad.AddComponent<MeshCollider>().convex = false;

    Will definitely add a toggle to do this in the next update, oversight on my part.
     
  21. scradsleep

    scradsleep

    Joined:
    Nov 7, 2019
    Posts:
    21
    sorry players not planets multiple players.
     
  22. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Sorry, my bad! If the max distance between your two players is under say 10000 units it is very easy, can be done with the normal tools. If however it is much larger you'll need to write some custom code to translate between the different origins that they'll inevitably have. If you wanna do that I can give you an outline, it's not super complex but also nowhere near plug and play.
     
    scradsleep likes this.
  23. scradsleep

    scradsleep

    Joined:
    Nov 7, 2019
    Posts:
    21
    ah awesome i couldn't find anything in documents speak with you on discord about it, things that i need to learn... these questions are good for your thread so others may have same questions, i had a few more questions on discord too... no big rush plenty of other work to do but when your free im gonna pick your brains about some stuff im aussie also so time difrence may be a complication to get around if your from the otherside of the planet
     
  24. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Has been included the TERRACE node?
     
  25. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Yeah, it has!
     
    angel_m likes this.
  26. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I understand that planets are only created at runtime and therefore does not exist in the editor so how can I precisely position buildings (enemy bases...etc.) and other large objects on the planet's surface in order to create the setting for my game?
     
  27. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Either you can just write a script (or use the attached one) that takes in an array of objects and use Planet.InstantiateOnPlanet(), either with latitude and longitude, or a 3d point on the unit sphere.
    Alternatively you can "place" the object where you want to have it in play mode, then copy over the objects coords and the planet's coords from play mode to edit mode.

    I know this is a bit tedious, but scenes as large as planets just break scene view, which is why there's not edit time placement. For many placing many objects you can use the foliage system, for placing a few fixed objects you can use one of the methods above.
     

    Attached Files:

  28. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    :( I don't think it is the easier method to create a game scene... and how do you know the exact 3d point or coordinates the object has to be placed by the script? It seems always is necessary the tedious play mode method to place accurately the objects.
    I agree with you about large planets-scenes but at least it would be possible to have the planet created in the editor in the case of small-medium sized planets? I mean planets as your desert planet demo or smaller.
     
    Last edited: Jul 20, 2020
  29. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    If using InstantiateOnPlanet or similar, do you have a suggestion for dealing with different ground heights due to the detail level changing?
     
  30. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    863
    What is radiusVisSphere that is using in LOD calculations? How did you come up with this formula?
     
  31. ByteCobra

    ByteCobra

    Joined:
    Jun 9, 2018
    Posts:
    40
    Is it possible to generate planets in the editor and not in play mode?
     
  32. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    It's the radius of the yellow sphere in this image :)
    3079ac3050d37171659bed14ba21b139d006494c1841.png
     
    Gekigengar likes this.
  33. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Not really, sorry. Just make sure the highest level of detail is active while you're close enough to see the object. Maybe flatten the ground at that place a bit if you can't do that.
     
  34. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Not really, as I've explained a couple times. Even tried implementing it a couple months ago, but editor view is way too broken and it ended up being too buggy to release. Sorry...
     
  35. scradsleep

    scradsleep

    Joined:
    Nov 7, 2019
    Posts:
    21

    sign up to the discord... we been doing some brainstorming on this type of thing and you might find some information relevant. there a few ways to get precise placement and ways to model onto terrain
     
  36. Wawwaa

    Wawwaa

    Joined:
    Sep 30, 2017
    Posts:
    164
    Hi. It seems save node in node editor does not calculate data comes from height map node. When i directly sace from that heightmap node the visual comes out blank. When i combine it with noise generators, only noise generator data is saved.

    Is there an easy fix for this? Which script should i look at?
     
  37. sxnorthrop

    sxnorthrop

    Joined:
    Sep 29, 2014
    Posts:
    43
    What's the discord? I figured out how to implement it in the editor.
     
  38. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    How do I destroy the planet in runtime, and re-create it, from a script?
     
  39. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    How about some tech support?
    Has this asset been abandoned? If so, it should be marked deprecated in the store.
     
    valentinwinkelmann likes this.
  40. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    CAn anyone tell me where I find the discord for this I've seen mentioned? Got a few questions!
     
  41. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Here you go: https://discord.gg/sK9pSH3!
     
  42. Hboybowen

    Hboybowen

    Joined:
    Oct 17, 2009
    Posts:
    31
    any advice on ai and using the navmesh