ShitboxInfinity/tools/build_all_levels.sh
m3ultra 939c2c5c35 Gateway Bridge: 64.5 m over the river, and a drag strip to match
The Sir Leo Hielscher Bridges and their industrial hinterland, from OSM
+ DEM like everything else -- but a 64.5 m concrete box girder split
across 13 OSM ways and twin carriageways broke every bridge assumption
the builder had, three different ways, before the right abstraction
appeared:

- Per-way sine humps (the Story Bridge recipe) turned each short
  approach span into a 52 m wall.
- A whole-bridge axis projection lifted named segments 3 km from the
  water and cliffed at every segment seam.
- The fix: deck height is a CONTINUOUS FIELD of distance-to-river --
  smoothstep from terrain to +57 m over the water. The river is the
  thing being bridged; let it set the profile. Seams are geometrically
  impossible because the field doesn't know what a segment is.

The bridge arg grew to Name:hump:style. Style "box" adds concrete
piers under every bridge-tagged span (28 of them), collision guardrails
chasing both deck edges (a 64 m deck with open edges is a cliff with
lane markings -- the first playtest fell off it), and puts Spawn,
DragStart/End and the RacePath on the deck field. Story Bridge keeps
its 16 m truss unchanged.

The payoff mode: a 1,422 m drag strip -- the longest in the game --
running up and over the bridge, verified in-shot racing Nanna's Morry
between the steel rails with the deck climbing ahead. Race mode's
auto-traced loop weaves interchange ramps and is honestly chaotic;
README flags the hand-authored-loop fix if bridge racing matters.

Plus the trace stitcher's loose-join pass (carriageways within 60 m
merge), a FLUX river-industrial sky, and the loose-join is what future
divided-road levels will lean on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-01 18:41:24 +10:00

31 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# Rebuild every OSM level. Area JSONs are cached in $OSM_CACHE; refetch via the
# README curl + osm_xml_to_json.py if absent.
set -e
cd "$(dirname "$0")/.."
B=/Applications/Blender.app/Contents/MacOS/Blender
C="${OSM_CACHE:-$HOME/.cache/burnout_osm}"
[ -d "$C" ] || { echo "no OSM cache at $C -- set OSM_CACHE or refetch (see README)"; exit 1; }
while IFS='|' read -r id json lat lon sway loop bridge canopy terrain; do
ARGS=$(python3 tools/osm_level_args.py "$C/$json" "$sway" "$loop") || { echo "ARGS FAILED $id"; continue; }
SPAWN=$(echo "$ARGS" | head -1)
RP=$(echo "$ARGS" | tail -1)
# level_*.jpg are Godot's extraction of the GLB's embedded textures, not
# Blender's output. Clear them so renamed/dropped materials don't leave
# orphans -- but the .glb.import MUST go too, or Godot's cache decides
# nothing changed and never re-extracts, leaving a level with no textures
# at all (loads, renders untextured, spams "Resource file not found").
rm -f "levels/$id"/level_*.jpg "levels/$id"/level_*.jpg.import "levels/$id"/level.glb.import
"$B" -b -P tools/build_level_osm.py -- "$C/$json" "$id" "$lat" "$lon" "$SPAWN" "$RP" "$bridge" "$canopy" "${terrain:--}" 2>&1 \
| grep -E '^(level built|bridge truss|canopies built|forest fill)'
done <<'EOF'
queen_st_mall|brisbane_cbd.json|-27.4699|153.0251|Queen Street Mall|Adelaide Street,Edward Street,Elizabeth Street,George Street|-|Queen Street
southbank|southbank.json|-27.4775|153.0215|Little Stanley Street|trace:Grey Street|-|-
albert_parklands|albert_parklands.json|-27.4740|153.0280|Albert Street|Alice Street,George Street,Margaret Street,Edward Street|-|-
story_bridge|story_bridge.json|-27.4635|153.0355|Bradfield Highway|trace:Bradfield Highway|Bradfield Highway|-
kangaroo_point|kangaroo_point.json|-27.4780|153.0345|River Terrace|trace:River Terrace|-|-
mt_cootha|mt_cootha.json|-27.4735|152.9530|Sir Samuel Griffith Drive|trace:Sir Samuel Griffith Drive|-|-|grass
mt_gravatt|mt_gravatt.json|-27.5520|153.0755|Mount Gravatt Outlook Drive|trace:Mount Gravatt Outlook Drive|-|-|grass
gateway|gateway.json|-27.4470|153.1000|Gateway Motorway|trace:Gateway Motorway|Gateway Motorway:57:box|-|-
EOF