## Around The World, Part 16: A matter of scale

All else being equal, I prefer games (and books, and movies) to be realistic, rather than making things up on the spot. But of course, all else is rarely equal. Today, I’ll be taking away some of the realism of my procedural world generator to accommodate gameplay.

## The trouble

Earth is big. You just won’t believe how vastly, hugely, mind-bogglingly big it is. I mean, you may think it’s a long way down the road to the chemist’s, but that’s just peanuts to Earth.

Planet Earth has a radius of 6371 km, a circumference of about 40,000 km. (That’s no coincidence: the metre was originally defined as 1/10,000,000th of the distance from the pole to the equator over Paris.) The first expedition to sail around the world was Magellan’s, and took this route:

Source: Wikimedia Commons by Sémhur and Uxbona, CC-BY-SA 3.0

A 15th-century carrack like the ones Magellan used would be about 25 metres long and 25 metres tall:

Replica of the carrack (nao) Victoria, the first ship ever to circumnavigate the world. Source: Wikimedia Commons by Gnsin, CC-BY-SA 3.0

At sea, standing in the crow’s nest of such a ship on a clear day, the horizon would be about 20 km away. But interesting things like ships and islands are tall, and you’d be able to see them beyond the horizon as well, so let’s say your maximum view distance is 50 km. Those are the numbers I originally plugged into the game.

However, remember that I chose to show the world from a top-down, bird’s eye perspective. When fully zoomed out, at a common resolution of 1920×1080, one pixel on the screen would be about 50 metres in the world. The ship would just be half a pixel! You’d need to zoom in by a fair amount until you can even see that it’s actually a ship.

It gets worse.

Magellan’s fleet took about three years to circumnavigate the world, averaging less than 2.5 km/h. I’m aiming for a single run of the game to take about three hours instead, so I’m compressing time by a factor of 10,000 (8,760 for the pedants, but this isn’t an exact science). To accomplish that, the player’s ship would need to move at a speed of 25,000 km/h — that’s 20 times the speed of sound, and well on its way to escape velocity towards outer space. In a single second, you’d be traversing 7 km. For a half-pixel ship, that would certainly look like ludicrous speed. I’m not trying to build Kerbal Sea Program here!

## The solution

I’m going to have to shrink the world. A lot. After some tinkering with a spreadsheet highly advanced game design tool, I figured I’d make the world scale 1:100. A 400 km circumference might sound small, but it’s still much bigger than most open-world games, so there’s plenty of space for adventure. This takes care of a factor of 100 out of that 10,000. (Somebody on Mastodon suggested I should just scale up the models instead, but it amounts to the same thing. Keeping the models scaled 1:1 makes authoring easier.)

I also decided to significantly speed up the ship. Magellan’s fleet may have averaged 2.5 km/h, but under optimal conditions, they would have been doing about 7 knots, or 13 km/h. That means the 25 m ship would travel its own length in 7 seconds. I tried this in the game, and it feels really, painfully slow. Instead, I ended up with a ship that can do 90 km/h, which is pretty ludicrous for a sailing vessel, but feels right in the game. This takes care of another factor of 7 out of that 10,000.

That leaves a factor of about 15 still to be dealt with. For that, I’ve just added some buttons to speed up time. These will be necessary anyway: carefully navigating along a coast calls for a slower rate than crossing an ocean. At a 25× speedup, movement looks obviously fast, but not ludicrous.

At a world scale of 1:100, a view range of 50 km would allow you to see all the way across the Atlantic ocean. Clearly that would take the fun out of discovery, and would make maps pointless. So I reduced the view range to 1 km; not scaled all the way down, but enough to make it feel constraining.

## Scaling the heights

But now, major terrain features like mountains are much too small. An 8 km tall mountain like Mount Everest would stand only 80 m tall, which would be only a minor hill compared to the 25 m tall ship.

So we’ll have to scale up those “minor” topography features, keeping them closer to their real-life size, while retaining the “major” features like continents at 1:100 scale. Fortunately, I had seen this coming and kept all the scaling factors in the procedural generation easily configurable.

Without further comment, here are some pictures of the state after about a day of tinkering:

The new world scale has some advantages. Remember that the global world map is generated on a 6×512×512 quad sphere. A single grid cell used to be about 20 km in size, so any small-scale features like rivers and barrier islands could not be generated at this level, and would have to be produced with more limited “local” functions like simplex noise. After downscaling, a grid cell is only 200 m (1/10th of the player’s view circle), so adding such features at the global level becomes feasible. I’ll have to see how much time I want to spend on that.

Another advantage is that I no longer need double-precision floating point maths. A single-precision float has a precision of 3.8 mm at the surface of our 1:100 world, which turns out to be sufficient.