Skip to content

idea: ensure more road smoothness — reduce unwanted waviness from terrain unevenness #230

Description

@nigel-hall-codes

What we're exploring

Roads in the baked SF map can become wavy / undulating where the real-world road is actually smooth. The waviness is an artifact of the underlying terrain heightfield being uneven (noisy contour interpolation, sparse elevation samples, steep-grade conform logic), which gets transferred onto the road geometry.

We want roads to:

  • Follow terrain on genuine slopes and grade changes (real hills should still feel like hills), but
  • Stay locally smooth — suppress high-frequency vertical noise the road shouldn't have.

Why it matters

Wavy roads hurt drivability (vehicle physics bounce), visual realism, and the parked-car / building conform that piggybacks on road height.

Directions to investigate (not decisions)

  • Smoothing/filtering the sampled heightfield along the road centerline (moving average, Savitzky–Golay, spline fit) before generating road mesh.
  • Distinguishing genuine grade change from noise (slope thresholds, curvature limits, max vertical acceleration along arc length).
  • Improving the heightfield source quality (contour interpolation, cache resolution .rNNN.heightcache).
  • How road smoothing interacts with the steep-grade conform work in fix: road mesh breaks on steep slope (Lombard) — faceting + buildings float over gaps #219 and with building/parked-car conform.

Relevant code (starting points)

  • Assets/Scripts/Pipeline/CarRoadSpawner.cs
  • Assets/Scripts/Pipeline/ChunkStreamer.cs
  • Assets/Scripts/Pipeline/HeightField.cs
  • Bake pipeline: python/sfmap_bake

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions