Editor addon: in-editor authoring for modded item JSONs (staging scene, colliders/markers, sliders, simulation) #35
Loading…
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?
Status
Tracking issue, planning only. Awaiting Zach's go-ahead — no build authorized.
Prioritized over the Blender addon (game-planning #31), which waits on the tagging standard (deferred) and tag storage / catalog source (open). Full plan:
dead-air-editor-addon-plan.md(Lantern's working copy).Goal
A Godot editor addon for building modded item JSONs. Today an item is a hand-written JSON (
modules/*/items/*.json) full of bare[x, y, z]arrays — muzzle, mag well, grip offsets, openings — and Zach patches them by hand (e.g.8aa6b7b: grip_rotate values edited directly in JSON). The addon replaces hand-editing with a staging scene: load a model, position it, place the points and parts visually, and the addon writes the JSON.The addon is schema-driven, not hardcoded: it reads the item schema (the type tables) and builds its forms from that, so it adapts when a field is added or renamed instead of rotting. It writes JSON with tab indentation. JSON is the standard output; TSCN is also useful for some things (possibly advanced code-bound actions) — TBD what.
Capabilities
1. Staging scene: a model loads in to be positioned
Staging scene in the editor with the 3D viewport (a custom scene is fine if one is required). The author picks a model (GLB /
.tscn) and it loads into the item's frame, positioned around the grip frame (the primary grip pose — the reference the whole item hangs off). Shows the procedural stand-in too, so an item without art is authorable the same way as one with a model. The staging scene is a working file, not shipped — the JSON is the output.2. No-render colliders and markers
Markers (the
gun_*namespace; later expandable):gun_muzzle,gun_mag_well.{a,b},gun_grip,gun_foregrip,gun_slide(slide and bolt for now),gun_mag_release.{a,b}.Rails: a rail is two references (A and B) at pos/rot, and the part slides on a virtual rail between them. The slide rides one; the magwell is one (mags slide in from the bottom, outside end
bto inside enda). Rail visuals: two gizmos at either end with a holographic visual line between them.Colliders: they need to show rotation using the gizmo, aligned to the editor's own editor gizmo, so all offsets are visualized in the space in which Godot will handle them relatively. Expand the debug bridge so you can see these at the same time (editor view and in-game view match). Physics collider: the author defines their own in the editor, or uses one from a GLB / convex mesh. Current test pistol/rifle have a "total volume" box collider, not refined to the gun shape — Zach will add new rifle + pistol models and do this part himself to find gaps in the modding system (the way he found the need for
grip_rotate).Internal mags: some guns later (revolvers, shotguns, certain rifles) will have an internal mag, so there needs to be a way to set that up. The code path is already clear (a mag is an
ItemInstancechild of the weapon; the one gap is aninternal: truemarker soeject_magazine()refuses). Loading an internal mag is the open design question.3. Sliders, model states, and events
Sliders — an articulated part (slide, charging handle, pump): which node, the axis and range of travel, bound to an action. The binding is data (
{node, axis, range, action}); when the slider reaches its end it fires the action, and its position along the travel is readable by the game. Optional per item.Model states — safety / firing mode is a model state that changes visually if set up, and it is the same system as the fire select. For an AK: single, auto, safety. A state constrains other actions — on an AK, safety means the bolt can't be pulled all the way back.
Event list — the binding surface. These trigger actions in the gun via code, beyond generic "play sound X":
trigger,fire select,rack,jam,mag,chamber,mag eject,mag insert,misc_slider,misc_event.4. Light simulation: ranged tests with recorded states
Stretch goal, if possible. Fixed rig, a few ranged tests, results saved to a text file / JSON, headless AND editor options. Weapons placed and "loaded" with instructions — a test script: attempt insert bullet of X into mag of Y, then attempt insert mag of Y into gun of Z, and cycle event tests. Records animation states; screenshots saved and base64-encoded into the file for each state. Builds on the sandbox target dummies and the debug bridge e2e. "Light" means it checks the weapon logic and the bindings, not the feel.
Mag rail behavior (design, for the rebuild — NOT built)
The magwell rail changes the mag insert/eject interaction to a two-stage slide along the rail:
b, outside) but is not removed from the player's hand until the player slides the mag up the rail to the inside end (a).b) — until the player grabs it.Phasing (each phase usable on its own)
Still open
Closing: the editor addon work tracked here is built and merged — PR #41 (merge commit
a5838000d4). Phases A+B, dock, gizmos, reference slots / editor metadata / slide simulation (#38), magwell coupling, tiered assembly, assembly carry-through, rotation fixes, scroll fix, generic gun models, grip fix, gun fixes (#40), collider one-row fix. The branch is on main.