Three iterations of the Daikoku PA ramps never read as a real
interchange. Measured why, rather than tuning further:
* the entry and exit decks INTERSECTED -- 2547 sample pairs within
30 studs horizontally at <12 studs dY, worst case 0.5 studs apart
at dY=0.0. On screen that is the bowtie tangle of white rails.
* both real Daikoku ramps turn the SAME way (clockwise; the guide
video says "right, right"). This build mirrored them into each
other.
* the real arc wraps OUTSIDE the lot and forms its north/east
boundary. This build cut across the apron interior.
Gated behind BUILD_PA_RAMPS=false rather than deleted -- the radius
was already correct (470 studs vs an OSM-measured mean of 469) and
the merge lands tangent at 0.1-0.2 deg divergence. Both worth keeping.
Also removed two leftovers that would have outlived the ramps:
* rampOpen punched holes in the mainline's outer parapet, railing
and kill wall for ramps that no longer exist -- a barrier gap with
a drop behind it. Sealed via RAMP_EDGE_OPENINGS=false. Verified:
Barrier/EdgeRail/KillWall = 1646 each = 823 samples x 2 edges,
0 road samples without a guard within 90 studs.
* gore zebra hatching painted 1024 bars + 64 boundary lines marking
a junction that is not there. Sealed via RAMP_GORE_MARKINGS=false.
Verified after a cache-busting fresh rebuild (Studio's require() cache
otherwise serves the previous map and reports a false pass):
parts 22628 -> 15988
all ramp part classes = 0
Road = 823 (unchanged), spawn pad + PASpawn intact
clip probe TRUSTWORTHY (control +11/-0), CLIPPING=0
Research and rebuild spec kept for when this is revisited:
reference/ramps/BUILD_SPEC.md, INDEX.md (10 CC-licensed Commons
photos), docs/daikoku-reference-spec.md (OSM circle fits).
109 lines
2.9 KiB
Luau
109 lines
2.9 KiB
Luau
-- Building-clip probe, CORRECTLY SCOPED.
|
|
--
|
|
-- The previous version tested only PAEntryRamp*/PAExitRamp* against buildings
|
|
-- and reported 0/1200 -- but its control ALSO returned 0, which makes the
|
|
-- result vacuous. Worse, the part visibly speared by a tower is a Road_*
|
|
-- segment, i.e. it was sitting in the control group, not the test group.
|
|
--
|
|
-- This version:
|
|
-- * tests EVERY drivable part (Road_*, ramps, PA surfaces) -- 21k parts
|
|
-- * proves the metric can detect a hit BEFORE trusting a zero (positive
|
|
-- control: a synthetic part deliberately placed inside a building)
|
|
-- * reports the worst offenders with coordinates so they can be shot
|
|
|
|
local ws = game:GetService("Workspace")
|
|
local map = ws:FindFirstChild("Map")
|
|
if not map then
|
|
return "NO MAP"
|
|
end
|
|
|
|
local BUILDING = {
|
|
Building = true,
|
|
TokyoTower = true,
|
|
TowerDeck = true,
|
|
TowerAntenna = true,
|
|
ShiodomeTower = true,
|
|
TowerCrown = true,
|
|
DietTower = true,
|
|
RoppongiHills = true,
|
|
TokyoStation = true,
|
|
StationDome = true,
|
|
Skytree = true,
|
|
GinzaBlock = true,
|
|
NationalDiet = true,
|
|
BridgeTower = true,
|
|
TowerCrossbeam = true,
|
|
PalaceWall = true,
|
|
}
|
|
|
|
local function isDrivable(n)
|
|
return n:match("^Road_")
|
|
or n:find("Ramp")
|
|
or n == "PAFloor"
|
|
or n:match("^Apron")
|
|
or n:match("^Slip")
|
|
or n:match("^Merge")
|
|
end
|
|
|
|
local drive, bld = {}, {}
|
|
for _, d in ipairs(map:GetDescendants()) do
|
|
if d:IsA("BasePart") then
|
|
if BUILDING[d.Name] then
|
|
table.insert(bld, d)
|
|
elseif isDrivable(d.Name) then
|
|
table.insert(drive, d)
|
|
end
|
|
end
|
|
end
|
|
|
|
if #bld == 0 or #drive == 0 then
|
|
return ("SCOPE FAIL drive=%d bld=%d"):format(#drive, #bld)
|
|
end
|
|
|
|
-- Build an OverlapParams limited to building parts only.
|
|
local op = OverlapParams.new()
|
|
op.FilterType = Enum.RaycastFilterType.Include
|
|
op.FilterDescendantsInstances = bld
|
|
op.MaxParts = 12
|
|
|
|
-- POSITIVE CONTROL: put a probe cube dead-centre inside a building and
|
|
-- confirm the metric reports it. If this returns 0, the metric is broken and
|
|
-- every other number below is meaningless.
|
|
local target = bld[math.floor(#bld / 2)]
|
|
local ctrlHits = ws:GetPartBoundsInBox(CFrame.new(target.Position), Vector3.new(4, 4, 4), op)
|
|
local controlOK = #ctrlHits > 0
|
|
|
|
local hits, samples = 0, {}
|
|
for _, p in ipairs(drive) do
|
|
-- shrink slightly so parts merely TOUCHING a facade aren't flagged;
|
|
-- we want genuine interpenetration
|
|
local probe = p.Size - Vector3.new(1.5, 1.5, 1.5)
|
|
if probe.X > 0.5 and probe.Y > 0.5 and probe.Z > 0.5 then
|
|
local h = ws:GetPartBoundsInBox(p.CFrame, probe, op)
|
|
if #h > 0 then
|
|
hits += 1
|
|
if #samples < 6 then
|
|
table.insert(
|
|
samples,
|
|
("%s@%.0f,%.0f,%.0f in %s"):format(
|
|
p.Name,
|
|
p.Position.X,
|
|
p.Position.Y,
|
|
p.Position.Z,
|
|
h[1].Name
|
|
)
|
|
)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
return ("CONTROL=%s (%d hits on a part inside a building) || drivable=%d bld=%d CLIPPING=%d [%s]"):format(
|
|
controlOK and "PASS" or "FAIL-METRIC-BROKEN",
|
|
#ctrlHits,
|
|
#drive,
|
|
#bld,
|
|
hits,
|
|
table.concat(samples, " ; ")
|
|
)
|