Doughnut-shaped universes

Originally published 2007 in Atomic: Maximum Power Computing
Last modified 03-Dec-2011.


A lot of serious science goes into determining the topology, or "shape", of the universe. But it often gets boiled down into newspaper-science factoids that tell you just enough to leave you dumber than you were when you started reading.

Oh, the universe is "saddle-shaped", is it? We're living on a giant Pringle, huh? What's that mean, then?

The journalist writing the piece has no more idea than you, so don't expect a comprehensible answer.

(Actually, current thinking is that the universe is pretty much "flat", with space behaving in huge scales in the same way as it behaves in the everyday world of car trips and tennis games. The saddle-shaped thing came from early findings from the Wilkinson Microwave Anisotropy Probe, which, I kid you not, suggested that the overall shape of the universe was a "Picard topology". I think it's a great shame that that didn't pan out.)

The notion that the whole fabric of space-time may, itself, be describable as having a shape, is initially rather confusing. Until you realise that practically every player of video games already has experience with funny-shaped universes, and even with exotic stuff like quantised space-time.

A quantum is the minimum possible unit of something (so, yes, using the phrase "a quantum leap" when you mean "a really big change" is exactly wrong). And both space and time, in most board games, are quantised - you generally have a flat and tightly bounded playfield with a quite small finite number of places in which pieces can be, and the minimum unit of time is the turn.

The actual real-world physical location of a chess piece can be anywhere you like on the board, and a turn can take a microsecond or ten years. But for gameplay purposes there are exactly 64 possible locations on the board, with no such thing as "in between" or "to the left a bit", or movement rates of some fraction of a square per turn, and all turns are precisely identical in duration and effect, and indivisible. So the movement quantum is the board-square, and the time quantum is the turn.

The most straightforward board layout for turn-based games is the square grid. But grids only work equitably if your game is very highly stylised - like chess, and just about any other "classic" board game you care to name - or if it prohibits anything from happening on diagonals.

If your pieces can move in any of the eight compass directions in one turn, diagonal moves on a square board all allow them to go root-two (1.414...) times as far as they can if they move north, south, east or west. That's fine for chess, but it breaks down horribly in "realistic" turn-based strategy games, because now you've arbitrarily decided that the direction in which somebody walks determines how far they can walk per turn.

That's why so many war and role-playing games, computer and tabletop, have hexagonal grids. Then you've only got six possible movement directions, but at least they're all the same distance per hex.

Questions about the shape of space start to come into focus when you look at common games, too.

A chessboard, or the "board" on which you play a real time strategy game, is a simple bounded shape. Units can't go past the edge. Things get slightly fuzzy in RTS games when people start sneaking high-flying aircraft around the edge of the map so you can't see them, but the basic idea remains.

But lots of games have wraparound, and that's your gateway into cosmological topology. Wraparound allows you to make a finite, but unbounded, playfield.

The simplest unbounded playfield design used in computer games is the cylinder. That's Pac-Man wraparound, where what goes off the left side of the screen comes back on the right, as if the two edges were connected together with the playfield bent around into a tube.

More common, though, is the torus, or doughnut. Toroidal wraparound is your basic "Spacewar" or "Asteroids" layout, with left connected to right and top connected to bottom. Topologically speaking, you're playing your game on the surface of a doughnut.

The advantage of toroidal "space" is that, from the point of view of the little dudes on the screen, it's still "flat". Geometry works normally on it. Squares still have 90-degree corners, and the angles of the corners of triangles still sum to 180 degrees. Nothing tricky has to be done in the programming, no internal doughnut-surface-model needs to be maintained - just transfer coordinates between the connected edges, and you're done.

This means you can map a toroidal playfield perfectly onto a flat display, and everything will work intuitively. It's a bit weird when you fly upward and to the right off the edge of the screen and briefly see your little ship appear in the top left corner before it shows up again at the bottom left, but it doesn't take long to get the hang of it.

Almost all humans, in contrast, live on the surface of a sphere.

A sphere's surface is not, geometrically speaking, flat. It's curved. Draw a little triangle on the surface of a sphere and its angles will very nearly sum to the 180 degrees you expect, but the further you extend the sides, the larger the sum will become. If the triangle covers a quarter of a hemisphere - go ahead and try it with a balloon and a marker, I'll wait - its angles will each be 90 degrees!

If nothing else, this sort of thing plays hob with navigation. Look how quickly you can get turned right around when you're just cruising around on Google Earth.

And this, in essence, is why it's geometrically impossible to properly map a sphere onto the flat square display devices we use for games, or indeed onto a paper map. That's why there are so many different kinds of world-map "projections" out there. Each projection has a different set of tricks and compromises for stretching, squishing or tearing the surface of the real planet to fit it onto a flat map, putting the worst of the distortion where it doesn't matter too much. Like the poles, or the middle of the ocean, or Adelaide.

All of this is a bit too much trouble to go to in a game, particularly when you realise that all it buys you is confusion when, for instance, a unit goes as far north as is possible and now faces a wide selection of possible "souths". So practically every game with a wraparound world just uses a good old doughnut.

It's perfectly possible to make a computer game in which the play-board is a sphere, rendered in 3D on your screen. See Spore, for instance, or Populous 3 for that matter - though I think both of those games might be cheating, and just rendering a toroidal-wraparound world in a sphere-looking way.

(A reader's now pointed me to this Siggraph presentation, in which a Spore developer talks about the challenges of apparently-spherical playfields in detail. It turns out that Spore's planets may be spheres, but the textures that cover them are warped cube maps. He also mentions Super Mario Galaxy, which is another very impressive-looking upcoming weird-topology game.)

