amitp / mapgen2

Map generator for games. Generates island maps with a focus on mountains, rivers, coastlines.
http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/
Other
1.31k stars 212 forks source link

Noisy edge function doesn't handle all quadrilateral shape #9

Open nghiattran opened 5 years ago

nghiattran commented 5 years ago

I found buildNoisyEdges function couldn't handle this form of quadrilateral because intersections of 2 lines (edge.v0, edge.v1 and edge.d0, edge.d1) will lie outside of their quadrilateral and makes its noisy edge overlap neighboring edges.

u07_l2_t1_text_final_3_files_image001 1

I think this can be solved can restructure this shape into solvable one that you wrote on your blog.

For example: 20190201_212922

Where: A, B: Voronoi points. C, D: Delaunay points. H: intersection of AB and CD.

We can try to reform this ACBD into AC1BD1 before passing it into buildNoisyEdges function. C1 and D1 are intersections of a line that goes through B and AC / AD respectively.

amitp commented 5 years ago

Oh interesting. Are you seeing these kinds of quadrilaterals in this version of mapgen2? I think it is possible but I was hoping they would not actually happen.

(Note: I am not working on mapgen2 anymore; it was a project from 2010.)