#1436 W5c U1: player runtime actor spawning + StreamingAssets packaging#1438
Conversation
CombatSurfaceClient now SPAWNS actors at runtime for tokens with no baked Actor_<id> GameObject (mirroring paint_combat_v1's registry-resolved spawn: slot lookup + default fallback, bind-pose scale lock #1418, SkinnedMeshRenderer pitch guard #1397, albedo #1423, humanoid idle retarget #1408, AO/ring siblings), so ANY campaign renders — not just the baked scene's cast. Despawns runtime- spawned actors on token removal; baked actors untouched. Pure consumer (reads engine cells + registry only; engine stays sole writer). Packaging (player can't AssetDatabase.Load Assets/ paths at runtime): BuildMacOSPlayer.EnsurePackaged() bakes registry-referenced models/albedos/idle clips into a StandaloneOSX AssetBundle at StreamingAssets/worldos_actors keyed by their EXACT registry path (runtime passes model_ref verbatim -> zero transform, registry invariant intact) + copies registry.json verbatim to StreamingAssets. AssetBundle over Resources precisely because its load key is the registry path. Editor capture path (paint_combat_v1.cs / AssetRegistry.cs) untouched. Validated on GEX44 (Unity 6000.5.1f1): compile-clean, editor-mode spawn of 3 non-baked tokens (goblin/fighter-alias/innkeeper-alias) grounded+ringed on plate, bundle=26 assets, player rebuilt (Succeeded, Universal x64ARM64), StreamingAssets verified inside the .app. Evidence qa/evidence/1436/.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
evaOS review status: closed or merged before reviewPR: #1438 - #1436 W5c U1: player runtime actor spawning + StreamingAssets packaging evaOS review stopped because the PR closed or merged before this queued head could be reviewed. Automation note: agents should wait for this comment to reach PR URL: #1438 Details: state=closed |
…lision-validated clicks (#1446) * #1441 W5d: grounded reposition + engine-path glide + walk clips + click pre-validation - PlaceActor -> UpdateActor: reposition now re-grounds feet->FloorY via the SAME BakeMesh Measure as SpawnActor (float fix; old path preserved raw Y). First-sight snap, changed-cell glide, same-cell no-op (poll never interrupts an in-flight glide). - GlideTo: cell->cell tween at GlideSpeed following the engine-confirmed lastPath polyline (straight-line fallback when absent); rings/AO follow every frame; walk clip during glide (own walk/run -> humanoid donor-walk retarget -> glide-only fallback), idle at rest. - Click pre-validation: reject clicks on impassable/occupied cells with a red ring flash (UX pre-filter only; engine stays authoritative — it already rejects illegal cells). - Reconcile actor heights to named consts (ActorHeightFoe 4.2 / ActorHeightChar 3.2, the paint_combat_v1 #1418-calibrated source); flag replay_v1's stale 5.0. - Parse impassable+lastPath via the runtime Json parser (poll + move-response paths). Refs #1441 #1436 #1322 (PRs #1438/#1440). * #1441 W5d: QA evidence — compile-clean, editor sanity capture, build+scp notes Box validation: 0-error compile (component compiled + attached), editor sanity screenshot (grounded actors + rings, painterly camp scene), Universal build Succeeded (0 errors), zip scp'd to ~/worldos-session-notes/w5a-build/WorldOSPlayer.app.zip (overwrite). --------- Co-authored-by: Eva <arncalso@gmail.com>
Closes part of #1436 (W5c Unit 1; Unit 2 = harness follows). Refs #1322.
What
The player consumed
/combat-surfacelive (#1435) but only repositioned actors baked into the static scene — a token with no matchingActor_<id>GameObject rendered nothing, so only the campaign the scene was baked from showed a board.CombatSurfaceClientnow spawns the missing actor at runtime, mirroringpaint_combat_v1.cs's registry-resolved spawn, so any campaign renders.Spawn path (mirrors the editor donor, runtime-safe)
Slot lookup + default fallback per the registry invariant (goblin/hero kind-defaults + #1423 albedo nuance, resolved inline — not
AssetRegistry.Resolve, whose floor diverges to hero for unknown monsters) → load model from the bundle → #1397 SkinnedMeshRenderer pitch guard → #1418 bind-pose scale lock → idle pose (embeddedidleclip, else #1408 humanoid donor retarget) → ground+center on the engine cell → #1423/#1425 albedo → AO blob + selection-ring siblings. Renderer stays a pure consumer (reads engine cells + registry only; engine is the sole writer). Deterministic reconcile each surface: present tokens spawned/repositioned, runtime-spawned actors no longer present are despawned (baked actors never despawned).Packaging — the chosen mechanism (and why)
A player build cannot
AssetDatabase.LoadanAssets/path at runtime.BuildMacOSPlayer.EnsurePackaged()(runs first in the build; also a standalone MenuItem):StreamingAssets/worldos_actors— a StandaloneOSX AssetBundle of every registry-referenced model/albedo/idle clip, keyed by their exact registry path. The runtime loader passesregistry.model_refverbatim as the bundle key → zero path transform, so an asset swap stays a registry edit + repackage, zero renderer edits (the registry invariant). AssetBundle over Resources precisely because the bundle load key IS theAssets/...path already in the registry — Resources would force copying assets underResources/and mangling the path into a resources-relative key, breaking that invariance.StreamingAssets/registry.json— the manifest copied verbatim (the same filepaint_combat_v1.csreads), so the runtime SLOT resolution reads exactly what the editor bakes from.The editor capture path (
paint_combat_v1.cs,AssetRegistry.cs) is untouched → byte-identical captures. The runtime client parses the registry map-of-maps with a self-contained nested parser (MiniJson lives in the editor-only assembly, unavailable to a runtime MonoBehaviour).Validation (GEX44, Unity 6000.5.1f1) — evidence
qa/evidence/1436/Actor_*(Goblin→goblin exact,Aldric→alias fighter,Wren→alias innkeeper) spawned viaSpawnActorloaded from the bundle inStreamingAssets— all grounded, bind-pose scaled, idle-posed, with cyan/red rings + AO on the painterly plate (spawn1436_editortest.png).worldos_actors.manifest); 3 non-existent@moveset/audio paths correctly skipped.result=Succeeded totalErrors=0, Universalx64ARM64(build-report.txt); StreamingAssets (bundle + registry) verified insideWorldOSPlayer.app/Contents/Resources/Data/StreamingAssets/.~/worldos-session-notes/w5a-build/WorldOSPlayer.app.zip(overwritten) for local smoke against a live campaign with foes.Unit 2 (harness) needs
Drive the PLAYER window (native macOS app: screenshot/click on the window, not the browser) for the T3 blind-playtest quest loop. Launch the delivered
.appwithWORLDOS_ENGINE_BASE_URL+WORLDOS_CAMPAIGN_IDenv pointed at a live campaign with foes; assert runtime-spawned foes/party appear +/moveround-trips. Then run the T3 gate per #1322.