aboutsummaryrefslogtreecommitdiff
path: root/docs/tomes/06-behavior.md
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-26 02:53:21 +0300
committerValentin Popov <valentin@popov.link>2026-11-26 02:53:21 +0300
commit0a4aada114bdcce5dba69bdbb88fa0ed44cf6733 (patch)
tree12ff566b90efe140c628eae5f82b3134e18662b1 /docs/tomes/06-behavior.md
parentd92cde8b7209b83572aeabd5dab657149ed78d99 (diff)
downloadfparkan-0a4aada114bdcce5dba69bdbb88fa0ed44cf6733.tar.xz
fparkan-0a4aada114bdcce5dba69bdbb88fa0ed44cf6733.zip
fix(movement): use profile requests for scripted Go speed
Scripted Go used a fixed speed of 9. Feed the temporary movement controller with the current Control forward limit multiplied by the loaded Behavior Go_SpeedPercent. Missing coefficients retain the native constructor default of 1; present VAR records use the first matching row's applied value. Rebind a produced unit's Behavior profile to its new full handle so the request remains available after spawning. Share Go and PatrolPlace speed sampling in unit_speed.rs while retaining the patrol coefficient of 0.8, and move profile-loading mechanics out of lib.rs into behavior_profile.rs. Reports distinguish Go and patrol samples and keep explicit fallbacks for unresolved inputs. An unmodified GOG Behavior.dll oracle executes the native profile constructor, current-profile getter and both Go start/update paths under x87 0x007f. A hardware breakpoint records the request before the MWalker call. It confirms default, fractional and zero vectors, including the stock request 0x41e52e74 (28.647682). This is requested-speed evidence; MWalker caching, acceleration, routing and physical integration remain explicit approximations. The licensed stock mission-19 test first failed because Go never requested its Control speed, then passed with the original robot at the stock start. Existing patrol and newly produced-unit profile tests also pass. In the stock game window the raid fires at 190671 ms instead of the preceding build's roughly 327 seconds, depletes the bunker root at 193620 ms, and completes both queued retreat Go orders before ShutDown. The hero stays at the starting position. Validation: cargo fmt --all -- --check; cargo check --workspace; cargo test --workspace; release build; six focused/ignored runtime speed tests; native start/update vectors; all 29 stock --sim-report 900 runs with zero Go speed fallbacks or damage errors. World summaries remain unchanged. Full original movement and mission chronology are not accepted by this change.
Diffstat (limited to 'docs/tomes/06-behavior.md')
-rw-r--r--docs/tomes/06-behavior.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/tomes/06-behavior.md b/docs/tomes/06-behavior.md
index 9f93c9fc..f09ba41c 100644
--- a/docs/tomes/06-behavior.md
+++ b/docs/tomes/06-behavior.md
@@ -272,6 +272,30 @@ Behavior RVA `0x1bbe0` запрашивает селектор `0x12` интер
Отчёт сохраняет число запросов и последнее значение
для каждой машины; при отсутствии профиля явно считает подмену скоростью 9.
+Сценарный Go берёт тот же текущий предел, но умножает его на
+`Go_SpeedPercent` из профиля Behavior. Стандартное значение равно `1`:
+машина с пределом 20 запрашивает 20. При следующем запросе уменьшившийся после
+повреждения предел даст меньшую скорость. Нулевой предел или коэффициент дают
+нулевой запрос.
+Декодер профиля применяет второй блок значения первой одноимённой записи;
+при отсутствии поля сохраняет нативное значение по умолчанию. В штатных
+классовых профилях `behpsp.res` это поле отсутствует.
+
+В GOG `Behavior.dll` ([сборка](../reference/original-binaries.md)) значение
+по умолчанию задаёт RVA `0x16250`, привязку `Go_SpeedPercent` — `0x16480`.
+Умножение исполняется при старте Go (RVA `0x2b595`) и повторной передаче цели
+(RVA `0x2b932`). Вызов обеих нативных ветвей с игровым x87 `0x007f` подтвердил
+значения запроса, в том числе нулевые. Измерение завершается перед MWalker:
+физическое движение и хронология миссии этим не подтверждаются.
+
+FParkan использует профильный запрос вместо постоянной скорости 9 для Go.
+`go_speed_profile_approx` сохраняет предел, коэффициент и запрос по объекту;
+`go_speed_stub` считает отсутствие необходимых данных и явную подмену 9.
+После выпуска машины её профиль Behavior привязывается к новому полному
+handle, включая поколение, и остаётся доступным для следующих приказов.
+Временный контроллер подставляет этот запрос на каждом шаге движения;
+нативное удержание запроса MWalker между передачами цели ещё открыто.
+
Патруль ищет путь к текущей цели в графе `Land.map`, проезжает через
середины общих рёбер и сохраняет высоту корпуса над рельефом.
Так роботы движутся в игровом мире и в режимах автоматической камеры.