Files
tokyo-wangan-racing/tools/probe_gapreal.luau
T
jesse 6e50f9718d
CI / quality (push) Failing after 1m9s
Aux-lane suppression + PA geometry fixes; probe/verify tooling
MapBuilder.luau
  - Suppress the aux lane across samples 525-550 (AUX_SUPPRESS_FROM/TO),
    honoring the user's hand deletion in Studio so a rebuild no longer
    regenerates it.
  - Smoothstep the width ramp over AUX_BLEND=5 samples on each side. A hard
    cut produced a 26-stud lateral fence jog; the blend removes it.
  - DO NOT remove this suppression. Re-enabling it resurrects geometry the
    user deleted by hand.

rokit.toml
  - rojo 7.5.1 -> 7.7.0 to match the auto-updating Studio plugin.
    Server older than plugin fails the handshake with
    "attempt to index number with 'protocolVersion'".

tools/
  - 34 read-only probe/verify/capture scripts used to measure the datamodel
    instead of reasoning from source.

Verified-good baseline at this commit:
  total parts       16788
  PAWestSlip        60 segs, 34.4 deg total bend, worst 1.4, 0 kinks >5
  PAEastSlip        60 segs, 30.7 deg total bend, worst 1.3, 0 kinks >5
  AuxLane parts     30 (samples 525-550 deliberately absent)
  barrier coverage  823 samples, 0 unguarded
  fence jogs >10st  0
2026-08-06 08:27:47 -04:00

98 lines
3.2 KiB
Luau

-- The 50-sample "unbarriered run" (513..562, LEFT) overlaps the aux-lane region
-- (510..565) exactly. In that stretch the parapet was deliberately RELOCATED
-- outboard, to the aux lane's outer edge -- so a 12-stud probe off the mainline
-- edge would report "missing" when the barrier is simply further out.
-- Do not claim a hole until this is disambiguated. Report ACTUAL distances.
local out = {}
local function say(s) table.insert(out, s) end
local map = workspace:FindFirstChild("Map")
if not map then return "Map MISSING" end
local bars = {}
for _, d in ipairs(map:GetDescendants()) do
if d:IsA("BasePart") and (d.Name == "Barrier" or d.Name == "EdgeRail"
or d.Name == "KillWall" or d.Name:match("Parapet")) then
table.insert(bars, d)
end
end
say(("barrier-ish parts: %d"):format(#bars))
local aux = {}
for _, d in ipairs(map:GetDescendants()) do
if d:IsA("BasePart") and d.Name:match("^AuxLane_(%d+)$") then
table.insert(aux, d)
end
end
say(("aux lane parts: %d"):format(#aux))
local deck = {}
for _, d in ipairs(map:GetDescendants()) do
if d:IsA("BasePart") then
local k = d.Name:match("^Road_(%d+)$") or d.Name:match("^Deck_(%d+)$")
or d.Name:match("^RoadDeck_(%d+)$")
if k then deck[tonumber(k)] = d end
end
end
local UP = Vector3.new(0, 1, 0)
local function flat(v) return Vector3.new(v.X, 0, v.Z) end
-- For a probe point, distance to nearest barrier AND nearest aux part.
local function nearest(list, p, ymax)
local best, bi = math.huge, nil
for _, b in ipairs(list) do
if math.abs(b.Position.Y - p.Y) < (ymax or 16) then
local d2 = (flat(b.Position) - flat(p)).Magnitude
if d2 < best then best = d2; bi = b end
end
end
return best, bi
end
say("sample | edgeDist->barrier | auxHere | verdict")
local realGaps = {}
for i = 505, 570 do
local d = deck[i]
if d then
local right = d.CFrame.LookVector:Cross(UP).Unit
-- LEFT side probe (side = -right)
local edge = d.Position - right * (d.Size.X / 2 + 2)
local bd = nearest(bars, edge)
local ad = nearest(aux, edge)
local hasAux = ad < 20
-- A barrier is "present" if within 12 of the mainline edge, OR the aux
-- lane is here and a barrier sits within 12 of the aux OUTER edge.
local ok = bd < 12
if not ok and hasAux then
local auxEdge = d.Position - right * (d.Size.X / 2 + 26)
local bd2 = nearest(bars, auxEdge)
if bd2 < 14 then ok = true end
if i % 6 == 0 then
say((" %d | %.1f | aux=%s | auxEdgeBarrier=%.1f | %s"):format(
i, bd, tostring(hasAux), bd2, ok and "OK(relocated)" or "GAP"))
end
elseif i % 6 == 0 then
say((" %d | %.1f | aux=%s | %s"):format(i, bd, tostring(hasAux), ok and "OK" or "GAP"))
end
if not ok then table.insert(realGaps, i) end
end
end
say(("REAL gaps after accounting for relocated parapet: %d samples"):format(#realGaps))
if #realGaps > 0 then
local runs, cur = {}, nil
for _, i in ipairs(realGaps) do
if cur and i - cur.last <= 2 then cur.last = i
else if cur then table.insert(runs, cur) end cur = { first = i, last = i } end
end
if cur then table.insert(runs, cur) end
for _, r in ipairs(runs) do
local d = deck[r.first]
say((" GAP RUN %d..%d at (%.0f,%.0f,%.0f)"):format(
r.first, r.last, d.Position.X, d.Position.Y, d.Position.Z))
end
end
return table.concat(out, "\n")