About › Building heights in OpenStreetMap
Building heights in OpenStreetMap: why a building is too low in the game and how to fix it
Yes, OpenStreetMap has building heights – but only for some buildings. Height is recorded with the height tag (in meters) or building:levels (the number of above-ground floors). OpenMapTiles map tiles turn these into render_height: the height, otherwise floors × 3.66 m, otherwise 5 m. City Defense uses that value as it is, so a building without data is 5 m tall in the game. Anyone can fix that directly in OpenStreetMap.
City Defense is free to play in your browser – no download, no sign-up. First mission: Brno, náměstí Svobody.
Play freeHow OpenStreetMap records a building's height
| Tag | What it means | Example |
|---|---|---|
height | height from the lowest point at ground level to the top of the building, roof included (antennas and masts excluded), in meters | height=18 |
building:levels | number of above-ground levels in the facade – excluding roof levels and underground levels; whole numbers only | building:levels=5 |
roof:levels | levels inside the roof (attic floors) | roof:levels=1 |
min_height, building:min_level | where a part of a building starts if it doesn't stand on the ground (an overhang, a bridge between wings) | min_height=4 |
The definitions follow the OpenStreetMap wiki (Key:height, Key:building:levels). Buildings made of parts with different heights are mapped as building:part, each part with its own height.
How that becomes the height in the game
OpenMapTiles vector tiles carry a render_height value for every building. It is computed like this:
- if the building has
height, that is used (rounded up to whole meters); - otherwise
building:levels× 3.66 m; - if both are missing, the building is 5 m tall.
The bottom edge, render_min_height, is derived the same way from min_height or building:min_level. City Defense uses these values as they are and doesn't fill gaps from other sources – not even national cadastres. The game should work the same way in every country, and a single source of heights guarantees that.
What a building's height affects in the game
- Tower range: every meter of roof height adds 1.5 m of range to the machine gun, 2.5 m to the laser, 1 m to the grenade launcher and 2 m to the mortar and howitzer.
- Line of sight: machine guns and lasers can't see over taller buildings. A tall building in the way also stops a ballistic shell.
- Toughness: the number of floors is the height divided by 3 m, and a building's hit points grow with its volume.
- Rubble: the taller the building, the more street it buries when it collapses (8 to 18 m around it).
So a building without height data becomes a low, 5-meter, two-story house in the game, however tall it really is: a tower on it has short range, the building has few hit points and leaves little rubble.
How to fix a height in OpenStreetMap
- Create an account at openstreetmap.org.
- Find the building, zoom in and click “Edit” – the iD editor opens.
- Select the building and add
building:levels(count the above-ground floors from the street), androof:levelsif there are attic floors. Only enter an exactheightif you really know it. - Save the change with a short comment, such as “added number of levels from local knowledge”.
Only add what you know. OpenStreetMap relies on local knowledge and permitted sources – copying from Google Maps or other licensed maps is not allowed. Millions of people use the map, so accuracy matters more than speed.
You'll see the change on openstreetmap.org right away. It reaches the OpenFreeMap map tiles – and with them City Defense – with their next update.
Frequently asked questions
Does OpenStreetMap have building heights?
Yes, but not for every building. Height is stored in the height tag or derived from the number of floors, building:levels. Where both are missing, OpenMapTiles map tiles assume 5 m.
Should I add height or building:levels?
You can count floors reliably from the street, so building:levels is usually the better choice. Only enter an exact height if you really know it.
When will my fix show up in the game?
On openstreetmap.org, immediately. It reaches the game once OpenFreeMap publishes new tiles – the game always uses its current tiles and stores nothing.