2

I'm working on creating a procedurally generated fantasy-style map using the cells of a Voronoi diagram to determine terrain.

During the tectonic plate generation I realized that it's really important to have wrapping edges during generation to prevent plates from spreading against the edges of the map. On subsequent seeds, without border wrapping, the logic of the map goes out the window.

Tectonic Plates: No wrapping, plate borders indicated by black dots...

Part of determining the plates is identifying 70% of the world's area as "oceanic" and the other 30% as "continental".

Basically:
The borders of the map don't have to wrap as long as they can be thematically incorporated.

I've thought about adding predefined uniform points all around the edge and forcibly linking them to each other, but there has to be a better way. I've stripped out the border points because they don't link up well with their neighbors in the library I'm using.

Library I'm using

My code repository Specifically, the makePoints() function @line 236

I'm using Poisson Disk Sampling to generate the points. I'm programming in AS3 but I'm fine with answers in any programming language or pseudo code.

Question:
How do I wrap the Voronoi diagram so the cells at the bottom refer to the cells on the top and the cells on the left refer to the cells on the right (and vice versa)?

Edit: The desired result would be an image similar to this one of the real world's tectonic plates. See how the plates lap over the sides of the map? That's what I'm going for, though only East/West.

Real World Tectonic Plates

Olin Kirkland
  • 548
  • 4
  • 23
  • **(1)** Show an image of expected result. Either simulate it or find closest similar image that illustrates your desired result. **(2)** Not many will read [295 lines of code](https://github.com/olinkirkland/Worlds/blob/master/src/Map.as) for you. Tell us **which function** needs checking / editing to get your solution. – VC.One Dec 10 '19 at 13:31
  • @VC.One Alright, I've made the QoL edits – Olin Kirkland Dec 11 '19 at 12:16

1 Answers1

0

To solve the problem of wrapping (I decided to only to wrap the left/right sides) I ended up doing the following:

I started by only filling (using poisson disk sampling) a narrow strip of points on the left side. Then I copied this strip to right outside the far-right bounds of the map. Then I filled the resulting empty rectangle between the two strips.

After that it was just a matter of making sure the far right bounds are linked to the points on the far left.

Olin Kirkland
  • 548
  • 4
  • 23