You can even make a spherical game board in the real world, by using a globe as your play-surface and attaching pieces to it with magnets or something.

Any time you want to see the whole thing at once, though, you're back to some kind of projection. And one of the basic tradeoffs of sphere-to-flat projections is that you can have a good idea of what things really look like, or you can use your display space efficiently, but not both.

Plus, a genuinely spherical play area makes some other gaming things pretty darn tricky. Like pathfinding, for instance - the bane of the RTS player's life.

It's bad enough that some of your RTS units elect to go from England to France via Spain whenever the direct route is blocked by too many of their fellows. How would you like a spherical play field that gave them the further option of going via the USA?

All of this is why everybody very much prefers flat playfields, and flat bounded playfields for games with pathfinding units.

Anyway, thanks to computer games, lots of ordinary people already understand the basic concepts of cosmological topology. Questions about the shape of this universe or any other hypothetical one are actually questions about its flatness, finiteness and boundedness.

It's perfectly possible for space to be unbounded but not infinite, if we have a "closed" universe that wraps around in one way or another. And it's also perfectly possible for space to not be flat, so that the simple Euclidian geometry that works fine for us on the small scale of our everyday lives - drawing small triangles on the balloon - comes apart when we start measuring in light-years.

So the next time you read some muddled article about how the universe is shaped like a tuba or something, you can explain it to anyone who asks in terms of Command and Conquer, Asteroids, and the Mercator Projection.


At least you'll know what you mean.

Other columns

Learning to love depreciation

Overclockers: Get in early!

Stuff I Hate

Why Macs annoy me

USB: It's worth what you pay

"Great product! Doesn't work!"

The virus I want to see

Lies, damned lies and marketing

Unconventional wisdom

How not to e-mail me

Dan's Quick Guide to Memory Effect, You Idiots

Your computer is not alive

What's the point of robot pets?

Learning from spam

Why it doesn't matter whether censorware works

The price of power

The CPU Cooler Snap Judgement Guide

Avoiding electrocution

Video memory mysteries

New ways to be wrong

Clearing the VR hurdles

Not So Super

Do you have a license for that Athlon?

Cool bananas

Getting rid of the disks

LCDs, CRTs, and geese

Filling up the laptop

IMAX computing

Digital couch potatoes, arise!

Invisible miracles

Those darn wires

Wossit cost, then?

PFC decoded

Cheap high-res TV: Forget it.


Dan Squints At The Future, Again

The programmable matter revolution

Sounding better

Reality Plus™!

I want my Tidy-Bot!

Less go, more show

In search of stupidity

It's SnitchCam time!

Power struggle

Speakers versus headphones

Getting paid to play

Hurdles on the upgrade path

Hatin' on lithium ion

Wanted: Cheap giant bit barrel

The screen you'll be using tomorrow

Cool gadget. Ten bucks.

Open Sesame!

Absolutely accurate predictions

The truth about everything

Burr walnut computing

Nothing new behind the lens

Do it yourself. Almost.

The quest for physicality

Tool time

Pretty PCs - the quest continues

The USB drive time bomb

Closer to quietness

Stuff You Should Want

The modular car

Dumb smart houses

Enough already with the megapixels

Inching toward the NAS of our dreams

Older than dirt

The Synthetics are coming


Game Over is nigh

The Embarrassingly Easy Case Mod

Dumb then, smart now

Fuel cells - are we there yet?

A PC full of magnets

Knowledge is weakness

One Laptop Per Me

The Land of Wind, Ghosts and Minimised Windows

Things that change, things that don't

Water power

Great interface disasters

Doughnut-shaped universes

Grease and hard drive change

Save me!

Impossible antenna, only $50!

I'm ready for my upgrade

The Great Apathetic Revolution

Protect the Wi-Fi wilderness!

Wi-Fi pirate radio

The benign botnet

Meet the new DRM, same as the old DRM

Your laptop is lying to you

Welcome to super-surveillance

Lemon-fresh power supplies


Internet washing machines, and magic rip-off boxes

GPGPU and the Law of New Features

Are you going to believe me, or your lying eyes?

We're all prisoners of game theory

I think I'm turning cyborg-ese, I really think so

Half an ounce of electrons

Next stop, clay tablets

A bold new computer metaphor

Won't someone PLEASE think of the hard drives?!

Alternate history

From aerial torpedoes to RoboCars

How fast is a hard drive? How long is a piece of string?

"In tonight's episode of Fallout 4..."

How hot is too hot?

Nerd Skill Number One

What'll be free next?

Out: Hot rods. In: Robots.

500 gig per second, if we don't get a flat

No spaceship? No sale.

The shifting goalposts of AI

Steal This Education

Next stop: Hardware piracy

A hundred years of EULAs

The triumph of niceness

The daily grind

Speed kings


Game crazy

Five trillion bits flying in loose formation

Cannibalise the corpses!

One-note NPCs

Big Brother is watching you play

Have you wasted enough time today?

The newt hits! You die...

Stuck in the foothills

A modest censorship proposal

In Praise of the Fisheye


The death of the manual

Of magic lanterns, and MMORPGs

When you have eliminated the impossible...

Welcome to dream-land

Welcome to my museum

Stomp, don't sprint!

Grinding myself down

Pathfinding to everywhere

A deadly mouse trap

If it looks random, it probably isn't

Identical voices and phantom swords


Socialised entertainment

Warfare. Aliens. Car crashes. ENTERTAINMENT!

On the h4xx0ring of p4sswordZ

Seeing past the normal

Science versus SoftRAM

Righteous bits

Random... ish... numbers

I get letters

Money for nothing

Of course you'd download a car. Or a gun!

A comforting lie

Give Dan some money!
(and no-one gets hurt)