DEV Community

Cover image for Kinewright Humans: a step planner for starts and stops
Dimon
Dimon

Posted on Originally published at dimonb19a.hashnode.dev

Kinewright Humans: a step planner for starts and stops

The first Kinewright engine now answers a command at the next step instead of at the end of a clip. This article shows what the stage adds, the numbers it stands on, and the limits it keeps on purpose: inside a transition a command still waits for the clip, and the stage says so with its figures.

What this stage adds

  • A runtime substrate under the page: a fixed tick of 120 Hz, commands as tick-stamped events, a journal of them, seeded random streams and a byte-for-byte replay. The same journal gives the same bytes in two processes, and the same platform-stable digests on two machines of different architectures.
  • A step planner as the way a command is answered. A request is laid out at the next touchdown of either foot, in the frame of the clip it continues, and the five transitions — the start, the stop from a walk, the stop from a run, walk to run and run to walk — are laid out inside the accepted clips and held to them. Every script of the review set stays inside the accepted clips' height bands, with margins of 10 mm at the pelvis and the hips and 15 mm at the knees and the ankles.
  • The steady walk at 1.0 m/s and the steady run at 4.5 m/s are the accepted clips byte for byte, and so is the entry into the run: the accepted walk-to-run clip, entered at its own entry foot. Earlier builds of this stage composed that entry from the planner's steps; the composition brought a crouch and a kick nobody accepted, and the stage ended with the clip instead.
  • Creation and the pose stay cheap on the planner's path: an actor is created in under 0.1 s and posed in about 0.3 ms per frame on an Apple M1-class machine, by the cost probe, and in under 0.2 s and about 0.8 ms on the second machine; the bars are 1 s and 6.75 or 10.91 ms.

How it answers

  • From walking, a stop begins to brake in 0.417 s and stands in 1.658 s. From running, it stands in 4.458 s with no walking step between the request and the hold. Visible motion after a released stop begins in 0.399 s.
  • A tap of the walk key — released and pressed again three ticks later — gives exactly one step and the closing foot.
  • A run requested in the steady walk enters the accepted clip at its entry foot, the left; a request that meets a right touchdown walks one more step, at most 0.95 s.

What it keeps waiting for, on purpose

Inside a transition the clip's structure decides when a command is answered. Every case is recorded with its number and its price for the speed stage, where transitions become laws of speed instead of clips.

What you see or might expect What happens Number Changes at
A stop pressed right after the start lifts a foot held to the start's settled touchdown up to 3 touchdowns, 1.51 s the speed stage
A run pressed again while the run is already ending held to the hand-over into the walk up to 8–9 touchdowns, 4.2 s the speed stage
A run pressed in the first two steps of the start laid out at the start's third touchdown up to 2 touchdowns, 1.65 s the speed stage
A stop inside the end of the run, from its last braking touchdown held to the walk's stop up to 3 touchdowns the speed stage
A stop or a released shift inside the walk-to-run clip, from its first step held to the clip's hand-over, as the accepted actor holds it up to 5 or 7 touchdowns; 2.18 s and 1.52 s in the review set the speed stage
The feet on the run's exit arrive rising three braking feet come down still moving up +0.47, +1.08, +0.35 m/s the speed stage
The transitions themselves take their time they are accepted clips played whole 3.1 s walk to run, 4.8 s run to walk, 2.5 s start the speed stage
A jump not in this build; hidden — a later stage

What comes next is the speed stage: speed as the single input, the walk's and the run's parameters as curves from admitted data, and the stance half of the gait judged against that data. The held windows above and the clips' own lengths are its first input.

Top comments (0)