# Berlin Drive — research and implementation notes

This app separates **mapped observations**, **inferred geometry**, and **simulated practice exercises**. It is not a survey of current street controls, a navigation product, certified instruction or a German driving test.

## Primary road-rule research

Official consolidated legislation: [Straßenverkehrs-Ordnung (StVO)](https://www.gesetze-im-internet.de/stvo_2013/). The following are implementation interpretations, not legal advice. Practice points are our rubric, **not** statutory fines or Flensburg points.

| Topic                        | Primary reference                                                                                                                                                                                   | What the simulation observes                                                       | Important boundary                                                                       |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Care, collisions             | [§1](https://www.gesetze-im-internet.de/stvo_2013/__1.html)                                                                                                                                         | Moving-player contacts, speed loss, recovery advice                                | No legal fault determination; simplified rigid-body contacts                             |
| Keeping right                | [§2](https://www.gesetze-im-internet.de/stvo_2013/__2.html)                                                                                                                                         | Right-hand lane geometry and conflicting opposing-lane occupancy                   | Not every legitimate passing manoeuvre is an offence                                     |
| Speed                        | [§3](https://www.gesetze-im-internet.de/stvo_2013/__3.html)                                                                                                                                         | Available OSM limits, urban fallback, temporary practice limits                    | A maximum is not a target; conditions may demand slower driving                          |
| Following                    | [§4](https://www.gesetze-im-internet.de/stvo_2013/__4.html)                                                                                                                                         | Sustained short bumper time-gap                                                    | The 0.8 s / 2 s detector is an exercise threshold, not the law’s universal safe distance |
| Obstacles                    | [§6](https://www.gesetze-im-internet.de/stvo_2013/__6.html)                                                                                                                                         | Temporary narrowing and opposing traffic                                           | Generated layout, not a reported traffic-management drawing                              |
| Priority                     | [§8](https://www.gesetze-im-internet.de/stvo_2013/__8.html)                                                                                                                                         | STOP/give-way exercises and modeled right-before-left junctions                    | Actual signs override the unsigned-junction assumption; coverage is incomplete           |
| Turning, indicating, reverse | [§9](https://www.gesetze-im-internet.de/stvo_2013/__9.html)                                                                                                                                         | Turn indication and conflicting oncoming traffic during a green left turn          | No cyclist, tram, mirror-check or full turning-path assessment                           |
| Pedestrian crossings         | [§26](https://www.gesetze-im-internet.de/stvo_2013/__26.html)                                                                                                                                       | Waiting/walking intent and front-bumper entry into a practice zebra crossing       | Pedestrians are generated agents; not a live pedestrian feed                             |
| Traffic lights               | [§37](https://www.gesetze-im-internet.de/stvo_2013/__37.html)                                                                                                                                       | Green–amber–red–red+amber sequence; front-bumper crossing at an interpolated phase | Red+amber is still stop. Signalled permission does not remove turning duties             |
| Signs and markings           | [§39](https://www.gesetze-im-internet.de/stvo_2013/__39.html), [§41](https://www.gesetze-im-internet.de/stvo_2013/__41.html), [Annex 2](https://www.gesetze-im-internet.de/stvo_2013/anlage_2.html) | Speed, STOP, give-way and one-way/no-entry information                             | Rendered pole positions are not surveyed installations                                   |
| Work-zone equipment          | [§43](https://www.gesetze-im-internet.de/stvo_2013/__43.html), [Annex 4](https://www.gesetze-im-internet.de/stvo_2013/anlage_4.html)                                                                | Red-white barriers, cones, closed-area contact                                     | Simulation geometry and practice deductions, not an official closure plan                |

### Decisions that matter

- **No automatic right turn on red.** The real StVO includes conditional Grünpfeil exceptions. No such exception is modeled here; do not infer one from a generic green phase or a road’s geometry.
- **Green does not grant every turning vehicle priority.** The traffic model checks conflicts; the assessment also watches actual left-turn motion, rather than relying only on whether the driver used an indicator.
- **STOP means a complete stop, then give way.** No invented mandatory three-second duration. The model requires near-zero speed within three meters before its line; this is a sensor region, not a legal permission to choose any stopping location.
- **Amber is not a command to accelerate.** The game records whether its reaction-distance plus braking-distance model allowed stopping when amber appeared. Its 0.75 s reaction estimate and 5 m/s² braking assumption are not official requirements.
- **No per-frame penalty avalanche.** Sustained behaviours use episode detection; red/STOP/crossing violations use gate history. Recovery and large discontinuities resynchronise observations instead of inventing crossings.
- **Not every restriction is interpreted.** Conditional restrictions, complex via-way relations, time-specific access, lane arrows and some special German sign combinations remain out of scope. Destination/delivery/permit access is conservatively excluded from this through-driving exercise.
- **Walking pace is not universally “7 km/h” in law.** Seven is an explicit simulator convention for walking-speed/living-street tags, disclosed in the HUD. It is not presented as an observed circular 7 km/h street sign.
- **A stationary 100 is not success.** A review below 300 m or 45 seconds says there is insufficient evidence. Longer reviews describe observed behaviour only, never driving competence or test qualification.

## Source inventory and confidence

### 1. OpenStreetMap

[Source and attribution](https://www.openstreetmap.org/copyright) · [ODbL 1.0](https://opendatacommons.org/licenses/odbl/1-0/)

The bounded Overpass extracts provide motor-road way geometry, node IDs, names, tags, closed building footprints and parks. X is east, Z south, in local projected meters. Geometry remains attached to the source nodes; lane centers and widths where absent are inferred.

**Collection gap:** supplementary control nodes, historic/tourism POIs and turn-restriction relations could not be reliably collected from Overpass during research. Requests timed out or returned rate/service errors. The shipped control/restriction arrays are empty and their source metadata says unavailable. An empty array is **not evidence that a street has no restrictions**. The official signal inventory and separately sourced landmark catalog fill only their specific roles.

**POIs from the available base extract:** named amenities, public buildings, heritage features and parks are now extracted from cached OSM ways by `scripts/osm-pois.mjs`, independently of the unavailable supplementary request. The 235 bundled records retain OSM type/ID, relevant tags and the original base-response provenance under `drivingSources.pois`. Missing coordinates are derived from geometry bounding-box centres and marked as inferred; those are not entrances or parking spots. Runtime categories are inferred from tags; nearby same-name duplicates are suppressed in the UI. This is incomplete coverage, not a current business directory or an assertion of public access. No new source fetch is required to reproduce these POIs.

### 2. Geoportal Berlin — Lichtsignalanlagen

[Official WFS capabilities](https://gdi.berlin.de/services/wfs/lsa?service=WFS&version=2.0.0&request=GetCapabilities)

[Bundled inventory request](https://gdi.berlin.de/services/wfs/lsa?service=WFS&version=2.0.0&request=GetFeature&typeNames=lsa:lsa&outputFormat=application/json&srsName=EPSG:4326)

Licence: [Datenlizenz Deutschland – Zero – Version 2.0](https://www.govdata.de/dl-de/zero-2-0).

Inventoried **intersection locations** are matched to nearby mapped road junctions, generally within 38 m. Unmatched crossing sites may be associated with a nearby segment. These are not exact signal-pole/stop-line surveys. Stop lines, approach grouping and phase programs are inferred/generated. Not every inventoried site necessarily produces a usable rendered approach.

Ordinary practice cycles have two principal approach axes and an all-red clearance. Temporary works use a longer clearance and a fail-safe red hold if opposing traffic still occupies the shared lane. Neither is a reconstruction of Berlin’s actual signal controller programs.

### 3. Digitale Plattform Stadtverkehr Berlin — roadworks reports

Dataset: **Baustellen, Sperrungen und sonstige Störungen von besonderem verkehrlichem Interesse**.

[VIZ JSON](https://api.viz.berlin.de/daten/baustellen_sperrungen_viz.json) · [TIC JSON](https://api.viz.berlin.de/tic3/baustellen_sperrungen_tic.json)

Licence: [Datenlizenz Deutschland – Namensnennung – Version 2.0 / dl-de/by-2-0](https://www.govdata.de/dl-de/by-2-0).

**Modifications:** filtered to each district bounding box and packaged alongside local map data. Reports are retained as snapshots. The engine checks report validity at the recorded snapshot time, not the user’s current wall clock. A nearby report may inspire a practice exercise; it does not prove that the selected road has that exact lane closure, signal installation, speed limit or equipment. Cones, barriers, excavator, yellow markings and the temporary 20 km/h scheme are **new simulated additions**. A fallback zone is explicitly training-only.

VIZ and TIC coverage is not a complete inventory of every small worksite. Overlapping reports may describe related works. No current “road open/closed” promise is made.

### 4. Geoportal Berlin — LoD2 buildings

[Official Atom download index](https://gdi.berlin.de/data/a_lod2/atom/) · [Licence: DL-DE-Zero 2.0](https://www.govdata.de/dl-de/zero-2-0)

CityGML tiles are downloaded from the official index, deduplicated, converted from ETRS89 / UTM33, cropped and normalised to local flat ground. Wall/roof rings, including courtyard holes, are triangulated for Three.js. Original tile URLs and SHA-256 hashes are retained in each `buildings/<district>.json` file.

**Not photorealism:** roof/building form is data-derived; facades are illustrative materials. Terrain elevations and interiors are not modeled. Smaller rendering bounds and proximity filters reduce workload; outside supported LoD2 coverage, OSM footprint extrusions provide context. Missing detailed files trigger an explicit OSM fallback.

### 5. Restricted textured city mesh — deliberately not used

[Berlin 3D download portal terms](https://www.businesslocationcenter.de/berlin3d-downloadportal/resources/terms/terms.de.html)

The separately offered textured mesh has redistribution/public-rendering restrictions. It is **not** included in this app, nor treated as interchangeable with openly licensed LoD2 CityGML. No textured-mesh download workaround is used.

### 6. Landmarks and reference photographs

[Local catalog](../landmarks/catalog.json) lists each coordinate source, historical reference, representation and photo attribution. Primary visitor references include visitBerlin’s pages for [Brandenburg Gate](https://www.visitberlin.de/en/brandenburg-gate), [Checkpoint Charlie](https://www.visitberlin.de/en/checkpoint-charlie), [Gendarmenmarkt](https://www.visitberlin.de/en/gendarmenmarkt), [Berliner Dom](https://www.visitberlin.de/en/berlin-cathedral), [KulturBrauerei](https://www.visitberlin.de/en/kulturbrauerei), and [Savignyplatz](https://www.visitberlin.de/en/savignyplatz). Wikipedia/Wikimedia provide the recorded coordinate and image references.

Seven licensed/public-domain reference photographs are stored locally. The catalog and in-app cards identify the author, original Commons page and individual licence; see [photo notices](../landmarks/README.md). Thumbnails may be cropped by the UI. They are **not facade textures** and do not make the procedural scene photographic. The Checkpoint Charlie photograph is historical; today’s guardhouse is itself a reconstruction.

The Gate and guardhouse meshes are original approximations. Other featured buildings primarily use official LoD2 geometry. Gate coordinates extend beyond the original Mitte road extract; no invented road through the pedestrian monument is supplied.

### 7. Detailed vehicle art

Selected imports comprise **“Tesla 2018 Model 3” by Ameer Studio**, **“Volkswagen Golf II” by ARDmation**, and **“BMW M3 Sedan topaz blue car” by stefrolland**, all **CC BY 4.0**, refined in isolated background Blender. These are artist-authored geometry, not mapped observations or manufacturer CAD. The 2018 Tesla, classic Golf II and M3 sedan bodies are identified separately from representative simulated drivetrains; they are not the newer Model 3/eTSI/320i variants. A fourth import is **“Audi A4” by amogh**, used strictly non-commercially under the archive's **CC BY 3.0 plus separate non-commercial fan-art restriction**. The source file is labelled 2008, not the modern 40 TFSI; exact generation/drivetrain is unverified. The current API's CC BY 4.0 declaration conflicts with the preserved archive notice and is not treated as broader permission. The full notice, author credit, restriction and modifications are embedded in the derivative and exposed in the garage, driving view and [licence review](../cars/provenance/a4-amogh-review.json). Missing wheel/brake maps are replaced with PBR surfaces, not fetched externally; its limited cabin is not a reconstruction. RAV4, E-Class and all surrounding traffic remain simplified placeholders. Signal aperture adjustments are illustrative visibility changes, not surveyed lamp assemblies. The asset-specific [credits, original source and preparation notes](../cars/README.md), [catalogue](../cars/catalog.json), and [captured original-platform licence metadata](../cars/provenance/model3-sketchfab.json) preserve attribution and modification notices. The pinned mirror supplied the bytes; its repository licence is not the licence for the model.

## Simulated street population

Traffic density is selected before a drive: Light (up to 16), City (32, default) or Busy (48) cars. Counts are simulation demand, not observed traffic volumes. Seeding uses legal lane edges, excludes work-zone approaches and leaves clearance between cars and around the stationary player. It may produce fewer cars on a small network rather than stack vehicles. Cruising pace varies within the existing simplified following, priority and signal model.

Up to 96 ambient pavement walkers use inferred straight corridors outside the road union and OSM building footprints. Explicit no-sidewalk/no-foot and bridge/tunnel tags are conservatively excluded where available. Corridors end before junctions; people pause and turn rather than inventing road crossings. Appearance, crowd density, height, clothing, walking speed and behaviour are procedural. Bodies are original stylised art, not photographs, scans or real people. Pavement walkers are visual ambience, not a full pedestrian collision assessment.

Three figures share each practice zebra crossing's existing `crossingState` schedule. Rendered movement, traffic yielding and practice deductions therefore use the same walking/intent window. This timed exercise is not pedestrian perception, live demand or a recreation of actual local crossing usage. Instanced geometry limits crowd draw calls without removing animation.

## Reproducibility and dates

- [Road/control manifest](data-manifest.json) records requests, available/unavailable sources, licences, timestamps and original response hashes.
- `/maps/<district>.json` retains the base OSM provenance plus the enrichment sources.
- `/buildings/<district>.json` retains the individual tile provenance and transformation notes.
- `/landmarks/catalog.json` retains per-photo licences and attribution.
- `/cars/catalog.json` retains per-model source/licence evidence, acquisition URLs, checksums, variant limitations and Blender modification notices. Its review date is separate from the map data retrieval dates.
- `/signs/README.md` identifies the original CC0 sign redrawings and their statutory references.

A retrieval date is **not** a survey date or a promise of validity today. Some research responses were imported from local snapshots: these are labeled with the snapshot-file timestamp basis, not falsely called fresh network requests. `--refresh` on the official-feed importer bypasses both those seeds and the cache. Building conversion records generation time separately from cached-source dates.

Source databases and third-party assets retain their respective licences. Attribution remains visible in the app and the redistributed datasets. The simulator’s assumptions and exercise rubric must not be attributed to Berlin’s public authorities.
