Files
tokyo-wangan-racing/tools/probe_ramp_surroundings.luau
T
jesse c297b20aed Disable PA on/off ramps; restore mainline to pre-ramp state
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).
2026-08-03 21:15:25 -04:00

110 lines
2.8 KiB
Luau

-- What actually sits near the four ramp ENDS? The user reports ramps going
-- through buildings; the clip probe only found pillars vs perimeter wall.
-- So: name every non-drivable part within 140 studs of each ramp end, and
-- separately list PA-area structures with their footprints, so the ramp
-- can be re-aimed at a genuinely clear corridor instead of guessed at.
local ws = game:GetService("Workspace")
local map = ws:FindFirstChild("Map")
if not map then
return "NO MAP"
end
local WANT = {
PAEntryRampNear_200 = true,
PAExitRampNear_200 = true,
PAEntryRampTrunk_1 = true,
PAExitRampTrunk_1 = true,
}
local ends = {}
local all = {}
for _, d in ipairs(map:GetDescendants()) do
if d:IsA("BasePart") then
if WANT[d.Name] then
ends[d.Name] = d.Position
end
table.insert(all, d)
end
end
local function drivable(n)
return n:match("^Road_") or n:find("Ramp") or n == "PAFloor" or n == "Ground" or n:find("Water")
end
local out = {}
for n, p in pairs(ends) do
local near = {}
local closest, closeName = 1e9, "none"
for _, d in ipairs(all) do
if not drivable(d.Name) then
local dist = (d.Position - p).Magnitude
if dist < 140 then
near[d.Name] = (near[d.Name] or 0) + 1
if dist < closest then
closest, closeName = dist, d.Name
end
end
end
end
local l = {}
for k, v in pairs(near) do
table.insert(l, ("%s x%d"):format(k, v))
end
table.sort(l)
local keep = {}
for i = 1, math.min(#l, 10) do
table.insert(keep, l[i])
end
table.insert(
out,
("%s @%.0f,%.0f,%.0f closest=%s(%.0f) near: %s"):format(
n,
p.X,
p.Y,
p.Z,
closeName,
closest,
table.concat(keep, ", ")
)
)
end
-- PA-area structures with footprints so we can aim at a clear corridor.
table.insert(out, "--- PA structures (within 700 of PA centre) ---")
local paf = nil
for _, d in ipairs(all) do
if d.Name == "PAFloor" then
paf = d
end
end
if paf then
local c = paf.Position
table.insert(out, ("PAFloor centre %.0f,%.0f,%.0f size %.0fx%.0f"):format(c.X, c.Y, c.Z, paf.Size.X, paf.Size.Z))
local seen = {}
local rows = {}
for _, d in ipairs(all) do
if not drivable(d.Name) and (d.Position - c).Magnitude < 700 then
local base = d.Name:gsub("_%d+$", "")
if not seen[base] then
seen[base] = { minx = 1e9, maxx = -1e9, minz = 1e9, maxz = -1e9, n = 0 }
end
local s = seen[base]
s.n += 1
s.minx = math.min(s.minx, d.Position.X - d.Size.X / 2)
s.maxx = math.max(s.maxx, d.Position.X + d.Size.X / 2)
s.minz = math.min(s.minz, d.Position.Z - d.Size.Z / 2)
s.maxz = math.max(s.maxz, d.Position.Z + d.Size.Z / 2)
end
end
for k, s in pairs(seen) do
table.insert(rows, ("%s n=%d X[%.0f..%.0f] Z[%.0f..%.0f]"):format(k, s.n, s.minx, s.maxx, s.minz, s.maxz))
end
table.sort(rows)
for _, r in ipairs(rows) do
table.insert(out, " " .. r)
end
end
return table.concat(out, "\n")