Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Terrain for existing objects (Objects first, Terrain last)

Discussion in 'World Building' started by meikellp, Dec 6, 2018.

  1. meikellp

    meikellp

    Joined:
    Apr 6, 2014
    Posts:
    2
    Hello Unity community,

    I'm currently working at a project in my company where we are required to build a terrain based on already existing objects / roads.
    We have a data file from which we create roads and this is heavily required by our customer, this cannot change. The import works fine. We have a working importer which creates meshes for us and look totally fine. These roads itself are fine but we need some terrain between / underneath them.

    The usual workflow of level / world designers is: Create a terrain and put some objects / roads on it.
    Our workflow: Create roads / objects and then create the terrain.

    So our requirements are like "put the terrain under the roads" not "put the roads on the terrain".

    Does anyone know a way we can "easily" archiev this?

    I first tried to create a heightmap image based on the roads heights and lows but it seams kind of complex if you go further down the line. Questions I have/had while implementing this are like:
    • What about tunnels
    • What about cliffs where two roads are distant 5m on the x-axis and 20m on the y-axis from each other?
    • How about random mountains / hills are they possible?
    • Can this be deterministic?
    I also tried to look at the diamond squad algorithm but I don't know (not even tried) whether this can help for "objects first" aproaches.

    Requirements
    • Mostly automatic (minor manual adjustments are fine)
    • Road first (due complex requirements)
    • Optimum: Importer creates the same terrain every time (not random)
    Tools available

    Please contribute any idea even if it's not a fully working one. I'm grateful for every helping idea.
     
  2. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,140
    Hi Mei
    I'm still using unity 5.6 (oldschool 32 user here) sonot sure what terrain advancements they have done in unity 18.But if I had this task I would export all the meshes to a 3d modeling software(I use blender ) create a rough mesh that connects all the parts that need connecting such as the edges of the road and the underbelly. You can then import this mesh as an obj file into unity and use the obj to terrain script https://lmhpoly.com/convert-mesh-to-unity-terrain/.

    Don't know if that helps .Good luck.
     
  3. meikellp

    meikellp

    Joined:
    Apr 6, 2014
    Posts:
    2
    @tawdry Thanks for your reply. I already thought about this process (going with a mesh and converting it as a terrain). This process I can fully automate so this would be a nice approach but it will some time (development and execution time). I maybe try to prototype something like that.