City Defense

About › Map data and credits

Map data, 3D buildings and credits

The City Defense map comes from OpenStreetMap, the free map of the world drawn by volunteers. It reaches the game as vector tiles in the OpenMapTiles schema, served free of charge by OpenFreeMap, and the game builds its 3D buildings from the footprints and heights in them. Characters, towers and textures are public-domain (CC0) works by Quaternius, Kenney, Kay Lousberg (KayKit), ambientCG and Poly Haven. The game wouldn't exist without them.

Updated

City Defense is free to play in your browser – no download, no sign-up. First mission: Brno, náměstí Svobody.

Play free

Thank you

City Defense is a small game built on an enormous amount of other people's work. Every street the enemies walk and every house you put a tower on was drawn into OpenStreetMap by someone – usually in their spare time. The OpenMapTiles and OpenFreeMap teams turn that data into map tiles anyone can use, and OpenFreeMap hosts them for free. MapLibre and three.js are open-source libraries without which neither the map nor the 3D city would appear in a browser. And the authors of the models and textures gave their work to the world as public domain. A big thank you to all of them. If you enjoy the game, please consider supporting them too – the links are below.

OpenStreetMap: a map drawn by people

OpenStreetMap (OSM) is a free, editable map of the whole world built by volunteers. Steve Coast founded it in 2004, and today it has more than 10 million registered accounts. The data is available under the Open Database License (ODbL).

Map data © OpenStreetMap contributors, available under the ODbL.

OpenMapTiles: from OSM data to tiles

OpenMapTiles is an open vector tile schema for OSM data (layers such as building, transportation and landuse). It is maintained by MapTiler and the project's contributors; the code is BSD-3-Clause and the schema design CC-BY 4.0. Attribution: © OpenMapTiles.

OpenFreeMap: free map tiles

OpenFreeMap is run by Zsolt Ero. It serves map tiles and styles with no registration, no API keys and no limit on map views, including for commercial use. It is funded by donations – you can support it through GitHub Sponsors. The game uses its Liberty style (MIT; based on OSM Liberty by Maputnik and OSM Bright, design CC BY 4.0) in a modified form: recolored, with shop and restaurant icons hidden. The style's font is Noto Sans (SIL OFL 1.1), its icons are Maki (CC0), and zoomed-out terrain shading comes from Natural Earth (public domain).

How 3D buildings are made from the map

  1. The footprint comes from the building layer of the OpenMapTiles tiles – a polygon, possibly with a courtyard inside.
  2. The height is the render_height value: the building's height from OSM (height), otherwise the number of floors (building:levels) × 3.66 m, and 5 m if both are missing. The bottom edge, render_min_height, is computed the same way. The game deliberately doesn't fill in heights from national datasets – it has to work the same way in every country. Details and how to fix a height are in Building heights in OpenStreetMap.
  3. Stitching across tile edges: buildings cut at the edge of a tile are joined back into one.
  4. Extrusion to 3D: walls from the outline, flat roofs with a parapet, windows floor by floor (3 m), rooftop details. Only the play area plus 60 m is in 3D.
  5. Hit points and floors: the number of floors is the height divided by 3 m; hit points grow with volume (150 to 1,600).
  6. Collapse: a destroyed building leaves a jagged ruin and a rubble heap 8 to 18 m across that buries streets and changes enemy routes. Pieces of wall fly off as it falls.

How we handle the map data

The game reads streets, buildings and surfaces only from the tiles the map loads in your browser for display. From them it builds, in the browser's memory, the 3D buildings, a street graph for enemy routes, a height map and ground surfaces. This derived data is never stored or published anywhere. Missions remember only coordinates and rules, not map data. The method (algorithm) is described in How maps and missions are made and Technology.

Place search: Photon

Address search in the mission editor uses Photon, an open-source geocoder for OpenStreetMap data (Apache 2.0). The public server is run free of charge by komoot. The game only sends a query when you press Enter or the search button, to go easy on its capacity. Search results: data © OpenStreetMap contributors.

3D models and effects (CC0)

AuthorPacksIn the game
QuaterniusUltimate Monsters, Cyberpunk Game Kit, Animated Mech Pack, Zombie Apocalypse Kit, Toon Shooter Game Kit, Sci-Fi Modular Gun Pack, Animated Tanks Pack, Pirate Kitenemies and bosses in every theme, the Soldiers towers, weapons on the Robots towers
KenneyTower Defense Kit, Space Kit, Castle Kit, Graveyard Kit, Particle Packtowers, explosion, smoke and spark textures
Kay Lousberg (KayKit)Character Pack: Skeletonsskeletons (Skeletons and Zombies themes), weapons and shields

Many of the models were downloaded via Poly Pizza. Everything we use is CC0 1.0 (public domain). We modified the models (picking parts, compression, and for some of them added or retargeted animations). The authors don't require credit, but we are happy to give it: Quaternius and Kay Lousberg are on Patreon, and Kenney has a donation page.

City textures (CC0)

The photo textures of the realistic style (plaster, brick, facades, roofs, rubble, ground surfaces) come from ambientCG (Lennart Demes) and Poly Haven, where they were photographed and processed by Rob Tuytel, Amal Kumar, Charlotte Baglioni, Dimitrios Savva, Sơn Nguyễn, Dario Barresi and Rico Cilliers. All are CC0 1.0. Windows, rooftop details and debris are drawn by the game in code.

Libraries and tools

ProjectLicenseAuthors
MapLibre GL JSBSD-3-ClauseMapLibre contributors
three.jsMITthree.js authors (founded by Ricardo Cabello, mrdoob)
three.quarksMITForrest Sun
meshoptimizerMITArseny Kapoulkine
Basis UniversalApache 2.0Binomial LLC
KTX-SoftwareApache 2.0The Khronos Group and contributors
glTF TransformMITDon McCurdy and contributors
ViteMITVoidZero Inc. and Vite contributors
VitestMITVoidZero Inc. and Vitest contributors
TypeScriptApache 2.0Microsoft
Blender (only as a tool for editing animations)GPLBlender Foundation

Frequently asked questions

Why does the game show “© OpenStreetMap contributors”?

OpenStreetMap data is licensed under the ODbL, which requires crediting the source. It is also a thank-you to the people who build the map. The credit appears in the corner of the in-game map, on the link preview image and in the footer of every article.

Is a game allowed to use OpenStreetMap for free?

Yes. The ODbL lets anyone use the data freely, commercially too, as long as the source is credited and any derived databases that are published stay under the same license. City Defense doesn't publish derived data – it only builds it in the browser's memory.