https://en.wikipedia.org/wiki/Voronoi_diagram
gonna try using these as the faction territory Polygons because I believe they are a better representation - essentially the cell represents the set of all points are closer to the point inside the cell than any other point 🙂, allowing for irregular territory
e.g. doughnut shaped.
But since its very mathy, it might take a while, but i think using a Delaunay triangulation trick I've made will speed it up a bit.
rn, it's using a convex hull and the gift wrapping algorithm, which is the biggest polygon that has its vertices using the points it encloses. Which is cheap but often very weird with factions that aren't roughly circle shaped.