Idle people
Skill ferret-micromotion · download all skills · SKILL.md
When to use#
People of a scene who are not the player and not in a scripted animation, and who must never stand like posts: bystanders, a crowd that waits, someone who sits and watches, someone who holds a camera or a prop. Not for the player's own movement (ferret-character), not for walking by a NavMesh (ferret-ai-navigation, which the module only hands over to), not for making the figure (ferret-humans).
The model#
A person is a profile (JSON: temperament, repertoire, props, anchors, interests, reactions) and a seed. sim is pure numbers in the fixed step and decides everything (activities, gaze, blinks, walks, reactions); applyMicro puts the result onto a humans rig pose in the frame. The same seed gives the same choices on every peer and in the UE build.
Steps#
const micro = new MicroSession();micro.spawn(id, 'bystander' | yourProfile, seed, { pos, facing })(the place becomes his anchor);micro.setTarget({ id, pos, tags })for what may draw his eye.- In
onFixedUpdate:micro.step(dt);micro.attach(world.events)so blasts, impacts, fires and take events reach him. - In
onUpdate, per person: a base pose from a clip (Idle, orWalk_Fwdwhenout.moving), thenapplyMicro(rig, pose, person.out, person.profile, { time, seed, lod, seatHeight, clips? }); draw the pose, and givereport.faceto the face. - Levels:
micro.assign([{ id, px: screenHeightPx(1.8, distance, fov, screenPx) }]), pose byposeLevel(lod)(crowdandoffare not posed). - A line:
say(person, { text, duration, shout }). A profile of your own:validateProfile; shipped ones:profile('name')returns a copy. - His own AI (habits: seated leg swing and head turns, standing weight shifts, blinks; rates from the temperament):
micro.mode,micro.habit,micro.temper,micro.do,micro.goto,micro.explain. - The motion language:
linkMotion(micro, bridge)first, then(micro-walk who x y z)and the othermicro-*words andmicro:*events (reference: the guide). - Far planes:
bakePersononce at creation, thenposeOf(...)per frame (near is live; middle and far play the loop at rest). - Look with the
micro.*commands (micro.inspect,micro.log {times:true},micro.stimulus) and the?microviewer (node tools/build.mjs viewer;micro.stage,micro.camera,micro.screenshot,micro.capture).
- In a crowd simulated elsewhere: guide section "In a simulated crowd" (bone offsets per render, relaxed hands, no cuts).
Check afterwards#
micro.log {id, times:true} shows a choice every few seconds and never a long gap; a stimulus gives a glance first and a reaction 0.15-0.3 s after it; two persons with one profile and different seeds never move in step; the viewer's screenshots show hands on their props and feet on the floor.
What usually goes wrong#
(micro-walk ...)as an argument fails: a lasting word is a statement;(seq (on ev ...) (wait t))losesev: add a form afterwait.- A person walks back to a default place: he was spawned without
pos; give the place, it becomes his anchor. - Everyone looks at nothing: no gaze targets; add some with tags that his
interestsname. - Nothing reacts to a blast: it was too far (
heardStrengthfalls with the square of the distance past the kind's half distance), or the person has no reaction for that kind in his table. - The pose does nothing: the base pose is not the humans rig's, or the level is
crowd/off(not posed).
Files#
reference/micromotion.md— People who are never still. A profile and a seed give a person who gestures, looks about, fidgets, walks about his place and reacts to blasts and impacts; deterministic, with levels of detail, micro.* commands and the ?micro viewer.reference/api-micromotion.md— every export of@ferret/micromotionwith signature and doc commentreference/api-micromotion-2.md— every export of@ferret/micromotionwith signature and doc comment