jengine-walker
A creature that walks on legs it places itself, and Stilt Fen.
| Kind | Project package: linked into the builds of the projects that list it |
| Source | packages/jengine-walker |
| Version | 0.1.0 |
| Entry point | jengine_walker::WalkerPackage |
| Script namespace | Walker |
| Listed by | projects/arcade-classics |
Using it
Section titled “Using it”List it in the top-level "packages" array of project.jengine:
{ "packages": [ { "name": "jengine-walker", "source": { "type": "path", "path": "../../packages/jengine-walker" } } ]}Then rebuild the editor viewport for the project (jengine viewport-build projects/<name>, or the
editor’s Rebuild viewport banner). Native and web builds link it on their own.
A scene that uses its components must be a v2 scene ("version": 2): a v1 scene has no field
for a package component and keeps it as inert custom data.
A script can check that the package is linked with if Walker == nil then return end.
Components
Section titled “Components”| Scene key | Rust type | |
|---|---|---|
fen_strider | Strider | package only: needs a v2 scene |
Script commands
Section titled “Script commands”Commands run in every runtime and return nothing; a package publishes what scripts read onto components (see the notes below). The flat name also works.
| Call | Flat name |
|---|---|
Walker.start(e, stage) | fen_start |
Walker.stop(e) | fen_stop |
Walker.drive(e, x, y) | fen_drive |
Walker.autopilot(e, on) | fen_autopilot |
Scenes that use it
Section titled “Scenes that use it”projects/arcade-classics/assets/scenes/stiltfen.scene
From packages/jengine-walker/src/lib.rs.
A creature that walks on legs it places itself - and Stilt Fen, the arcade’s long-legged strider crossing a marsh at dusk.
gait is the walk: a course drawn one column per character, a body the
player raises, lowers and pushes along, and legs that each choose where to
stand. It is pure and proved - every shipped stage is walked to the end
by its autopilot in a test.
This module is the creature’s body in the world, and it animates
nothing. The rig is authored in the scene out of the engine’s skeleton
components: a skeleton_root, bones chained by parent, an
ik_two_bone on the end of every leg and an ik_look_at on the neck.
Each frame the package moves the root and writes three kinds of number -
where each foot is (the IK target), where the neck looks, and where the
camera is - and the engine’s own solve_ik bends the knees to match,
after which one skinned_mesh on the root, skinned to those same bones,
is the hide. So what the rules say about a foot and where the foot is
drawn are one number, read by two systems.
The rig is read, not assumed: hip offsets are the thigh bones’ authored
positions and the leg lengths are their bone.lengths, so a scene can
reshape the creature without the package knowing.
One fen_strider on a manager entity: stages (see gait::Stage),
scale (gait::Scale), build (gait::Build), the rig by entity
name (RigNames), the camera entity’s name, and the art - atlas
and the region names in art.
Script commands
Section titled “Script commands”| Call | Does |
|---|---|
Walker.start(e, stage) | lay out a stage (0-based) and stand the creature at its start |
Walker.stop(e) | clear it |
Walker.drive(e, x, y) | the stick: x walks (-1..1), y raises and lowers |
Walker.autopilot(e, on) | let the tests’ autopilot walk it (1) or hand it back (0) |
What scripts read
Section titled “What scripts read”The fen_strider bag: stage, stages, name, hint, par, time,
stance (0..1 from lowest to highest), blocked ("", reach,
belly, branch, edge), caught, lights, progress (0..1 along
the course), finished, x, y (the body), and events (step -
with wet - caught, blocked and finished - with time, caught and
demo, true when the autopilot was walking).