Skip to content

Vary Huginn's fly-in, and let him soar - #24

Merged
craig-o-curtis merged 3 commits into
mainfrom
chore/23-vary-huginn-entrance
Nov 12, 2026
Merged

craig-o-curtis merged 3 commits into
mainfrom
chore/23-vary-huginn-entrance

Conversation

@craig-o-curtis

@craig-o-curtis craig-o-curtis commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Huginn's first fly-in always came from the top-left and mostly circled back to the left. He also flapped almost the whole way. This PR varies where he comes in and how he leaves, and has him glide and soar much more.

Closes #23

What changed

The changes are in apps/site/src/scripts/aurora.raven.ts, apart from one in the worker (last bullet).

  • In anywhere along the top edge. Each fly-in starts at a random place along the top, from left to right (ENTRY_SPAN). It is at least a quarter of the edge's width from the last one's place (ENTRY_APART), for example after a sky switch.

  • Mirrored swoop. The dive past the cards runs toward the far side from where he came in. From near the middle it goes either way. It dives through the first card on his way across, through the part of it ahead of him, so on a wide screen (cards side by side) it never dog-legs.

  • Four ways out. On past the far side, a new rising exit out past the far side high up, on into the background, or circling back. They are weighted, and circling back is the rarest.

  • Rising air in the glide model. fly() adds an updraft (UPDRAFT, 1.2 m/s, a little more than his sink rate at best glide), so he holds his speed without flapping. When he does flap, it is in bouts of at least 0.8 s (FLAP_BOUT) instead of a single beat each time he drops to stall speed. On a climb he trades speed for height first and only flaps once he is down to best glide speed.

  • Flapping follows the model. A flown path records where it needed thrust (Path.working), and the wings beat exactly there. This replaces the guess from his speed.

  • Fly-in rhythm. It opens with the original slow, deep wingbeats, then glides for longer (4–8 s between short bouts).

  • More soaring flights. Half of the ordinary passes are soaring, with the spread-wing pose and a slower speed. Circling flights are 40% of later flights, up from 30%.

  • Worker: reveal direction. Until it has measured his heading, aurora.worker.ts now takes it from the start of his flight line instead of assuming down and to the right. A box he reaches on his first frame then sweeps in the way he is flying. It still reveals each box when he passes over it or when he is closest to it, wherever he enters.

Validation

  • pnpm lint, pnpm format:check, pnpm check and pnpm build pass.
  • Simulated the planner headlessly: 300 flights of each kind on the Ísafjörður camera, at 16:9 and on a phone.
Before After
Where the fly-in enters (left / middle / right third of the top edge) left only about a third each
Fly-ins that turn back across the screen 50% (16:9), 64% (phone) 24%, 24%
Time flapping, fly-in 87% 38–43% (much of it the opening wingbeats)
Time flapping, later flights 37% 17%
Median fly-in speed 6.7 m/s (stuck at stall speed) 8.6 m/s
  • Dog-leg check (review fix): 300 fly-ins at 16:9 with the cards side by side. Dives that swing back by more than 0.15 across the screen before the low point went from 10 at 5934341 to 0.
  • Still to check by eye: entries across the top on a wide and a tall screen, and the reveal order as he crosses the cards.

He now comes in over the top edge at its left, middle or right, or in from
either side, and never the same edge twice running. The swoop is mirrored
to match, and he leaves on past the far side, rising out of frame, into the
background, or (least often) circling back.

He also flaps far less. The glide model has rising air under him, flaps in
bouts rather than a beat each time he slows, and trades speed for height
on a climb before working for it. The fly-in opens with slow wingbeats,
then glides. Half the ordinary passes are soaring.
The side entrances halfway up are gone. Each fly-in starts at a random place along the top edge, at least a quarter of its width from the last one's, and heads toward the far side (either way from near the middle).
@craig-o-curtis craig-o-curtis added the enhancement New feature or request label Nov 12, 2026

@baldurpan baldurpan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 5934341.

The glide model changes hold up as far as I can follow them. The updraft settles level flight at about 10 m/s instead of speeding him up without limit, working lines up one-to-one with points (and keptClearOfSkyline carries it through ...path), and the homecoming's straight run-out pads working to match.

Two things about how the new entry side reaches the rest of the fly-in, both visible on a wide screen, and one comment left over from the first commit. Details inline. I haven't watched it in a browser, so the by-eye checks in the description are still to do.

Comment thread apps/site/src/scripts/aurora.raven.ts Resolved
Comment thread apps/site/src/scripts/aurora.raven.ts Resolved
Comment thread apps/site/src/scripts/aurora.raven.ts Resolved
Until the worker has measured his heading, it now takes it from the start
of his line, so a box he reaches on his first frame sweeps in the way he is
flying rather than always down and to the right.

The fly-in dives through the first card on his way across, through the part
of it ahead of him. On a wide screen the cards sit side by side, and
diving to the left one before swinging right made a dog-leg.

Two comments still described the side entrances and a fly-in that repeats
its line.

@baldurpan baldurpan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 275b01a. All three threads are fixed and hold up in the new diff: the first sweep follows his line, the dip runs one way on side-by-side cards, and the comments match the code. CI is green. Still to do by eye, as the description says: entries across the top on a wide and a tall screen, and the reveal order as he crosses the cards.

@craig-o-curtis

Copy link
Copy Markdown
Contributor Author

🐦‍⬛ KRAA! KRAA! 🐦‍⬛

Caw caw, @baldurpan. Huginn thanks you for the sharp eyes. Krruk. 🪶

🐦‍⬛ flaps once … soars … soars … 🌌

Kek kek kek! 💩 splat on the dog-leg. 💩 splat on the old comments. 💩 splat on the down-and-to-the-right sweep.

Caw. 🐦‍⬛🐦‍⬛ Off to watch him fly in a browser. 🪶

@craig-o-curtis
craig-o-curtis merged commit ed40087 into main Nov 12, 2026
1 check passed
@craig-o-curtis
craig-o-curtis deleted the chore/23-vary-huginn-entrance branch November 12, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vary Huginn entrance

2 participants