The military component of the game will include naval forces, so nations will be able to maintain a fleet of warships and deploy them on the international theater. In order to model the physical location of these fleets, the game’s maps will include sea zones. This post describes what these sea zones will look like and how they’re createdby the map generator.
A good Navy is not a provocation to war. It is the surest guaranty of peace.Theodore Roosevelt
Initially, I just tried to use the same algorithm as the land territories used, tough perhaps with larger cells. It turns out this looks very unattractive, because land borders look noisy and organic and that just doesn’t make sense for sea zones that should stretch for hundreds of kilometers without being constrained by mountains, rivers or the whims of history.
So for inspiration I looked at board games with a global war theme, such as Axis & Allies, and noticed they have sea zones with simple shapes and straight lines.
Creating that “boxy” look is not easy, and in fact not even desirable, because we’re working with coordinates on a spherical globe. A flat projection like that means you stretch at the poles, and sea zones at the edges (the international date line, so to speak) should touch or overlap. This means it really doesn’t make sense to strive for zones that have right angles throughout.
So I went for a much simpler approach, using the tools already available to me: the spherical Voronoi mesh.
This geometric subdivision of a sphere is ideal because it employs straight lines (geodesics, actually), generates cells which are approximately the same size, and still has a random look to it. Contrary to the land territory algorithm, which uses 500,000 cells, the naval zones use just 300.
The next step is to subtract the geometry of the land territories from the sea zone cells (using the amazing Java Topology Suite library). This will in many cases result in the splitting or even complete removal of a sea zone. This also tends to leave tiny sea zones here and there, so an extra pass merges zones that are too small with one of their larger neighbors. The result is a simple, fast algorithm that creates attractive sea zones for the game’s navies!
Here’s an example of a small sea zone which has been merged with a larger adjacent zone. The bay at the tip of the continent is part of the larger sea zone which also includes the archipelago. The tiny lakes you see on the map will also be distinct sea zones, but of course it doesn’t make much sense to maintain a navy there.