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?