Repository navigation
Fix 2D view and change it to a top down view - #38
Merged
Merged
Conversation
Meteord
requested review from
RalfLeonFasler and
ThoreKoritzius
as code owners
November 7, 2026 12:17
RalfLeonFasler
left a comment
Contributor
There was a problem hiding this comment.
Nice work, the top-down map is a clear step up from the lane strip. I ran it locally: ESLint is clean and all 992 client tests pass. I also checked it in the browser for temperate day, winter dusk and the Training layout, and the layout, biome and time-of-day handling all work.
Some changes before merging:
- Winter contrast. The ridden road (
map.road≈ light grey) onSNOWis hard to tell apart from the ground, and at dusk the edge lines nearly disappear. The road you're on should stay the most readable thing on the map. A darker road or a darker edge/outline in winter would do it. - The drafting indicator is gone. The old view drew the draft gap (
draftwas passed todrawPeloton);drawRideMapdrops it. The HUD still shows "drafting x %" as text, so this may be fine, but please make it a deliberate choice: either show the draft on the map (e.g. a short band from me to the rider ahead) or mention the removal in the CHANGELOG. - The same colours are defined three times. The temperate building and tree colours live in
temperate.js(map,flora.mapColors), again inrideMapTheme.js(DEFAULT_BUILDINGS,TEMPERATE_TREES) and again inrideMapDecor.js(HOUSE_FILLetc.,TREE_COLORS). Please keep them in the biome only and have the theme always pass them in. Also, temperate uses CSS strings and winter uses 0–1 arrays plus*Alpha; one format for both would remove most of thecolorCss/parseColorhandling.theme.landRgbis only used by its own test. - Tree size is in pixels, buildings are in metres.
drawDecorationsdrawstree.ras a pixel radius while buildings scale withcamera.scale, so trees stay 3 px dots at any zoom or resolution. Probablytree.r * camera.scale(with a minimum size)? - Per-frame work. Every frame recomputes
offsetNodesfor the whole route (edges plus each lane divider) and strokes every road of the network in full.roadDecorationsis already cached per map; the offset lines could be cached per route the same way. Since this view is the fallback for devices without WebGL 2, it's worth keeping it light.
Smaller things:
- The CHANGELOG adds a second
### Changedheading under[Unreleased]; please put the entries under the existing one. - In the cockpit layout, my arrow (
riderY: 0.62) sits right under the "Tap left, then right" hint card. - Commits: please squash into imperative messages (CONTRIBUTING) and rebase instead of merging main in.
RalfLeonFasler
requested changes
Nov 7, 2026
RalfLeonFasler
left a comment
Contributor
There was a problem hiding this comment.
Requesting changes for the points in my review comment above.
Meteord
force-pushed
the
feat/top-down-2d
branch
from
November 11, 2026 21:21
c53df0a to
54197ab
Compare
Meteord
force-pushed
the
feat/top-down-2d
branch
from
November 11, 2026 21:28
54197ab to
4463827
Compare
Meteord
force-pushed
the
feat/top-down-2d
branch
from
November 11, 2026 21:59
9a107da to
793f4db
Compare
Contributor
Author
|
Thanks for the review. I changed the following:
|
Contributor
|
Thanks, this addresses everything from the review. To get it merged today, we pushed one small commit on top (6da1634):
|
RalfLeonFasler
approved these changes
Nov 11, 2026
Replace the lane strip with a heading-up top-down map (ADR 0020): the island's coast and hillshade, every road as a thin context line, the ridden road with its edge lines and lane markings, the golden lemons still on the road, the draft gap ahead of me when drafting, and one mark per rider or vehicle, including my best lap's ghost. The map follows the selected season and time of day like the 3D world; the biome is the single source of its 2D colours, in 0-1 RGB arrays like every other biome colour. Decorations are generated once per map, lane offset lines are cached per route, and context roads outside the view are skipped whole, so the WebGL 2 fallback stays light. Trees and buildings are placed in metres and scale with the map's zoom.
ADR 0020 is taken by the OpenBikeNet ADR on main; the 2D map view is 0024. The CHANGELOG goes back to main's layout with the three 2D map entries under [Unreleased] → Changed; reshaping the whole file is left to the release notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RalfLeonFasler
force-pushed
the
feat/top-down-2d
branch
from
November 11, 2026 22:25
6da1634 to
7b2fdd4
Compare
RalfLeonFasler
enabled auto-merge (squash)
November 11, 2026 22:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The 2D view was still the old lane strip: it stretched across the window, showed almost nothing on a solo ride, and ignored the selected season and time of day. It is also the fallback for devices without WebGL 2, so those riders never saw the world's theming.

This replaces the lane strip with a top-down map built from data the client already has, and gives that map the same biome and lighting inputs as the 3D world.

What changed
view/pelotonView.jswithview/rideMapView.js: a heading-up top-down map with the coast and island hillshade, context roads, the ridden road with edge lines and lane dividers, and rider/vehicle markers. The Training layout clips it above the workout band like the 3D view.view/rideMapDecor.js: deterministic tree dots near forests and thin outline houses in villages and at cafés, generated from the route's scenery zones and the map's cafés, then culled to the view.view/rideMapTheme.js: maps the selected biome's 2D palette and the time-of-day preset onto the map's ground, water, road, markings, trees and buildings. Winter paints snow, ice, pine dots and ploughed roads; golden hour and dusk tint the map;autofollows the local clock.main.jssoapp.timeModeis stored even without a 3D view, and so biome/time changes reach 2D-only and no-WebGL sessions.CHANGELOG.md.Checklist
make checkpasses — 992 client tests and all Rust tests; lint cleandocs/architecture.md, README; no protocol change)CHANGELOG.mdentry