Allow polygon and spline startboxes alongside legacy rectangles#615
Open
burnhamrobertp wants to merge 9 commits into
Open
Allow polygon and spline startboxes alongside legacy rectangles#615burnhamrobertp wants to merge 9 commits into
burnhamrobertp wants to merge 9 commits into
Conversation
1281a26 to
c396f96
Compare
7 tasks
p2004a
requested changes
Jun 20, 2026
p2004a
pushed a commit
to beyond-all-reason/bar-lobby
that referenced
this pull request
Jun 25, 2026
Picks up where #574 left off, which rendered polygon startboxes in the preview but still handed the game a plain bounding-box rectangle at launch, so an offline game never got the real shape. Now the offline start script sends the start areas as modoptions, the way the game PR settled on: a selected preset goes out as the set (`mapmetadata_startboxes_set`, the server-owned default), and custom drag-edited boxes go out as the override (`mapmetadata_startbox_override`, lobby-owned) which the game prefers over the set. So an offline game enforces the real shape, custom boxes aren't silently replaced by the map's default, and online games get the set from the server. It also brings the preview's spline in line with the game and Chobby so the curves match exactly. The old math overshot at sharp corners and could draw a small curl the game never showed. Related PRs: - Core game: beyond-all-reason/Beyond-All-Reason#7513 - Chobby: beyond-all-reason/BYAR-Chobby#1184 - Maps-metadata: beyond-all-reason/maps-metadata#615 - Rowy fork: p2004a/rowy#1 - Original bar-lobby PR (merged): #574 Assisted by Claude Code (Opus 4.8); all code reviewed and verified locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #605
Summary
Widens the startbox
polyschema to accept either the legacy 2-point rectangle (current shape every existing map ships) or an N-point polygon ring with optional Catmull-Rom splinestrengthper anchor. Discriminated via JSON SchemaoneOfso existing data validates unchanged. Generators that target rect-only consumers (TEIServer's Tachyon protocol, SPADS'mapBoxes.conf) compute a bounding-box rectangle from polygon vertices; the polygon shape is preserved throughgen_lobby_maps.tsfor the polygon-aware new lobby and throughsync_to_webflow.ts's existingstartpos-codefield unchanged.Changes
schemas/map_list.yaml
polydefinition withoneOf: [startboxRect, startboxPolygon]$defs.startboxRect— exactly 2 points, top-left/bottom-right corners (the existing format)$defs.startboxPolygon— 3+ points, each with optionalstrengthin[0, 1]for Catmull-Rom spline tessellationstrength. NomultipleOfconstraint to avoid float-comparison flakiness across validators; the Rowy editor enforces a 0.025 snap step at write timescripts/js/src/check_startboxes.ts
poly.length === 2scripts/js/src/gen_teiserver_maps.ts
rectifyStartboxes()helper collapses N-point polygons to bounding-box rectangles before writingteiserver_maps.json— TEIServer's data model and Tachyon protocol stay rect-onlyscripts/js/src/gen_map_boxes_conf.ts
polyToRectCorners()helper applies the same bounding-box fallback for SPADS'mapBoxes.confformatgen_lobby_maps.ts (no change)
polypasses through unchangedVerification
jsonschema+ Draft 2020-12)strength: 2, 2-point poly withstrengthon a corner, polygon with extra propertyRelated PRs
AI / LLM usage statement
Claude Opus 4.7 used to assist in implementation, schema design, and validation.