Skip to content

Commit 4e71007

Browse files
authored
bug: fix 3d maps that were missing / fix effective at query (#453)
1 parent 2798c8a commit 4e71007

7 files changed

Lines changed: 631 additions & 77 deletions

File tree

components/match/ReplayViewer.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,14 @@ const mapMeshUrl = computed(() =>
291291
normalizedMap.value ? `${meshCdn}/${normalizedMap.value}.tri` : null,
292292
);
293293
294+
// Per-map ceiling boost (source-z units) added to the auto-detected ceiling for
295+
// tall/multi-level maps where the 99th-pct player height sits well below the real
296+
// playable top. Overpass (B site, bridge, heaven) gets chopped too low otherwise.
297+
// This raises BOTH the load-time cull and the ROOF slider midpoint together.
298+
const CEILING_BOOST: Record<string, number> = {
299+
de_overpass: 512,
300+
};
301+
294302
// Auto-detect the playable ceiling for the 3D roof-cut. Players never stand above
295303
// the real ceiling, so the ~99th percentile of player heights (+ head clearance)
296304
// is a reliable "cut roofs but keep all the action" height. Source-z units; the
@@ -300,7 +308,8 @@ const autoCeilingZ = computed<number | null>(() => {
300308
for (const p of props.positions) if (p.z != null) zs.push(p.z);
301309
if (zs.length < 20) return null;
302310
zs.sort((a, b) => a - b);
303-
return zs[Math.floor(zs.length * 0.99)] - 90; // below standing head — cuts walls lower
311+
const base = zs[Math.floor(zs.length * 0.99)] - 90; // below standing head — cuts walls lower
312+
return base + (CEILING_BOOST[normalizedMap.value] ?? 0);
304313
});
305314
306315
const dedupedPositions = computed(() => {

docs/3d-replay-map-meshes.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,27 @@ install needed:
2727
node scripts/fetch-map-meshes.mjs # default Valve pool (+ cs_office)
2828
node scripts/fetch-map-meshes.mjs --all # every map in the pack
2929
node scripts/fetch-map-meshes.mjs de_mirage # specific map(s)
30-
MESH_MAX_MB=60 node scripts/fetch-map-meshes.mjs # allow bigger meshes at full detail
30+
MESH_MAX_MB=16 node scripts/fetch-map-meshes.mjs # smaller meshes (more decimation)
3131
MESH_NO_DECIMATE=1 node scripts/fetch-map-meshes.mjs # skip oversized instead of shrinking
3232
```
3333

34+
> **⚠ jsDelivr 20 MiB limit (read this).** The CDN refuses to serve any single
35+
> file over ~20 MiB — it returns **403, not 404**. A 403 means the 3D viewer
36+
> silently falls back to the flat radar *and* `MeshAvailability` lists the map as
37+
> "missing", even though the `.tri` is committed and tagged. That's why the cap
38+
> defaults to **18** (decimal MB on disk). Do **not** raise `MESH_MAX_MB` past ~19
39+
> for anything you intend to publish. Verify a published tag with
40+
> `curl -sI <cdn>/<map>.tri` — expect `200`, never `403`.
41+
3442
It downloads `https://awpycs.com/<build>/tris.zip` and writes the requested maps
3543
to `.cache/meshes/`. Add `--publish` to push + tag them to the CDN (see Hosting).
3644
Bump `AWPY_BUILD_ID` when awpy ships data for a newer CS2 patch.
3745

38-
**Auto-decimation:** maps over `MESH_MAX_MB` (default 30) are *not* dropped — the
39-
script snaps their vertices to a grid and dedups degenerate/duplicate triangles
40-
until they fit, so big active-duty maps still come through (e.g. inferno
41-
97→~19 MB, train 55→~14 MB, ancient 35→~12 MB). This is the same idea as the
42-
"weld + simplify" step below, just built in and pure-JS.
46+
**Auto-decimation:** maps over `MESH_MAX_MB` (default 18, under the jsDelivr limit
47+
above) are *not* dropped — the script snaps their vertices to a grid and dedups
48+
degenerate/duplicate triangles until they fit, so big active-duty maps still come
49+
through (e.g. anubis 24→~12 MB, overpass 49→~9 MB, train 55→~13 MB). This is the
50+
same idea as the "weld + simplify" step below, just built in and pure-JS.
4351

4452
Maps in the pack today: `de_ancient de_anubis de_basalt de_dust2 de_edin
4553
de_inferno de_mirage de_nuke de_overpass de_palais de_train de_vertigo

0 commit comments

Comments
 (0)