Post

Nikita Lisitsa
Nikita Lisitsa@lisyarus·
So, on yesterday's stream I've implemented a different algorithm for generating the road network: flood-filling a voronoi map (accounting for terrain movement cost) and connecting two villages where their voronoi regions meet. (1/n) #indiedev #gamedev #indiegames
Nikita Lisitsa tweet media
English
3
1
39
1.8K
Nikita Lisitsa
Nikita Lisitsa@lisyarus·
This worked fine, but often it would generate weird roads because the place where two villages' regions meet isn't necessarily on the shortest path between them. (2/n)
English
1
0
5
764
Nikita Lisitsa
Nikita Lisitsa@lisyarus·
So, I switched to generating the actual shortest path between any two villages with neighbouring voronoi regions. It works better, but I felt like it produces way too many roads, especially way too many intersections. (3/n)
Nikita Lisitsa tweet media
English
1
0
4
927
Nikita Lisitsa
Nikita Lisitsa@lisyarus·
In the end I switched to a simpler idea: use the same Delaunay triangulation to determine which villages to connect, but then find the true shortest path between them for the actual road. This approach looked the most satisfying to me. (4/4)
Nikita Lisitsa tweet media
English
2
0
3
377
learntToCode
learntToCode@learntToCode·
@lisyarus You want to solve the Steiner tree problem to create your road network, it will give you exactly what you want.
English
0
0
0
9
Paylaş