luvcraft/riding.lisp
Where the rider sits is art direction rather than physics, and it is settled by looking: these are parameters so that a live image can move the seat between two screenshots.
How far above the animal's own back the rider's eyes sit, in cells.
Measured from the top of the animal rather than from the ground, so a rider sits on whatever they have mounted instead of at a height which only suits a turtle.
How far back along the animal the rider sits, in cells: on it, not on its head.
How far a seated rider looks down, in radians.
Enough to keep the shell they are sitting on in the bottom of the frame and the ground the animal is walking over in the middle of it.
A player mounted on an animal, going where it goes.
The rider steers with the session's own movement intent. Going forward is going forward whether the player's legs or an animal's are doing it, so a mount reads the same urges the player controller would have read rather than keeping a second copy of them.
A turtle can be ridden. It is not fast, but it is willing.
Set the player on critter's back, at rest and standing on nothing else.
Stand the player beside critter somewhere their own box actually fits.
An animal can walk under a ledge its rider could not stand under, so getting off is a search for room rather than simply letting go. When nothing fits, the player is left where the animal is and the ordinary controller resolves it on the next step.
Let the animal have its own mind back, and put the rider down safely.
A rider is not editing blocks, and the mount owns the view: everything else that arrives while mounted is simply not for anyone.
Sit the rider on the animal's back, looking out over its shell.
The seat is a place on the animal rather than a distance behind it, so the pose is asked again every frame and the camera stays locked to a body that is walking: what the ride feels like is the animal's own gait and its own slow turns, not a camera trailing after it. The mount's sway rides along, and the easing which brings the view here on mounting is what smooths it.
Rein the animal, ride along with it, and get off if it is no longer there.
The animal is gone -- it wandered out of the world, or the population forgot it. Leaving the focus puts the rider back on their own feet and hands the camera back.
The seat's knobs, read every frame the rider is carried.
How far above the animal's own back the rider's eyes sit, in cells. Measured from the top of the animal rather than from the ground, so a rider sits on whatever they have mounted instead of at a height which only suits a turtle.
How far back along the animal the rider sits, in cells: on it, not on its head.
How far a seated rider looks down, in radians. Enough to keep the shell they are sitting on in the bottom of the frame and the ground the animal is walking over in the middle of it.
A player mounted on an animal, going where it goes. The rider steers with the session's own movement intent. Going forward is going forward whether the player's legs or an animal's are doing it, so a mount reads the same urges the player controller would have read rather than keeping a second copy of them.
One individuated animal walking the block world.
(critter session)Create and return a focusable interaction for targeted CRITTER, or NIL. The animal counterpart of ACTIVATE-LUVCRAFT-TARGET: an animal which can be mounted answers with the ride, and one which cannot answers NIL and is simply looked at.
A small, slow, deliberate animal with a domed shell.
(focus)Whether FOCUS moves the player itself instead of the player controller. A terminal on a wall leaves the player standing in front of it and the ordinary scalar controller keeps running. A mount does not: it carries the player, so the controller must stand down for as long as the interaction lasts.
(session critter)(player)(critter)(player)(critter)(player)(critter)(player)(player)(player)Where to try putting a rider down, nearest the animal first.
(session critter)Stand the player beside CRITTER somewhere their own box actually fits. An animal can walk under a ledge its rider could not stand under, so getting off is a search for room rather than simply letting go. When nothing fits, the player is left where the animal is and the ordinary controller resolves it on the next…
Test whether two compatible scalars are equal.
Addition over compatible quantities.
(body world x y z)(focus session)Notify FOCUS that SESSION has left its interaction mode.
(critter forward turn seconds)Ask CRITTER to walk FORWARD and turn TURN over SECONDS, as a rider does. FORWARD and TURN are wishes in -1..1, not velocities: what the animal makes of them is the animal's business, and one which ignores its rider simply has no method here.
(focus session canvas event)Handle EVENT while FOCUS owns SESSION's modal player interaction.
A native destination with a lifetime and frame clock.
(focus session)Return FOCUS's desired CAMERA-POSE in SESSION, or NIL for an FOV-only cue.
(critter)Return the lift and yaw a rider is swayed by, as CRITTER moves under them. An animal walking is not a platform gliding: whoever is sitting on it rides its gait. (VALUES LIFT YAW), both small and both zero for an animal which does not say otherwise.
(x y z)Multiplication and scalar scaling.
The 50-degree vertical field of view used during modal focus.
(focus session seconds)Let FOCUS take its own turn in SESSION's simulation, before the player's. A focus which only reads input needs nothing here; a moving one -- a mount, a vehicle, a cutscene -- does its own work in this method.
Logical negation of one test or raw truth value.
(session)(intent positive negative)(name (&key label (group :grading) documentation
(class ''scalar-knob)
quantity (type 'single-float)
unit-label minimum maximum step)
place)Define NAME as a knob of CLASS over the setf-able PLACE. PLACE may refer to SESSION, so a knob can live on the session -- its sky clock, its player -- as well as in a special. QUANTITY is a quantity plist as DEFINE-QUANTITY-CONSTANT takes, (:quantity ... :unit ...); it and TYPE make the knob's declaration, which…
Riding an animal. #W2E5HR is the design.
Mounting is the same session transition as reading a world terminal (#8JCMA5) and it deliberately feels like one: TAB enters the interaction with whatever the crosshair is on, shift-TAB leaves it, ordinary player input stands down for the duration, and the camera eases from wherever it was into the pose the interaction asks for -- the same easing, at the same rate, into the same narrowed field of view.
Two things make a mount different from a wall. Its pose moves -- the pose is a seat on the animal's own back, so it is asked again every frame and the view rides the animal's gait and its slow turns; and it carries the player, so the scalar controller stands down completely and the player's body is set on the animal instead of left standing where it mounted. That is what keeps chunk residency, checkpoints, and the return camera all following the ride rather than the place it started.