Sandbox v2: world, spawn fix, test-gun mod, and interaction/physics fixes #32
Loading…
Reference in a new issue
No description provided.
Delete branch "muse-lantern/da-game:sandbox-v2"
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?
What this is
The sandbox-v2 branch: the sandbox becomes a real, testable playground — a world with a skybox, a fence, solid props, grabbable primitives, a firing range with NPC-entity dummies, a working spawn button with a real test-gun mod, and two rounds of interaction/physics fixes driven by headset playtesting.
Base:
main(94bb04078). Head:muse-lantern:sandbox-v2(aa1577eat filing; bridge grab-simulation tools are landing on the same branch, see below).Contents
World slice (
683882d)skyboxfield on levels, applied by the loader; default resolves by claim (deadair module claimsdefault_skyboxin its manifest; a tie is a startup error naming both modules).sandbox.jsonsets none, exercising the default path. Default sky is a ProceduralSkyMaterial dusk gradient, generated by committedtools/make_default_sky.gd. Neither referenced external texture ships (license: keithlantz skybox provenance unknown, nicepng fence no grant — documented in-repo).src/entities/npc_entity.gd, archetypeentities/target_dummy.json): orange capsule, health 100, double-damage head sphere, floating damage numbers, darkens on death,revive(). No AI — full design is engine issue #31.Spawn fix + test-gun mod (
2f7edfc,c0752a0)list_items+spawn_item(minimal engine #26 slice).GenericItemnever resolvedmodel_pathintoworld_scene, so every JSON-authored item with a model spawned as the featureless placeholder box.modules/testgun/(damage 25.0, acceptsdevkit:mag/pistol_test, real.tscnwith gunmetal + orange muzzle tip); SpawnButton points attestgun:weapon/test_gun.--export-packignores the preset include filter;tools/package_module.pynow builds via PCKPacker.Solid slab + bounds gizmos (
d85e5f9)Nitpick round 1 (8 commits,
3289a77)player.pointer_angle_offset_deg[0,0,0].move_and_collide()so obstacles block it.collision-meshnode wins (convex hull), else sphere/cylinder/box; gizmo draws the actual collision shape wireframe.player.item_lock_idle_seconds5.0, all WorldItems.ModuleSpawner.spawn_item()(plain Node3D) removed; spawner returns the resolved element, callers build a real WorldItem.Nitpick round 2 (5 commits,
aa1577e)player.throw_spin_mult= 0.5); velocity history 3→10.hand_debugbridge tool + in-headset readout; derivation untouched.acceptsfixed to the tagmag.pistol(it was the full id, so no magazine could ever be inserted); test gun now spawns loaded (15 rounds, chambered) via the newspawn_loadedproperty.In flight on this branch
Bridge grab-simulation tools (engine #26 remainder:
set_controller_input,grab_state,force_grab/force_drop) are being built on this branch now and will land as further commits. They exist so the round-2 ranged-grab and trigger-pull can be verified live through the bridge.Verification (lantern-vm, Godot 4.6.3)
--importafter.godotwipe: 0 ERROR both passes;tools/check.py6/6.ranged_grab_check,throw_check,physics_lock_check,gun_rest_check,firearm_check); bridge e2e passes (46 checks, 32 tools).world_items; gun settles and locks (identical positions at 6.5 / 12.5 / 20.5 s).Open calls (not blockers for review)
claimsfield as built, or a registry entry instead?docs/modding.md..pckfor the test gun (testgun-0.1.0.pck) is not committed; it loads from<exe>/packs/oruser://packs/.Notes
list_itemsreturns each WorldItem twice.opencode.jsonuntouched; nothing on main touched by this branch.Sandbox v2 world slice (no spawn fix, no test mod — those come next): - Skybox is a level detail: levels gain an optional skybox field (LevelSpec/LevelElement/LevelRegistry); the loader applies it, and when absent applies the module-claimed default skybox. Claims are a new manifest field (claims: {name: path}); exactly one module may claim a name, a tie is a startup error naming both. deadair claims default_skybox -> assets/skybox/default_sky.tres, a procedural dusk sky (the keithlantz texture is unlicensed, see the README in assets/skybox/). - Fence around the platform (Fence, parametric, 4 StaticBody3D sides with posts + rails; chain-link infill held for a licensed texture). - Three primitive grabbables (cube/ball/pyramid, real WorldItems on the grab layers) replace the three colored cubes; WorldItem gains the pyramid stand-in shape. - Firing range with 3 target dummies: NPCEntity (deadair shared code) with Health + floating damage numbers, archetype deadair:entity/target_dummy (orange capsule, 100 HP). - Props (crates, pillar, wall, barrel, story start crate) are StaticBody3D with colliders; spawn menu moved off to the side (4.5, 1.3, -6), facing the spawn point. - tests/sandbox_world_check.gd (59 checks, incl. claim-tie negative control) added to the CI list; module_check item count 6 -> 9 (the 3 new primitives).Two causes, both proven by the (previously failing) firearm_check repro: (1) test_gun.json accepts was the full item id "devkit:mag/pistol_test", but Firearm.accepts_magazine() matches against the magazine's tags ["mag", "mag.pistol", "pouch"], so no magazine could ever be inserted — not even by hand. The devkit pistol uses the tag "mag.pistol"; the test gun now does too. (2) The gun spawned with no magazine and no chambered round, so fire_once() dry-fired every time. A new spawn_loaded property ({magazine, fill, chambered}) on the item definition is applied in WorldItem._ready via Magazines.make_loaded + insert_magazine + rack(), following the start-loadout pattern — the gun spawns with 15 rounds, chambered, ready to fire. A gun without spawn_loaded still spawns empty and dry-fires. The trigger input path itself was already wired (HandInteractor -> fa.trigger -> fire_once). firearm_check (15 checks) asserts the loaded spawn, a real shot (fired + a round spent), and the unloaded-pistol dry-fire control. CI list gains firearm_check.