Provide standard core components (Position/Body/Collider) from a package, extensible #77
Labels
No labels
area:ci
area:docs
area:input
area:net
area:rendering
area:repo
area:stdlib
area:tooling
area:types
cleanup
dx
priority:high
priority:low
priority:medium
proposal
status:in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: workshopsoft/ludic#77
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?
runtime/native/systems_move.ludicdocuments Position/Body/Collider as the "shared" components the move system reads by name, but no package defines them — every game and every example re-declares identicalproperty Position/Body/Collider. Game developers should not hand-write engine-ABI components.Proposal: ship them from a base package (ludic.gameplay or a new ludic.core) as the canonical definitions, importable and extensible via composition. Games import instead of copy-pasting.
Seen: examples/games/*_demo.ludic and an external game all duplicate these verbatim.
Shipped in
5af5bdd.Added the ludic.core source package with the canonical engine-ABI components the movement system (esys_move, #65) reads by name:
property Position { x, y }— integer-pixel world anchorproperty Body { vx, vy, gravity, max_fall, rx, ry, policy, on_ground, hit_wall, hit_ceiling, hit_nx, hit_ny }— Q16.16 velocity + engine-owned sub-pixel accumulators + polled contact outputsproperty Collider { w, h, offx, offy, is_trigger, one_way, layer, mask, hit, entered, exited }— swept-AABB solid / triggerproperty Solids { tile, wall, oneway }— optional tile-grid broadphase configA game now
import "ludic.core/components.ludic"instead of re-declaring the bundles, and the engine moves/collides its entities for free. Because Ludic is AOT, the properties compile straight into the consumer's compile-time ECS with no ABI seam, and everything stays integer + Q16.16 deterministic (lockstep / replay / world_save hold). Extend by composition — attach your own components (Health, Sprite, an AI brain) on the same model; nothing needs subclassing.Verified with
examples/library/core_components.ludic(imports the package, drives esys_move, composes a game-defined Health component) wired as a controller_case — full suite 104/0. Docs table updated in docs/CONTROLLERS.md.