Commit Graph
130 Commits
Author SHA1 Message Date
hyper 3813287489 fix(web): pass TTSMod to flattenObjects in full setup 2026-08-17 17:59:01 +08:00
hypercross 71ae91960f docs: mark stale bgm engine/loader docs as in progress
Call out that the tabletop and engine package split is not yet landed, add a status note to tabletop.md, and drop the retired WIP banner in bgm-loader.md.
2026-08-16 13:04:14 +08:00
hypercross addfc03ab6 docs: add free interaction design to bgm specs
Add the command/dialog split to the state-model and interactions docs, declare role dialog and zone facing in the format spec, and let setups declare which dialogs power open interactions.
2026-08-16 12:59:03 +08:00
hypercross 211c151971 docs: add bgm state model design
Describe the format's state model: components as constants, setup as the shape of states, path-to-stack by facing (part affordance x zone restriction), and the stacks-on-paths anchoring scope cut.
2026-08-16 12:38:58 +08:00
hypercross 345832e389 docs: reorganize docs into bgm and status folders
Group the bgm spec cluster under docs/bgm and move dev logs and plans under docs/status, add an overview index, and update cross-references in the docs, README, and source comments.
2026-08-16 11:57:19 +08:00
hypercross cf8ca07850 fix: allow recovering from part viewer error
Add a Try again button to the ErrorBoundary fallback and key the ModPage boundary by selection so picking another object clears a stuck error.
2026-08-15 14:17:41 +08:00
hypercross 498cf1b633 fix(web): balance scene lighting so laid-flat cards don't overexpose
Replace the single dominant top light with evenly-spaced key lightformers
so a laid-flat card's top face isn't blown out and its underside is lifted
by a warm bounce.
2026-08-15 13:40:34 +08:00
hypercross a9297d8b2b fix(web): size contact shadows to content bounds
Lay flat card/tile/token meshes so the scene-level contact shadow has a
surface to project onto, and size the shadow plane to the measured content
bounds instead of a fixed 22-unit default that left small objects shadowless.
Give deck carousel cards their own soft radial shadow so the fanned arc reads
as floating over a floor.
2026-08-15 13:27:46 +08:00
hypercross 7d9b5e49ad feat(web): light 3D scene with image-based lighting
Replace the hand-placed light rig with an Environment built from Lightformers, giving MeshStandardMaterial objects consistent PBR lighting and richer color. Keep ContactShadows, which needs no light.
2026-08-15 12:42:05 +08:00
hypercross 3dd3db5643 fix(web): decode textures as sRGB in 3D viewers
TextureLoader leaves colorSpace as NoColorSpace, so card, tile, token, model, and part art is uploaded as linear and then double-decoded in the shader, washing out contrast. Mark each texture sRGB so the GPU decodes it once, correctly.
2026-08-15 12:25:21 +08:00
hypercross fc9f756d52 feat(web): add tone mapping and brightness to 3D scene
The EffectComposer disables three's tone mapping, leaving colors flat and washed out. Add ACES filmic tone mapping plus a small brightness lift so cards match their source images.
2026-08-15 12:25:18 +08:00
hypercross 7ff8e3c51d fix(web): thin out card mesh thickness 2026-08-15 12:10:41 +08:00
hypercross 82a4f9b645 fix(web): stop pdf viewer overflowing 2026-08-14 13:55:02 +08:00
hypercross 82d5a36497 feat(web): add search link to mod header 2026-08-14 13:53:05 +08:00
hypercross 699b89e916 feat(web): show child count in object tree nodes 2026-08-14 12:05:46 +08:00
hypercross 0d35ad56f2 feat(web): rework deck carousel navigation
Replace the counter with a sliding-dot pagination: dots slide and fade
as the active card changes, a counter above the bar shows the current
index, and round first/last and prev/next buttons flank the strip.
Scrolling over the dots steps through the deck. Also fix the camera fit
so it frames the active card front-on instead of the carousel center.
2026-08-14 12:05:37 +08:00
hypercross f01bb5f99b feat(web): rework mod inspector layout
Fill the viewport with a fixed sidebar of highlightable type-filter
icons over an independently scrolling tree, and let the viewer expand
into a full-height scene.
2026-08-14 11:27:46 +08:00
hypercross 8ebb9211c5 fix(web): frame deck carousel on active card
Fit the camera in a frame callback so the active card has settled into
its arc slot first, and aim it straight at the card's front face instead
of keeping the initial side angle. Measure the card's width and widen the
arc radius so wide cards no longer clip their neighbors.
2026-08-14 11:15:59 +08:00
hypercross a3095ead38 feat(web): move mod header into site header
Replace the global TTS Workshop header on mod routes with a ModHeader showing the thumbnail, game name, and download/setup links styled like the Search/BGM nav.
2026-08-14 10:59:20 +08:00
hypercross 30ef76632f feat: return workshop metadata with mod details
Include the Workshop title and preview image in the items response so the mod header survives a page refresh, not just navigation from search. Resolve both from the same Steam API call.
2026-08-14 10:59:14 +08:00
hypercross 7163451d1f fix(web): declare card shader UV uniforms
three.js does not auto-declare uniforms added via onBeforeCompile, so the
injected uMapRepeat/uMapOffset were undeclared and the card shader failed
to compile, rendering cards transparent. Prepend the declarations to the
vertex shader.
2026-08-14 10:52:54 +08:00
hypercross 2430be9661 feat(web): rework mod page header layout
Show the game name and thumbnail in the header, float the action buttons and object GUID to the right, and keep the viewer icon, label, and GUID on one line.
2026-08-14 10:46:27 +08:00
hypercross 002bcb324b perf(web): share card texture via shader UV transform
Move the card sprite repeat/offset out of per-card texture clones and
into a uniform injected into the material shader. Cards now share the
deck sheet (one GPU upload), the shader, and the geometry, with only
per-card material uniforms differing, so navigating a deck no longer
re-uploads the sheet on every step.
2026-08-14 10:46:09 +08:00
hypercross c665212209 feat(web): add deck viewer
Add a DeckViewer that frames the active card in a deck carousel. Scene gains a fit prop so the shared bounds behavior can be disabled and refit manually.
2026-08-14 10:29:04 +08:00
hypercross 2403abc07b feat(web): add type filter bar to object tree
Chips highlight object types to show only those in the tree; with none highlighted, everything is shown. Filtered nodes keep their original index path so selection stays stable.
2026-08-14 10:29:01 +08:00
hypercross ee7e73c798 style(web): use 3:4 aspect ratio for viewers 2026-08-14 09:54:52 +08:00
hypercross dd08f901ae feat: add inline PDF viewer for Custom_PDF objects
Add a /pdf proxy route that forces Content-Disposition inline so PDFs render instead of downloading, and a web viewer that embeds the document in an iframe with a standalone open-in-new-tab link.
2026-08-14 09:51:11 +08:00
hypercross 8bd186df54 refactor(engine): unify commands and orchestrators
Replace the CommandHost with a handler registry keyed by message type.
Message is a permissive base type the host extends; CommandResult is a
discriminated union on the type suffix. Commands and orchestrators are
the same async shape taking a RunContext with an AbortSignal; runCommand
emits :done/:cancel/:error.
2026-08-10 18:40:35 +08:00
hypercross 81c115cb4d docs: unify commands and orchestrators in bgm-engine
Messages are a discriminated union with generic command/result types;
the command host is dropped for a handler registry; commands and
orchestrators are the same async shape taking a cancellable RunContext.
2026-08-10 18:40:30 +08:00
hypercross 3167d26bd6 feat(engine): add message queue, triggers, and orchestrators
New @tts/engine package: the pure message layer that drives bgm games.
MessageQueue snapshots and drains on tick; TriggerRegistry matches by
type/id with runtime enable/disable; runOrchestrator suspends on wait
until a matching message is processed. Engine ties them together behind
the CommandHost contract that @tts/tabletop will implement.
2026-08-10 18:26:23 +08:00
hypercross 91cd3a16d7 docs: add bgm-engine message layer design
Define the message/queue/tick model, the three handler kinds (trigger,
orchestrator, command host), and the @tts/engine package split. Cross-link
from bgm-commands and bgm-tabletop, and add the engine to the architecture
package table.
2026-08-10 18:26:19 +08:00
hypercross 13b3eaed78 feat(bgm): derive definition names from role.type
A definition is identified by role.type and named role.type.lang
(package.lang for packages). Code blocks declare it via role= on the
info string; real files by their filename. Blocks and files without a
matching role.type are ignored. file= still overrides the auto-name.

