Fly a seat nobody is in, and hand it over when someone arrives (milestone 9a: AI backfill) - #31
Merged
Merged
Conversation
A host's seat with no peer flew a neutral stick in a straight line — before anyone joined, or after a player dropped, forever. Now the seat's autopilot flies it from the same RunSnapshot a scripted pilot gets, through the same seat admission a peer gets, seeded per seat so a seed replays the same match. A peer that arrives takes the seat over mid-flight, ramping from the throttle the autopilot held so the hull does not lurch; one that drops hands it back. simcheck: a peer-less seat scores hits, never leaves the arena, replays from its seed, holds still with backfill off, is taken over without a shot from the autopilot after or a jump across the handover, and is handed back on a drop (618 -> 628). Five mutants on the takeover, the hold, the trigger and the steer. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Stephen DeLorme <stephen@d.elor.me>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Milestone 9, part A. A host's seat with no peer in it used to fly a neutral stick in a straight line — before anyone joined, or after a player dropped, forever: a ghost the squadron shot for free, and the thing your ship on the host turns into the moment the link drops. Now the seat is flown.
What it does
src/game/autopilot.ts— the pilot of a seat nobody has taken. A proportional controller with a seeded jink that steers from the sameRunSnapshota scripted pilot gets (bearing and range to the lock, hull, heat, pod bearings): fires down its nose inside a 0.35 rad cone within 900 units, opens the throttle beyond 260 and backs off inside 170, wanders while closing so two wingmen do not fly one line, detours to a repair pod under 40 % hull, turns hard off the star, and circles at cruise when nothing is locked rather than flying out of the arena. It sees nothing a console cannot and produces the sameControlsa keyboard does;aimis null andspreadis zero and seat admission drops them anyway. It is notEnemyPilot, and it is meant to hold a seat rather than win the match for whoever takes it.net/session.ts—createHostflies every peer-less seat on its autopilot (HostOptions.backfill, default on;HostStats.backfilledcounts the ticks). A peer that arrives takes the seat over mid-flight:acceptseeds the seat's throttle hold from what the autopilot was flying, so the peer's first intents ramp from there instead of from launch throttle and the hull does not lurch on the handover tick. A peer that drops hands the seat back the next tick —acceptalready gave a human any peer-less seat, so this is what makes "an arriving human takes a seat that is already flying" (theRosterdesign note) true today.core/rng.ts—STREAM.wingman, offset by seat, so a seed replays the same match whether or not anyone joined.What it deliberately does not do
P2 DOWNeither way. Abotbit in the snapshot seat flags is a follow-up once there is a spare bit worth spending.Evidence
simcheck618 → 629: the autopilot was flying, armed and at speed when a peer arrived; a peer-less seat fires and lands hits over 20 s, never leaves the arena, is every tick backfilled and none held, replays byte-identical from its seed, holds still with backfill off (and that is a different match); a peer that arrives takes over without a single autopilot shot after, ramps from the autopilot's throttle within one tick's rate, and the hull never moves more than one tick's travel across the handover; a peer that drops hands the seat back.2bd4e69. (The first run at4b1830ahad the takeover mutant survive: the test handed the seat over to a wreck, whose stale throttle could not see the hold. It now hands over to a flying, armed seat and bounds the throttle step across the whole window; the mutant fails by hand with a 0.40 step where the rate allows 0.019.).Try it
Open
?hostand launch alone: seat 2 fights beside you. Share the code; the joiner takes that ship over where it is. Close the joiner's tab: the ship keeps fighting on the host, and RETRY puts the joiner back in it.🤖 Generated with Claude Code