[quote name='taz0010' timestamp='1310835544' post='4836042']
You could use a quadtree. It's a good structure for representing non-uniform density, which seems like it applies to your task.
When adding a new island, start from the top of the tree and choose random child nodes, splitting them as you go. Each node that splits should notify it's parent of the split, which in turn notifies the parent of that node, all the way up to the root. This information is useful when deciding where to add islands. It's easy to determine the density distibution of your world - If a node has children then there's at least one island in it's child nodes. So when adding new islands, you can favour branching into nodes that are not yet split, or have fewer (recursive) splits than others.
Hi there,
That's an interesting idea - presumably because we want to identify empty space you'd need to keep splitting a quad-tree node with an island on it until a certain minimum size threshold is reached?
The only thing which worries me slightly is rebuilding the quad-tree every time someone adds some new land!
Cheers, Paul.
[/quote]
For the same of simplicity I'd store each island at the maximum preset depth for the tree. And the size of the deepest node would correspond to the unit size, or minimum block of land a player can possess. So we're not talking about dynamically optimising for node distribution or anything like that. Nodes are always split into 4 equal parts. Most operations on this sort of structure are in O(log(n)) - adding a new node, determining if a neighbour is occupied (worst case log(n)), and deleting islands.