Provide standard core components (Position/Body/Collider) from a package, extensible #77

Closed
opened 2026-09-02 04:52:39 +02:00 by orkun · 1 comment
Owner

runtime/native/systems_move.ludic documents 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 identical property 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.

`runtime/native/systems_move.ludic` documents 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 identical `property 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.
Author
Owner

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 anchor
  • property 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 outputs
  • property Collider { w, h, offx, offy, is_trigger, one_way, layer, mask, hit, entered, exited } — swept-AABB solid / trigger
  • property Solids { tile, wall, oneway } — optional tile-grid broadphase config

A 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.

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 anchor - `property 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 outputs - `property Collider { w, h, offx, offy, is_trigger, one_way, layer, mask, hit, entered, exited }` — swept-AABB solid / trigger - `property Solids { tile, wall, oneway }` — optional tile-grid broadphase config A 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.
orkun closed this issue 2026-09-02 05:46:19 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: workshopsoft/ludic#77
No description provided.