Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Add road/paths on procedural terrain?

Discussion in 'World Building' started by blackaciddevil, Feb 16, 2019.

  1. blackaciddevil

    blackaciddevil

    Joined:
    Mar 6, 2016
    Posts:
    48
    I want to add roads to a procedurally generated terrain mesh. The roads will only be aligned on the x axis and maybe just a texture but I don't really know how to approach this, any ideas?
     
  2. Deleted User

    Deleted User

    Guest

    Hi there,

    Couple of questions:
    - 3d? 2d?
    - Are the roads created procedurally as well?
    - Infinite or finite terrain?
    - Could you perhaps create or find a simple image that displays what you wish to achieve?

    Sorry, but i find it to be very difficult to create an understanding of the exact problem based on your question.
     
  3. blackaciddevil

    blackaciddevil

    Joined:
    Mar 6, 2016
    Posts:
    48
    Hehe yeah it's easy for me, I got everything as clear as it gets. =) But I made a video recently that I hope will clear things or the image. It is 3D but you will only move in the x axis as in any platformer. The area closest to the camera will be kind of flat and will have some paths or roads occasionally. The terrain will be finite with procedurally created roads, but I'm thinking if it is easier to use some kind of splat map template, as the roads only will follow the x-axis.





    Kind of hard to see the terrain in the video, but I hope it helps in any way.
     
  4. Deleted User

    Deleted User

    Guest

    Looks great!
    And a splat map is probably possible, but might prove difficult to control. What you could concider is using the terrain's vertices to find the positions the road's vertices need to have, by simply adding some height to it (essentially pasting the road on top of the terrain). If you are using perlin noise for example you could use this information as well, and another alternative is to shoot rays down onto the terrain's collider for information you need to create a realistic road. As far as the road itself goes, perhaps this video can help. There are more (and shorter...) video's and guides out there, but personally i think this one helped me the most (even if you perhaps dont need the spline-based part). If you are also looking for a curving road on the background instead of roads where your character walks and are going to create the road system anyway (why not then right...?), i suggest the above, and using perlin noise to create a marble effect, then use this informormation to create winding roads. It might also pay off to browse the unity store, personally unaware if there are road assets present there. Just a couple of thoughts and ideas, if you have something more specific in mind that i havent covered, feel free to ask. If not:

    Good luck, and i wish you loads of fun with your project!

     
    Last edited by a moderator: Feb 17, 2019
  5. blackaciddevil

    blackaciddevil

    Joined:
    Mar 6, 2016
    Posts:
    48
    Thanks a lot!

    I will definitely take a look at the video. I'm planning to add some rivers and streams in the background as well, and I guess it could be done the same way.
     
    Deleted User likes this.