Skip to content

The brake step runs in every air state, as it does for every air mission - #47

Merged
CubeB merged 1 commit into
revivalfrom
41-brakerate-all-air-states
Sep 11, 2026
Merged

CubeB merged 1 commit into
revivalfrom
41-brakerate-all-air-states

Conversation

@HectorBailey

Copy link
Copy Markdown
Collaborator

Closes #41. Stacked on #36 (the base branch of this PR is 23-brakerate-nose-reaim); once #36 merges this retargets to revival with one commit.

The decode. 0x43D290 has exactly one caller: Mover::Update at 0x43DD46, which reads def+0x241 bit 11 (canfly) and picks the air follower for any such unit, whatever mission it is on. §87's table already had this. So the attack missions do not have movers of their own; the brake step at 0x43D38E runs for the bomber's run, the gunship's ring and the fighter's dogfight alike, after drag and before the turn.

What changed.

  • computeNewAttackRunVelocity applies applyBrakeRateNoseReaim to the velocity it starts from, before its heading swing. The gunship ring and the dogfight already delegate to computeNewAirUnitVelocity and so had the step since An aircraft's speed above BrakeRate goes where its nose points #36; nothing to change there.
  • docs/TOTALA-EXE.md §1 updated.
  • Two fixtures in UnitBehaviorService_air.test.cpp left the nose on its default heading (+z) while the aircraft flew flat out along +x. With the step, a nose left there veers the aircraft on the first tick and the half-circle reversal is over in four. They now point the nose along the flight path before the loop, which is what updateUnitRotation does in the game (the sibling section was already doing it inside its loop). The decoded geometry those tests pin, the turn radius and the never-slowing speed, is unchanged.

Verified, with real FBI values from rev31.gp3 (ARMTHUND 9/0.4/0.08/356, ARMBRAWL 6.6/4/0.16/800, ARMFIG 10/6/0.35/512):

  • brakerate.test.cpp: one test case with a section per state, each starting a unit flying flat out along +x with its nose on +z and a goal far along +x. With the rule, the crosswise speed drops to BrakeRate within a tick's acceleration (the bomber's to 0.4, so it turns almost entirely along the nose); with BrakeRate out of reach it stays.
  • rwe_test: all 556 test cases pass (71511 assertions), Linux gcc-14 Debug, including the bomber, gunship and fighter geometry tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PJCbwC9MGZnM6erMDKptun

The original has one per-tick air mover. Mover::Update (0x43DD20)
hands any unit whose definition says canfly to 0x43D290, whatever
mission it is on, and the brake step sits inside that. So the bomber's
run, the gunship's ring and the fighter's dogfight all strip speed
above BrakeRate and put it back along the nose, the same as a unit on
its way somewhere.

In RWE the gunship ring and the dogfight already flew through the
flying state's velocity function and so had the step from the first
port. The attack run steers its own heading and did not; it now runs
the step on the velocity it starts from, before the swing, in the
original's order. A Thunder's BrakeRate of 0.4 against its MaxVelocity
of 9 means a bomber flies where it points.

Two attack-run fixtures had left the nose on its default heading while
the aircraft flew flat out along another; they point the nose along
the flight path now, as updateUnitRotation keeps it in the game, and
their decoded geometry is unchanged.

Issue: #41

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJCbwC9MGZnM6erMDKptun
@HectorBailey
HectorBailey changed the base branch from 23-brakerate-nose-reaim to revival September 11, 2026 20:28
@CubeB
CubeB merged commit 704968b into revival Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BrakeRate nose re-aim in the attack run, the gunship ring and the dogfight

2 participants