3DTD

Tower defense on your actual street

You type in an address, the game loads the photorealistic 3D tiles for that place, and enemies walk up the real roads towards your base.

The desktop app is the way to play: co-op lives there, everyone runs the same engine, and it keeps itself up to date. The browser version is for a quick look, solo.

Desktop onlyThis does not run on a phone. It streams photorealistic 3D tiles and puts thousands of enemies on screen, so it wants a fast CPU, a real GPU, a mouse and a keyboard. Open the page on a desktop and the downloads are there.

Before you can play you need your own Cesium ion token. It is free and takes two minutes, no card. How to get one. Made for desktop: it needs a fast CPU, a GPU and a mouse.

Work in progressUnfinished and unbalanced. Late waves get out of hand, some streets confuse the routing, and there are bugs I know about and more that I don't. It also wants a beefy machine: thousands of enemies on top of a live tile stream, and a slow CPU or a thin GPU turns the late waves into a slideshow. It's an evening project, not a release.

How it works

Towers, upgrades, research, a base to hold. Standard tower defense so far.

Nobody built the map. It is streamed from Google's Photorealistic 3D Tiles for whatever address you type in, and three things read that geometry straight off: where the enemies walk, what a tower can see, and where you are allowed to build.

Debug view over Berlin: the OpenStreetMap street network in thin yellow, the ground route in red, the air route in magenta

Routes follow real streets

The street graph comes from OpenStreetMap, the thin yellow lines in the picture. The cyan patches are building footprints from the same source. Ground enemies take the red route along those streets, flyers the magenta one straight across. Every waypoint of the ground route is raycast down onto the tile surface for its height, so it follows the actual terrain.

Visibility grid around a tower, green where it can see, red where a building blocks it, with the depth cubemap it was read from

Buildings block line of sight

A tower only fires at what it can see. The surrounding tiles are rendered into a cubemap when the tower is placed, and again when its range grows; the depth is read back, and the result is kept as a visibility mask over the tower's range. Green cells are covered, red ones are blocked by a building.

Placing a tower on a rooftop

Placement probes the ground

Towers are set by raycasting against the tiles, not against a flat plane. Rooftops, embankments and bridges sit at their real height, which is why the same layout plays differently two streets over.

Debug session over a residential street, with the line of sight cubemap, the frame budget and the wave spawner open beside the game

Forty seconds of unedited play in a residential street, debug windows open: the line of sight cubemap on the left, the frame budget beside it, the wave spawner below.

Co-op

Two to four players defend one base in the same city. Each of you gets a road of your own: the enemies on your lane are yours to stop, you spend your own gold, and you may build anywhere, your partner's street included.

Co-op is in the desktop app, online through the public lobby or on your local network, where the host's app runs the relay itself. Every machine runs the whole game in lockstep; only the moves travel, plus the host's map and lines of sight.

Co-op best-of on YouTube: two players holding Heilbronn's market square

Our first co-op match, Heilbronn, waves 1 to 38, narrated. Fifteen minutes on YouTube.

Places

Anywhere Google has photorealistic 3D coverage works, most large cities and a good many smaller ones. How well it plays depends on where you point it. Some places load beautifully, others have tile geometry that makes the routing do slightly silly things.

Manhattan, a column of enemies coming down Madison Street
Manhattan down Madison Street
Hong Kong, the base on Victoria Park Road between the tower blocks, with the harbour front on the right
Hong Kong Victoria Park Road
Manhattan, flying enemies crossing the rooftops
Manhattan flyers over the roofs
Tokyo, the skyline at dusk with the wave marker over the district
Tokyo dusk over Minato
A German wine village, a column of enemies winding up the field track through the vineyards towards the base
German vineyards up the track between the vines
Manhattan, wave 52 on Broadway, a swarm of several thousand crossing the street
Manhattan wave 52, a swarm crossing Broadway
Paris, a column crossing the Quai Branly below the Eiffel Tower into the towers' fire
Paris under the Eiffel Tower
Manhattan, top-down view over the interchange
Manhattan over the interchange
Manhattan, enemies filling an avenue between the blocks
Manhattan the avenue as a funnel

Click any shot for the full frame.

Videos

Get a Cesium ion token

The 3D tiles are billed per request, so there is no shared key. You play on your own Cesium ion token; the free tier is enough.

  1. 1Sign up at ion.cesium.com. Free, no card.
  2. 2Copy your default token under Access Tokens.
  3. 3Paste it into the game when it asks. Once per browser or app.

The token stays on your machine and is sent only to Cesium. It never reaches this site. A Google Maps API key works too.

The stack

Tiles
3DTilesRendererJS over Google Photorealistic 3D Tiles
Rendering
Three.js, custom shaders, post processing
Interface
Angular, standalone components, signal stores
Line of sight
depth cubemap per tower, read back as a visibility mask
Pathfinding
A* over the OpenStreetMap street graph, then a 2 m cell grid along the route
Map data
OpenStreetMap streets and building footprints, Nominatim lookup
Enemies
instanced meshes, skeletal animation baked into vertex textures
Waves
rule based director in the browser, sized by what your towers can kill
Co-op
lockstep over a small Node relay that passes the moves and checks everyone stays in step, online or on the LAN
Desktop
Electron app for Windows and Linux, updates itself
Server
none for the game itself, the client is the whole game
Licence
AGPL-3.0, source on GitHub