Download

Need help making a road system for ai cars and pedestrians (like Cities Skylines)

Hello everyone,

i’ve just started working on a city building game like Cities Skylines, but i have no idea how i can make the road system.
I wanted to have cars following traffic rules like Cities Skylines and pedestrians walking on sidewalks, but i have no idea how i can make a road system for this.

Splines probably just won’t work, because you cant branch with them to create junctions. So i was thinking of a different idea:

What i thought of was making a new empty actor, and placing down vertices with edges between them. But how can you make vertices and edges in an actor?
With this idea you could have simple math determine what type of road there should be at a vertex.

1 edge connection to vertex: end of road / dead end.
2 edge connections to vertex: a point / node in a road.
3 edge connections to vertex: a T junction (3 road junction).
4 edge connections to vertex: a + junction (4 road junction).

Is using vertices and edges a good way of making roads?
And if so, how do you create vertices and edges inside of an actor?

Or should i be using a completely different approach?

You could try using this plugin from the marketplace, it costs a little but we’ve used it and it’s very good…

Procedural Road And Highway Tool With Simple Vehicle Traffic

But really i want to know how to make this myself and i want to know how something like Cities Skylines’ traffic works. I don’t really have the money for a plugin.

I’ve also found a good pdf (http://www.artifactgames.de/Resume/DA_JanKrassnigg.pdf) on how to approach this, but i don’t know how to recreate that in UE4.
How do you make something like this?

Bump… still don’t really know how to approach this…

I’ve been trying to figure this out myself. Going to read through that pdf you linked. I am having some success with Splines. If you wanna see what I’ve got, I have a YouTube Channel. Once I figure it all out, I’m planning to make a tutorial series.
https://www.youtube.com/channel/UCZT…-7wlzRiL69Mdzg