Skip to content
NickMarchaPublic

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SporeTest

A creature editor with a live implicit skin, recursive limbs, automatic binding, and pose previews. Rigging and pose evaluation run independently of the renderer.

Run

Use Node 26.7.0, recorded in .nvmrc. With nvm-windows, install and select it explicitly:

nvm install 26.7.0
nvm use 26.7.0
npm ci
npm run dev

Open the local URL printed by Astro, normally http://127.0.0.1:4321.

Drag a vertebra in the viewport or select one in the sidebar. Adjust its radius and position, add or remove vertebrae, and use Undo or Redo to revisit edits. Drag empty space to orbit; scroll to zoom. Frame creature fits the current skin into view. Save recipe downloads the base creature and ordered mutations as JSON. Load recipe reads one back: the file's base becomes the document base and each saved mutation becomes an Undo step, so saving again round-trips the file. A malformed or unreplayable file is reported and leaves the current creature alone.

Choose Leg or Arm above the viewport, move over the skin to see the ghost, then click to attach. Legs default to a mirrored pair; arms default to one limb. Toggle Mirror for either tool. The dashed centre line marks where placement snaps to a single central limb. Escape cancels placement. A successful click returns to Shape mode, and a pair is one Undo step. Mirrored limbs stay linked when you drag points, edit sockets or radii, and add or remove segments. Select Unlink pair in the Limbs sidebar for asymmetric edits. Removing a linked limb removes both sides.

Drag limb points directly in the viewport, including on branches. The Limbs sidebar keeps precise segment positions and radii, segment insertion/removal, and socket offsets. Segment coordinates are in socket space; socket offsets are in the parent source's frame. Removing an attachment source removes its dependent limbs, and Undo restores them. Tip caps label future animation targets; they do not add foot or hand meshes.

Enable Preview pose to bend the bound skin. Limb flex rotates each limb bone independently of the spine bend. Sweep through the bend animates a four-second cycle. Shape controls are disabled during preview; turn it off to edit again. Weight smoothing compares raw provenance with adjacency-smoothed binding and reuses the existing skin. Posing and smoothing are diagnostics and are not saved in recipes.

Choose IK above the viewport and drag the orange head or tail target to pose the spine. Feet and graspers also get targets when attached. The spine responds first, then limbs reach from its posed attachment points. The head drives the root; unreachable tail or limb targets remain visible beyond the creature's reach. Each target moves independently, including targets on mirrored limbs. Limb segment lengths stay fixed; the spine permits bounded compression and stretch between its solver particles. Choose Shape to return to the authored creature. Preview IK in the sidebar controls the same mode. Target movement does not remesh, create Undo steps, or alter the recipe.

Choose Stand after adding feet to inspect static floor contact. The controller uses the generated foot skin to place targets on the grid floor, then adjusts body height and foot targets. Green rings mark contact within one centimetre; orange rings mark a miss. The viewport reports the contact count and largest vertical error. The floor stays fixed while posing. Shape restores the authored creature. Standing is not balance simulation or walking, and unusual creatures may have unreachable contacts.

The status bar reports worker meshing time, triangle count, actual grid cell size, and completed builds. Camera motion, selection, colour changes, posing, and smoothing do not trigger meshing. Binding has a separate timing display. Timings exclude transfer and rendering, so they are not end-to-end input-latency measurements. GPU reduction reports the greatest fraction of weight discarded at a vertex when packing four influences for Three.js.

Verify

npm test
npm run typecheck
npm run build

Tests use Node's built-in runner and TypeScript support. Run individual core files with node --test src/field/field.test.ts, for example. typecheck covers all TypeScript, including the client bootstrap and worker; Astro builds the page shell.

Visual checks should include dragging, undoing a whole drag, changing radius, inserting and deleting vertebrae down to one, orbiting without increasing the build count, and inspecting wireframe and skin detail. Watch a full bend sweep, compare raw and smoothed binding, and confirm that these operations leave the build count unchanged. Browser control requires permission under AGENTS.md.

Architecture

creature/ owns plain data and recipe mutations. field/ compiles the spine into compact spherical contributions. mesh/ samples the field and adapts surface nets into typed arrays with provenance and field normals. rig/ derives bones and sparse weights; anim/ evaluates poses and provides a CPU skinning reference. render/ owns Three.js and GPU skinning; editor/ owns inputs and the worker lifecycle. Astro mounts the application once.

Meshing and binding run after edits, in a worker with one active request and one replaceable pending request. Smoothing changes only rebind. The frame loop evaluates preview poses into reused buffers, updates the camera, and draws. The grid currently remeshes in full. Its sample budget can coarsen unusually large creatures and lose thin features; the displayed cell size makes that limit inspectable. surface-nets needs a browser Buffer dependency and a build-time global alias, configured in astro.config.mjs.

Separate attached meshes and gait are not implemented yet. Spine IK uses reduced particles, quintic reconstruction, and angular anti-buckling. Limb IK implements aim preconditioning, shared branch particles, and rigid length correction. Constraint tuning, orientation goals, and secondary motion remain future work. Sockets start on the picked skin. Mirrored placement uses the fixed left/right plane, and the saved link reflects subsequent edits across that plane. Unlinked sockets keep their authored offsets. Close limbs can web together in the shared field. The pose previews exercise binding; they do not prove automatic locomotion. Read CONTEXT.md and the ADRs before changing these contracts.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages