Streets at Runtime

Hi everyone,

I want to make RTS streets that you can place dynamically. I’m using splines for the path. If you want to see what I want to create you can take a look at Manor Lords (MANOR LORDS | Most Hardcore Realistic Medieval City Builder & Real Time Strategy Game EVER - YouTube).

Now my question is:

How do I build the streets along the spline?

I think there are 2 ways to create the streets:

  1. Create a SplineMeshComponent that has the street material and hitbox on it. I would prefer this solution, but my problem here is that the spline doesn’t match the height of the terrain.

    So what would be the solution for this?

  2. Just paint the terrain. But I don’t like this solution a lot. Because I think it is a problem paint a direction and I have to repaint, when I delete the streets and have to match the environment texture.

Hope to get some good ideas on that. Thanks in advance!

Solution for the first one will be to create spline on the terrain. Go to landscape mode and add a second layer for road spline and then add spline from landscape editor. In this way terrain will always match height of road.

Hi, as I said, I want to do it from code and not from editor.

Hi KanakemitHacke,

I’m trying to develop something rather similar.

Have you found a solution for the landscape to adapt in real time to the SplineMeshComponent (roads)?