aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-25 11:20:10 +0300
committerValentin Popov <valentin@popov.link>2026-11-25 11:20:10 +0300
commitbccae28a00af19dc095910073e7e820aa81dc393 (patch)
tree77f8f37bff10b6274a84b87fd7f3b3e329089c1b /docs
parent05fe0d6d8c10629d0b485d1eb3c1e25279164a53 (diff)
downloadfparkan-bccae28a00af19dc095910073e7e820aa81dc393.tar.xz
fparkan-bccae28a00af19dc095910073e7e820aa81dc393.zip
feat(ai): guard the least defended clan building
Execute Handler(37) from the live clan roster, rank nearby guard strength and feed the existing protection scheduler. Keep the native strict 250-unit radius, first tie and empty-roster sentinel. Count approximate selections by clan and target in simulation reports. The GOG AI handler was called directly for weak buildings, equal strength, the radius boundary and an empty roster. Stock missions 8, 9 and 10 now assign guard patrols before reaching the next explicit script blocker. Mission 9 ran in the window with clean Vulkan validation. The existing factory protection regression and workspace checks pass.
Diffstat (limited to 'docs')
-rw-r--r--docs/appendices/knowledge-boundaries.md3
-rw-r--r--docs/tomes/06-behavior.md13
2 files changed, 16 insertions, 0 deletions
diff --git a/docs/appendices/knowledge-boundaries.md b/docs/appendices/knowledge-boundaries.md
index f0061d79..660f4cce 100644
--- a/docs/appendices/knowledge-boundaries.md
+++ b/docs/appendices/knowledge-boundaries.md
@@ -449,6 +449,9 @@ core и `ResearchCandidateSet::refresh_selection`: последний получ
автоматических исследований.
`script_factory_defence_approx` считает оценки охраны завода по клану и
цели. Радиус восстановлен, сила берётся из текущих таблиц Control.
+`script_building_defence_approx` считает выбор наименее охраняемого своего
+строения через `Handler(37)`. Сила и порядок кандидатов пока берутся из
+реестра мира и Control вместо записей ArealMap.
`script_base_threat_approx` отмечает поиск угрозы у базы по клану и
цели. В выборе пока участвуют машины с логическими ID карты.
`script_problem_dispatch_stubs` считает накопленные заявки по клану и типу.
diff --git a/docs/tomes/06-behavior.md b/docs/tomes/06-behavior.md
index de346bf1..b04a996d 100644
--- a/docs/tomes/06-behavior.md
+++ b/docs/tomes/06-behavior.md
@@ -363,6 +363,19 @@ SHA-256 DLL `c19cd6cd31cd2896f8c4ba0f0e700dd3408aec8182daaf4863d98a7d233a2abc`.
### Патруль у завода
+`Handler(37)` расширяет выбор охраны на все свои строения с логическим ID.
+Для каждого он складывает силу своих машин ближе 250 единиц по горизонтали
+и выбирает строение с наименьшей суммой. На самой границе машина не входит
+в охрану. При равенстве сохраняется первое строение в реестре.
+Поэтому сценарий может отправить свободных варботов к удалённому зданию,
+у которого пока нет прикрытия.
+
+Вызов GOG `ai.dll` по RVA `0xcedf` подтвердил границу, выбор меньшей силы
+и порядок при равенстве. SHA-256 DLL
+`c19cd6cd31cd2896f8c4ba0f0e700dd3408aec8182daaf4863d98a7d233a2abc`.
+При пустом списке возвращается ID `0xffffffff`, а выходная оценка получает
+DWORD от усечения исходного значения `1e12_f32`.
+
`PBM_BUILDING_PROTECT_Start` сравнивает силу машин возле завода с порогом
сценария. При достаточной охране заявка переходит в `ST_SOLVING` без нового
приказа. В действующей заявке `PBM_BUILDING_PROTECT_Continue`