Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Terrain for existing objects (Objects first, Terrain last)

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

  1. meikellp


    Apr 6, 2014
    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.

    • 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


    Sep 3, 2014
    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

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


    Apr 6, 2014
    @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.