[Phase 5.5 spirit] Spawn at look-point increments Population counter but no spirit sphere is visible in the rendered viewport #15
Labels
No labels
blocked:needs-attention
blocked:needs-decision
blocked:needs-decompose
blocked:needs-design
blocked:needs-triage
blocked:unclassified
bug
documentation
enhancement
gsd-spec
in-progress
needs-decompose
priority:high
priority:low
priority:medium
quickfix
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/veilwalkers#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The Spirit entity (Phase 5.5:
data/entity_defs/spirit.json, color#c8b4ff, shapesphere) successfully loads into the Creation Toolkit's entity registry — the detail panel shows the correct purple swatch and "Spirit — shape: sphere" label — and Spawn at look-point instantiates it server-side (Population counter incremented 137 → 265 in one click). But the spawned spirit is never visible in the rendered 3D viewport from the default camera. The admin can't see what they spawned.Environment
Mark/veilwalkersSteps to Reproduce
Expected
A new purple/violet sphere appears in the world, visible from the default camera. The spirit's
look_pointposition is the camera's forward-ray hit on the ground plane, which from the default camera at(0, 0, 0)looking-Zshould be in front of and slightly below the camera (e.g. world position(0, 0, -5)or so).Actual
No purple/violet sphere is visible in the rendered viewport across multiple screenshots after the spawn. The world shows the same 4-5 sample entities (mana_crystal, reed_plant, wander_beasts) that were there before the spawn. The Population counter went up but the visual artifact of the spawn is missing.
Possible Causes (in order of likelihood)
(0, 0, 0)and the look-point math uses the world origin, the spirit may be spawning at(0, 0, 0)— inside the camera or behind it. Spawning at world origin would also collide with the existing mana_crystal at(0, 1, -6)and could be occluded by it.far = 4000so this is unlikely unless overridden.coloris being applied to aMeshInstance3Dwhose material overrides the swatch color. If the spawn path uses a default material (e.g. white StandardMaterial3D), the spirit would render as white instead of purple. But it still should be visible.scalefield; check what the actual spawn uses.add_child()on the spirit's MeshInstance3D, so the instance exists in the population counter but is orphaned in the scene tree.Why This Matters
Suggested Investigation Path
print(spirit.global_position)andprint(spirit.scale)immediately after the spawn in the toolkit's spawn handler. Compare against the world camera position.MeshInstance3Ddebug sphere at the spawn position with a bright debug material, see if it shows up.def_id == "spirit"resolves to the correctentity_defs/spirit.jsondef at runtime (not the Phase 0 placeholder).scriptfield that the spawn path tries to attach and that script throws, the spawn may roll back the visual creation while still incrementing the population counter.Closed by
7256c2b. Root cause: WorldEditCommands._apply_spawn ran EntityRegistry.spawn_entity which set is_manifested=false on the SpiritComponent (presence mode = no body per the SpiritComponent contract). The mesh existed at the correct position but the spirit had no body, so admins only saw the Population counter tick up.Fix: after EntityRegistry.spawn_entity returns, _apply_spawn now sets is_manifested=true and current_power=max(1, current_power) on the spirit component when def_id == 'spirit', and tracks the entity in SpiritPopulation. The scripted summon_spirit() path still wins because it sets these explicitly after on_attach.
Tests: tests/unit/test_spirit_spawn_visible.tscn exercises the full path (controller.dispatch_edit → WorldEditCommands.apply → EntityRegistry.spawn_entity) and asserts is_manifested==true, current_power>=1, SpiritPopulation.count()==1, and (with --rendering-driver opengl3) counts purple pixels in the rendered viewport. All 8 unit tests still pass.