From 5cc5602b3fa42e5864d205a1c42c895504038b10 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 25 Nov 2026 20:14:25 +0400 Subject: fix(ai): start player and clan cycles on the first update Fresh AI contexts enter their first cycle immediately, including the player context with an empty Problems0. Share their logical clock with Mission timeouts and registration notifications. The stock original confirms the first Mission callback sees zero before the first AI cycle. Run the player Problems0 path and support TAKE_ALL_BATTLE_UNITS: preserve reserved and same-kind assignments, take warbots from other combat tasks. Native ai.dll calls verify recruitment and the initial shared RNG draws. Validation: workspace fmt/check/tests, release build, licensed stock-clock test, all 29 stock missions at --sim-report 900 without script stops, and stock mission windows 28 and 20. Full AI chronology, native occupancy and remaining RNG consumers are still approximate. --- docs/appendices/script-vm.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/appendices/script-vm.md') diff --git a/docs/appendices/script-vm.md b/docs/appendices/script-vm.md index 420298a1..f10f1753 100644 --- a/docs/appendices/script-vm.md +++ b/docs/appendices/script-vm.md @@ -2541,7 +2541,8 @@ ID в списке своего клана. Вызов DLL подтвердил, Обновление GOG `ai.dll` по RVA `0x1780` вызывает сохранённое событие `Problems0` у AI-клана. Интервал состоит из 7000 мс и добавки из RNG. FParkan использует `7000 + rand() % 1000` мс и увеличивает логические часы -сценария на семь секунд за цикл. Начальная фаза и полный порядок RNG открыты. +сценария на семь секунд за цикл. Первый проход допускается сразу, включая +контекст игрока с пустой секцией; полный порядок RNG остаётся открытым. Отчёт `script_clan_ai_stops` указывает клан, секцию, команду и число остановившихся на ней вызовов. Это позволяет выбирать следующую команду по исполняемому пути. Отбор задач AI и вызовы `PBM_*` пока открыты. -- cgit v1.2.3