I generate island/continent maps and I want to make a grand archipelago of sorts where all these islands are located. The problem is that I don't know a smart way to place the islands programmatically so that the keep a minimum distance from each other. Sure, I can create a quadtree but then how do I place it? Placing it on top of another island and move it away in a random direction? I'm attaching a photo of what I want to do, easily done in Paint .NET from 6 individual maps.

The scale I'm talking about would be placing about 3-10 continents, each with a resolution of 4Kx4K upwards. (I'll only allow reflections and translations in placement, to preserve some 4-/8- connectivity pixel work that I've done for the maps)

What I'm NOT looking for:
- a global minimum solution ( all islands as close together as possible)
- using a heavyweight physics/maths library or tons of code
- a super-simplistic solution either (e.g. calculate OBBs and use those to resolve collisions)


  • \$\begingroup\$ Do you want the islands to fit in the bays/inlets (like the top and middle island in your sample)? Or could the treated as convex hulls for placement purposes? \$\endgroup\$ – Kelly Thomas Apr 9 '15 at 16:44
  • \$\begingroup\$ I want them to fit, otherwise it's super-easy :) \$\endgroup\$ – Babis Apr 9 '15 at 16:56
  • \$\begingroup\$ Some solutions can be applied more easily if your framework can do some heavy lifting. What tools are you using? \$\endgroup\$ – Kelly Thomas Apr 9 '15 at 16:57
  • \$\begingroup\$ I'm just using C++ - what did you have in mind? \$\endgroup\$ – Babis Apr 9 '15 at 17:00

I think you are going at the problem the wrong way. Why are you first building an island and then "place" it? I would use one algorithm to create the entire map in one go. Although the algorithm would need some tweaking, but I would some form of noise as the basis. From that I use a "water level" to defined how much and how large the land actually is. This naturally makes islands that are close to each other. To ensure that the entire map is surrounded by water increase the water level towards the edges.

| improve this answer | |
  • \$\begingroup\$ I like my island/continent shapes after quite a bit of playing around with noise - I don't want to change that process! \$\endgroup\$ – Babis Apr 9 '15 at 13:52

Another way of doing it is create one island then introduce series of water splices... as a water is occupied on one side add land on another side.

Terrain can be done later if you lock the boundaries of land and water as soon as you're satisfied.

You can set a logic where percentage of number of island has to move greater distance than others without changing shape much like how natural continental drifts do it. There is a mathematical equation somewhere at net to compute the center of mass. Sadly it's not one of my stronger points. Using the center of islands you can tear them apart or move them closer.

Suggest to also introduce small island by taking pieces from big ones that can form as lakes.

Moving islands while detecting with collision. One style is make two maps. One, where islands are fix, and another where island can be moved on map. Island collision is detected when land mass overlap between two maps.

if Map1(x,y) = Map2(x,y) 
where both have value of 1 or land mass (0 for sea)

You can make correction by changing shape of the island in collision by moving it on a different end or follow the coastal of another island on the fixed map. Or if you so chooses re-making the island in respect to the first map.

| improve this answer | |
  • \$\begingroup\$ tearing the island apart would mess with the shape, so it would again be complicated to do and get nice results..Continental drift/center of mass is too much; I just want a simple solution to move things close together from an initial random placement. \$\endgroup\$ – Babis Apr 9 '15 at 14:10
  • \$\begingroup\$ So basicly the logic you need is to know the center position of your island then move them away without bumping? \$\endgroup\$ – Ace Caserya Apr 9 '15 at 14:14
  • \$\begingroup\$ yes pretty much, taking into account that the silhouettes can be very detailed. \$\endgroup\$ – Babis Apr 9 '15 at 14:16
  • \$\begingroup\$ You may need to resort to bumping then eliminate the collision by putting the land somewhere else. \$\endgroup\$ – Ace Caserya Apr 9 '15 at 14:26

You need transitional states and movement to detect what point to compare distance to.

Set each point at original divide where split occurs, to a twin point at where it originally cracked apart, then always move the island based on closest twin pair.

That might work, if you keep points that must match a distance condition that are corresponding points across the ocean.

So if you set correlating points, then move those points away from each other the same number of distance, or slope of distance, they should float outward.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.