From 46544ef3c1f5d2962eb56ac1b0f0ce0560196926 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 29 Apr 2026 11:16:49 +0200 Subject: [PATCH] fix(scenery): drop non-retail extra-road-vertex suppression User report: trees that exist in retail are missing in ACdream. SceneryGenerator had an extra heuristic filter at lines 169-180 that rejected scenery whose cell-origin vertex was a road vertex, on top of the proper retail post-displacement road check (FUN_00530d30 port via IsOnRoad). The comment admitted it wasn't in the retail decomp -- it was added to widen road margins visually. Side effect: any cell whose SW corner happened to touch a road vertex had ALL of its scenery dropped, even when the displaced position was well clear of the road ribbon. Removing the extra guard. The retail FUN_00530d30 ribbon test already handles road exclusion correctly; the heuristic was strictly subtractive and silently dropped trees the retail client renders. Tests stay 1439 green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/AcDream.Core/World/SceneryGenerator.cs | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/AcDream.Core/World/SceneryGenerator.cs b/src/AcDream.Core/World/SceneryGenerator.cs index 2dfcd77..5c88128 100644 --- a/src/AcDream.Core/World/SceneryGenerator.cs +++ b/src/AcDream.Core/World/SceneryGenerator.cs @@ -166,18 +166,18 @@ public static class SceneryGenerator continue; } - // Also reject if the vertex CX,CY is a road vertex itself - // — scenery whose cell-origin vertex is on a road should - // not spawn, even if displacement moves it off the ribbon. - // Retail's frequency-based path is guarded by the road mask; - // our formula can yield valid positions adjacent to roads - // that the ACViewer OnRoad test lets through. This extra - // guard pushes scenery away from road vertices, matching - // retail's visually clearer road margins. - if (IsRoadVertex(block.Terrain[(int)cellX * VerticesPerSide + (int)cellY])) - { - continue; - } + // L-fix2 (2026-04-28): the extra cell-origin road-vertex + // guard previously here is REMOVED. It wasn't in the + // retail decomp — it was a heuristic added to widen + // road margins visually. The proper retail post- + // displacement road check (FUN_00530d30 port via + // IsOnRoad above) already handles road exclusion. + // The extra guard was over-suppressing — every cell + // whose SW corner happened to touch a road vertex + // had ALL of its scenery dropped, even when the + // displaced position was well clear of the ribbon. + // User reported missing trees they could see in + // retail; this is the most likely cause. // Slope filter (ACME conformance fix 4e): compute terrain normal // Z-component at the displaced position and check against the