Relative asset and $variants paths now resolve against the markdown
file's directory (baseDir) rather than the virtual name. Same role.type
with different ids groups under one name; duplicate type#id still
errors. Migrate fixtures and example games to role=.
2026-08-10 16:36:57 +08:00
hypercross 23332ab786 docs(bgm): derive definition names from role.type 2026-08-10 16:27:45 +08:00
hypercross aab0b66ee8 feat(bgm): support role= on code block info strings
Parse role.type#id from the fence info string and merge it into each
parsed object, erroring on conflicts with the content. id on the info
string can't combine with $variants. Auto-named blocks now hash their
content instead of the info string, so identical blocks dedupe.
2026-08-10 16:09:12 +08:00
hypercross c41c266ac1 docs(bgm): document role= on code block info strings 2026-08-10 16:07:17 +08:00
hypercross 634a99dd25 docs: design command execution for tabletop scripts
Add bgm-commands.md covering async commands with ok/cancel/error
results, per-invocation run contexts, fire-and-forget vs self-managed
waiting, and tap interaction with part-local trigger points. Link it
from the tabletop design and plan docs, and record the decisions in
decisions.md.
2026-08-10 15:41:43 +08:00
hypercross 9b5223686e feat(bgm): allow $variants to take multiple csv sources
Expand $variants to accept an array of csv paths, concatenating their
rows. Detect a path by a .csv suffix on the first line instead of a
newline, so inline csv and paths are self-documenting and the rule
applies uniformly to single values and array elements.
2026-08-10 14:06:36 +08:00
hypercross 3aa48058f7 fix(tabletop): render surface outline without depth test 2026-08-10 12:24:46 +08:00
hypercross 812b4640e2 feat(web): clamp tabletop camera to the horizon
Add a maxPolarAngle prop to Scene and use it in the tabletop view so the
camera can't dip below the table and peek under face-down cards.
2026-08-10 12:24:43 +08:00
hypercross 9d776771b1 feat: showcase facing states in poker setup
Deal the deck facedown and stand two drawn cards on their bottom edge,
exercising the back and standing facings alongside the face-up flop.
2026-08-10 12:24:40 +08:00
hypercross d663f4afea feat: add facing orientation to parts
Replace the face/back boolean with a three-state facing (face, back,
standing) seeded from setup placements. Parts now orient about the
anchor at the resting face/edge, so back-down parts sit on the table
instead of below it and standing parts rest on their bottom edge.
2026-08-10 11:47:58 +08:00
hypercross aa23e93b3f docs: add commit conventions skill 2026-08-10 11:47:35 +08:00
hypercross 77e0751554 docs: describe ordered setup placements
Document that setup is an ordered list of placements, each moving its parts to a path, in the format reference and the tabletop plan.
2026-08-10 11:27:56 +08:00
hypercross dc721d5c2d refactor(games): use ordered setup placements
Convert poker and carcassonne setups to the ordered placement list. Deal the deck/draw first, then move the flop cards and opening tiles out onto their paths.
2026-08-10 11:27:53 +08:00
hypercross 96c299e498 feat(tabletop): seed state from ordered setup placements
Apply each setup placement in order, moving its parts to its path, then index each path's parts contiguously so stacking stays valid.
2026-08-10 11:27:50 +08:00
hypercross c2693277ac feat(bgm): model setup as ordered placements
Replace the path->parts setup map with an ordered list of placements, each moving its parts to a path. Entries apply in order, so a part listed in a later placement ends up on that placement's path.
2026-08-10 11:27:46 +08:00
hypercross bc418b2c73 Model part face in tabletop state
Replace the path->part-list store with a per-part map keyed by part id, so each placed part carries its path, stack index, and face. Derive each path's ordered children for stacking, and flip face-down parts in PartPlacement.
2026-08-10 11:10:16 +08:00
hypercross 6502fdae4f refactor(web): code-split the three.js stack out of the main bundle 2026-08-10 09:12:38 +08:00
hypercross 45bf362fbc refactor(tts): derive save filename from URL path only 2026-08-10 09:12:34 +08:00
hypercross 82caa9bb9c fix(shared): accept local asset paths in trace schema 2026-08-10 09:12:31 +08:00