Skip to content

fix(fatcow): an AI cow no longer hovers until it runs dry (FIX-FAT-COW-STRANDED) - #334

Merged
davidp57 merged 7 commits into
developfrom
fix/FIX-FAT-COW-STRANDED
Nov 24, 2026
Merged

davidp57 merged 7 commits into
developfrom
fix/FIX-FAT-COW-STRANDED

Conversation

@davidp57

@davidp57 davidp57 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Lot FIX-FAT-COW-STRANDED: on the Campagne server (2026-11-22) an AI Fat Cow packed its FARP on an F10 order nobody logged, flew on for 5 h 20 min until it ran out of fuel and vanished. Tickets 01-03 (code); ticket 04 (live measurements) done, results below.

  • 01 Log every F10 order given to an AI cow (Land here, Take off, Hold here, Join us, RTB, Release, Take over: cow, order, requesting unit) and every change of its phase, one INFO line each, none per loop tick.
  • 02 Orphan check in the loop: _sendHomeOrphans also runs in the 10 s loop (_resyncFarps), so a cow whose flight disappears after the one-shot 2 s check ran too early still goes home, once.
  • 03 Bingo fuel: an AI cow in the air with less than 25 % of its internal fuel goes home through _returnHome whatever it was told (holding, following, released), its flight reads "The Fat Cow is low on fuel and returns home." (new text, four dictionaries), WARN with the fuel fraction. A cow that is landing lands; a returning one is untouched; no fuel reading means no action. Pilot guide EN+FR, CHANGELOG.

One thing beyond the tickets: _returnHome cleared _aiByFlight[flight] unconditionally. For a released cow sent home by the bingo check, the flight may already have requested another cow, which would have lost its registration. It now clears the entry only when it is that cow.

Measurements (ticket 04)

Run on Test_CTLDNEXT_01.miz through the DCS bridge, with the build of this PR (details in the ticket).

  • (a) Orbit of an AI CH-47: a circle, not a hover. 35.7-42.9 m/s over 120 s, heading turning about 1.2 deg/s, roughly 1.9 km radius. It burns fuel while circling, so the stranding came from the missing order log and fuel guard, and no hover fix lot is needed.
  • (b) A client group is gone at once when its player leaves: getUnit(1) is nil at 0.1, 2.1, 5.1 and 10.1 s, and the cow is already returning. The 10 s loop check stays as a safety net.
  • (c) Bingo: PASS. A cow at 0.13 of its tanks is sent home by the 10 s loop and its flight reads the new message.
  • (d) PASS. Order and phase lines are in dcs.log.

No decision of the PRD is overturned.

Test plan

  • fatcow_ai_spec (19 new tests, red first); full tests/ci on the local Lua 5.1 runner: same 36 pre-existing runner failures as origin/develop, +19 passes
  • i18n dictionaries synced, build OK
  • CI (busted, luacheck, lua-lint, i18n guard, changelog guard)
  • Live check on Test_CTLDNEXT_01.miz (ticket 04)

@davidp57
davidp57 merged commit e54b843 into develop Nov 24, 2026
10 checks passed
@davidp57 davidp57 mentioned this pull request Nov 24, 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.

1 participant