Skip to content

feat: river rendering improvements — width classes and bridge overlays #46

Description

@nikolareljin

Summary

Current river rendering in drawRivers() (js/map.js:1173) draws all rivers with a single line width (tileSize * 0.18) and uses a flat color regardless of river size. This makes the Nile look identical to the Po.

Proposed Changes

1. River width classes in assets/geography.js

Add width_class to each river in RIVER_PATHS:

const RIVER_PATHS = [
  { id: 'nile',      name: 'Nile',       width_class: 'major', path: [[31,25],[31,22],...] },
  { id: 'danube',    name: 'Danube',     width_class: 'major', path: [[9,48],[14,47],...] },
  { id: 'euphrates', name: 'Euphrates',  width_class: 'major', path: [[38,38],[40,36],...] },
  { id: 'tigris',    name: 'Tigris',     width_class: 'major', path: [[43,38],[44,36],...] },
  { id: 'po',        name: 'Po',         width_class: 'minor', path: [[8,45],[10,45],[12,45]] },
  { id: 'rhone',     name: 'Rhone',      width_class: 'minor', path: [[6,46],[5,44],[5,43]] },
  { id: 'dnieper',   name: 'Dnieper',    width_class: 'minor', path: [[31,52],[31,49],[31,46]] },
  // NEW rivers:
  { id: 'volga',     name: 'Volga',      width_class: 'major', path: [[49,57],[49,53],[50,48],[51,46]] },
  { id: 'don',       name: 'Don',        width_class: 'minor', path: [[39,57],[40,54],[40,48]] },
  { id: 'jordan',    name: 'Jordan',     width_class: 'minor', path: [[35,33],[35,32],[35,31]] },
  { id: 'amu_darya', name: 'Amu Darya',  width_class: 'minor', path: [[64,38],[62,38],[60,37]] },
];

2. Width-aware drawRivers() in js/map.js

drawRivers(startX, startY, endX, endY, tileSize) {
    // major rivers: wider stroke
    // minor rivers: current thin stroke
}

3. Bridge overlay

When a road crosses a river tile, draw a bridge:

  • Perpendicular stroke (90° to river flow direction) in stone color
  • Only when tile.roads > 0 && isRiverTile(tile.x, tile.y)

Related

  • Part of the Byzantine Ecosystem cross-repo integration plan (neobyzantine-org Phase 10)
  • Pairs with #[lake-issue] (lake rendering) and #[ocean-issue] (ocean depth differentiation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    500ad500ad task trackingenhancementNew feature or requestmapMap rendering and geographic features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions