Skip to content

Fresh start: the Earth as a self-drawn vector comic

· by nicroc

After the first attempt I rethought the map completely. The most important step was to stop filtering away at pixel images and to draw the world ourselves instead.

A region of the WebCiv world map

Back to square one

I did not rebuild the first approach, I set it aside: the map generator with its comic filter, the admin area, the game rounds. It has not been thrown away; it sits in the project as an archive, in case I ever want to look up how things once were.

The reason for the hard cut: the map is the most difficult part of the whole game. As long as it is not right, there is no point in building game rules on top of it. So from now on a simple order applied: the map first, then everything else.

Vectors instead of a giant image

Coastlines, lakes and rivers now come as vector data from Natural Earth, a freely available map dataset. Terrain and elevations still come from NASA data. A build step breaks all of that down into handy data packages, and a custom map renderer draws the comic map from them live in the browser, with wave rings along the coasts.

The difference from the first attempt: a photo turns blurry when you zoom in. A line that is only drawn in the browser stays sharp, no matter how close you get.

And the world is round: sail further and further west across the Pacific and you come out again in Asia. The map has no edge on the left or the right.

The field

Beneath the map lies the actual game board: a grid of 2,880 × 1,440 fields, each an eighth of a degree in size, around 14 kilometres at the equator. That is more than four million fields, just under a million of them playable land.

Every field knows what lies on it: water, ice, mountains, forest, desert or Mediterranean land, in each case according to what makes up the largest part of the field. On top of that comes an elevation profile: the mean, the lowest and the highest point. All of it together fits into 16 bytes per field. That keeps the server fast even when hundreds of players move at the same time.

In the normal game view a field is about 90 pixels wide. That is big enough to place a figure on it, and small enough to keep a few dozen fields in view.

What did not work

My first drawn comic trees and mountain symbols looked, frankly, dreadful. They were thrown out again. You now recognise forests and mountains by a lit terrain texture with cast shadows that shows real elevations. That feels far more alive than any symbol.

For a while there was a slider for this: how realistic should the terrain look, how comic-like? After some back and forth the slider has disappeared and the setting is fixed. Country borders and place names are switched off by default too. On this map it will later be the players who draw the borders.

By the way, you can already try the map yourself: in the map lab.

Logbook

There is not a single commit in these days. We tried out and discarded so much that intermediate states would not have been worth it. The whole fresh start is bundled in the big commit of 5 November, which you will find in the entry after next. The old state is kept as an archive under the name archiv/erster-ansatz.