2026-10-21 04:55:00 +03:00
2025-03-15 18:39:46 -05:00
2024-12-21 17:47:56 -06:00
2024-12-25 09:55:16 -06:00
2025-06-11 16:09:03 -05:00
2024-12-25 09:37:17 -06:00
2025-04-20 18:36:50 -05:00
2025-08-02 13:21:21 -05:00
2025-07-21 01:54:49 -05:00

Derail Valley Community Map with Catenary DC Layer

Interactive vector web map of Derail Valley railway network with DC electrification infrastructure overlay (Catenary-DC / WE6SIM mod).

Architecture & Stack

  • Frontend: Vanilla ES6 modules, HTML5 Canvas 2D (double-buffered with dynamic overlay).
  • Coordinate System: Game engine coordinates (meters), origin at bottom-left, mapped via Matrix and View transforms.
  • Datasets:
    • catenary_dv.json: 164 chained polylines (optimized from 3,751 segments), 9 traction substations, 5 neutral sections, 34 interruption clusters, 129 warning signs.
    • trackdata_dv.json: Rail tracks (cubic Bézier curves) and junction points.
    • poi_dv.json: Stations, offices, service tracks, turntables, landmarks.
    • shop_items.json: Shop inventories and prices.

Catenary Layer Features

  • Wire Suspension Rendering:
    • Single (6.0m, 1500V/750V): standard solid vector line.
    • Dual (6.0m, 1500V): high-capacity twin catenary stroke.
    • Quad (6.0m, 1500V): heavy 4-wire mountain pass stroke with dark border.
    • Trolley (6.0m, 750V): fine yard wire.
    • Side Rail (4.5m, 1000V): dashed 3rd contact rail at IME and SM mine tracks.
    • Neutral Sections (0V): contrasting red-and-white dashed lines with 0V danger badges.
  • Color Modes:
    • Voltage: 1500V DC (#00d2ff), 1000V DC (#ff9f1c), 750V DC (#2ec4b6), 0V Neutral (#e63946).
    • Substation: Distinct color per feeding substation (CME/IME1500, CP750, FF1500, HB1500, IME1000, IMW1500, OR750, SM1500, SM1000).
    • Wire Type: Color-coded by physical suspension category.
  • Markers & Tooltips:
    • Traction Substations: ⚡ badge with nominal voltage, supply voltage, max load (kW), and regenerative inverter presence.
    • Neutral Sections: ⛔ badge with section ID, length, connecting substations, and disconnect traction warning.
    • Interruption Signs: ⤓ diamond badge for pantograph drop/raise warnings.
    • Contact Wires: Nearest-point hovering displaying voltage, substation feed, category, and segment length.

CommunityMapLocation Mod Integration

Bug Fixes

  1. Rotation Desync: LocationResponse accepts rotationTransform from locomotive transform or camera heading (fixing player orientation desync).
  2. URL Formatting: Fixed string immutability bug in address.replaceAll inside connectPlayerLocation.

CORS Configuration

In <GameDirectory>/Mods/CommunityMapLocation/Settings.xml:

<Settings>
  <Port>9090</Port>
  <RequestSourceType>Any</RequestSourceType>
  <RequestSource>http://localhost:8080</RequestSource>
</Settings>

Note: If RequestSourceType is Any, the game mod allows cross-origin requests from any web host (localhost, GitHub Pages, Gitea).

CI/CD Workflows

  • Gitea Actions (.gitea/workflows/deploy.yaml): JSON dataset validation, JS syntax verification, artifact packaging with actions/upload-artifact@v3, releases with akkuman/gitea-release-action@v1.
  • GitHub Pages (.github/workflows/deploy-pages.yml): Automated GitHub Pages deployment on push to main.
S
Description
No description provided
Readme
2.6 MiB
0 Stars 1 Watchers 0 Forks
Languages
JavaScript 78.3%
C# 13.5%
HTML 4.3%
CSS 3.9%