aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/unit_patrol.rs
Commit message (Collapse)AuthorAgeFilesLines
* feat(game): cycle warbot cockpit control modesValentin Popov36 hours1-11/+31
|
* feat(ui): show cockpit speed and Control limitValentin Popov37 hours1-1/+21
|
* feat(ui): watch a warbot on autopilot from its cockpitValentin Popov3 days1-1/+3
|
* feat(ui): drive a strategic warbot with an automatic gunnerValentin Popov3 days1-3/+3
|
* feat(ui): control a warbot from the strategic cardValentin Popov3 days1-1/+5
|
* feat(ui): send warbots to recharge from the strategic panelValentin Popov3 days1-11/+30
| | | | Verify LTW-3 approaches the generator and clears its recharge status after leaving from the stock Two Fortresses start. Reuse authored building passages and shared Control replenishment, with a licensed test for refilling an empty magazine.
* feat(ui): assign search and destroy from the warbot panelValentin Popov3 days1-6/+29
| | | | Show the native search status immediately without opening the map. Verify from the stock Two Fortresses start that the selected marker moves with the internal route hidden and that Stand cancels the search.
* feat(ui): assign patrols from the strategic warbot panelValentin Popov3 days1-1/+2
| | | | Use the installed order string and GUARD cursor. A single valid click assigns a 300-unit patrol around a terrain point or a live object. Checked the terrain and satellite paths, rejected terrain, and cancellation in the stock Two Fortresses window.
* feat(ui): give warbots standing and route ordersValentin Popov3 days1-0/+5
| | | | Bind the first two commands to the live selection and shared route controller. Build the order panel from the installed compound controls and game font. In stock Two Fortresses, checked Stand, route drafting on the satellite map and terrain, and movement after confirmation with Vulkan validation.
* fix(ai): resume building capture after losing its assigneeValentin Popov3 days1-8/+11
|
* feat(movement): migrate animals between authored sitesValentin Popov4 days1-3/+58
| | | | Select shared migration sites on the ArealMap cadence and feed them to the common route follower with the animal flight clearance and Control climb limit. In The Constructor, both medusas lift off and travel around the selected site from their stock positions. The window showed the change at a fixed viewpoint with clean Vulkan validation. Path details and threat acquisition remain approximate.
* fix(ai): prepend base defence attacks to unit ordersValentin Popov4 days1-11/+0
| | | | The native task dispatcher inserts mode 2 at index zero without replacing the old list. Keep the interrupted order and queued tail, then run the base-defence wait after assigning the group in the stock mission.
* fix(ai): follow capture passages through building doorsValentin Popov9 days1-10/+93
| | | | A stock Two Fortresses run now takes the generator after the capturer descends its authored hallway. Symmetric Res17 door links drive the CTLD animation and unsupported routes retain explicit coverage. Checked the approach and descent in the game window with Vulkan validation and verified the owner transfer in a licensed test.
* feat(factory): release assembled warbots above the roofValentin Popov9 days1-1/+7
| | | | Find the factory roof with a vertical ray, apply the native height offsets, and keep the departure task active through descent and apron clearance. Verify both stock Two Fortresses factories and transport delivery, and check the descent in a fixed-camera Vulkan run.
* feat(production): let new units clear the factory before taking ordersValentin Popov9 days1-6/+43
| | | | The exterior path reuses shared steering, terrain support, and traffic checks. The stock Two Fortresses test observes completed departures and an ore delivery. Validate a window run from mission start.
* feat(movement): play authored walking cycles from chassis travelValentin Popov9 days1-2/+2
| | | | | | Select a closed forward stride from the model for explicit walking profiles. Drive it from world displacement and subtract baked forward travel before updating geometry, mounts and shadows. Verified light, medium and heavy stock model cycles and watched leg poses change from the normal AutoDemo start with Vulkan validation clean. Stop transitions and terrain-adaptive feet remain open.
* fix(movement): ground chassis on their lowest mesh pointsValentin Popov9 days1-1/+24
| | | | | | Sample the terrain under four support points in the initial chassis pose. Preserve any existing positive clearance above support and recalculate the root height after moving or turning, so a low start does not carry penetration across the route. The stock heavy AutoDemo chassis previously put its root at Z 2 with support at Z 2.9537. The same regression now passes. Verified uneven support and descent, all workspace checks, the 29-mission simulation corpus and an AutoDemo window run with clean Vulkan validation.
* feat(movement): let autonomous flyers climb above terrainValentin Popov9 days1-20/+27
| | | | | | Feed verified CanFly profiles into the shared route follower. A flyer spends movement time climbing to clear its hull before advancing, checks the terrain along the proposed leg and retains world altitude over lower ground. Ground units keep their terrain-following step. Covered takeoff, an intermediate ridge and a valley in route tests. Confirmed a stock AutoDemo flyer takes off and travels, observed the airborne scene with clean Vulkan validation, and ran the 29-mission simulation corpus. Descent and altitude-aware obstacle avoidance remain open.
* fix(movement): account for vehicle traffic along ground routesValentin Popov9 days1-15/+22
| | | | | | Ground routes now clear live vehicle bounds as well as buildings. Each movement step reserves the space it traversed for the rest of the frame. A parked vehicle can delay arrival without deleting the destination, and an obstructed detour can be replaced. Verified head-on passing, crossing during one long frame and resuming after an occupied goal clears. Workspace checks, the AutoDemo window, stock builder resupply and the 29-mission simulation corpus passed. Tight groups and airborne clearance remain approximate.
* fix(movement): route autonomous units around buildingsValentin Popov9 days1-1/+18
| | | | | | Project the bounds of live building meshes onto the ground and expand them by the vehicle radius. The shared route follower chooses exterior corners for blocked legs and can leave a footprint containing its starting position. Verified a detour on the stock factory geometry, stock builder resupply, a window run of Single.01, and 15 minutes of simulation on all 29 missions. Narrow openings, flying clearance and moving bodies remain open.
* fix(movement): carry frame time across route waypointsValentin Popov9 days1-69/+7
| | | | | | Route following now spends the same frame interval on turning and all reachable waypoints. Go, Patrol and pursuit keep their existing speeds and share this step. Stop counting the obsolete per-waypoint time loss. Verified with the corner route regression, workspace checks, release AutoDemo in a window, and two-minute AutoDemo and Single.01 smoke runs. Obstacle avoidance, locomotion animation and comparison with the original remain open.
* fix(movement): use profile requests for scripted Go speedValentin Popov9 days1-6/+15
| | | | | | | | | | | | 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.
* feat(diagnostics): count unit motion gaps by objectValentin Popov9 days1-0/+12
| | | | | | | | | | Track temporary-controller updates and frame time discarded at waypoint boundaries for each object slot, generation and original TMA ID. Preserve completed/dead object records, expose them in --sim-report, and print the same counters when the game window closes. Movement and RNG decisions are unchanged. A bounded Ghidra inspection identifies Go at Behavior.dll RVA 0x2b670 and the MWalker empty-state helper at 0x3dd80. Restoring the MWalker/Control handoff remains open; no fixed-step or remainder-carry rule is substituted for native behavior. Document this explicit stub and bind the addresses to the verified GOG module hash. The licensed stock AutoDemo test first failed with empty observations and now reports actual controller updates and nonzero discarded time. A normal 91-second window run also emits per-generation totals after closure. All 29 stock --sim-report 900 runs preserve the preceding commit's world and combat summaries. At 60 Hz, AutoDemo's largest recorded loss for a single object lifetime is 492516 us; losses are observations of FParkan, not original-game timings. Validation: cargo fmt --all -- --check; cargo check --workspace; cargo test --workspace; release build; focused unit and ignored licensed-stock tests; stock AutoDemo window; all 29 mission coverage runs. The native movement solver and original chronology are not accepted by this diagnostic change.
* fix(behavior): finish attacks against depleted targetsValentin Popov9 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Static buildings remain in the world after Control marks their depletion. Attack used to wait for removal and kept selecting the exhausted building. Share the native missing/depleted/zero-position completion condition between the order queue and firing selection. Remove a finished final Attack even when no successor was queued, while keeping handle generations distinct. Validation: unchanged x86 Behavior/Control DLL functions for target state and the early Attack tick; queue tests; licensed stock raid regression, which first exposed reacquisition after depletion and now reaches ShutDown without further shots. Workspace fmt/check/tests, release build, and all 29 stock 900-second reports pass. Windowed mission 19 completed Attack, two retreat Go orders and ShutDown with the hero at the stock start. Four incidental interior shots during window activation returned no damage result; the bunker still had its full root amount before the raid. Native oracle lookup, state proxy and position resolver are host fixtures; this does not establish full original mission chronology or movement parity. Windowed retreat is slower than the report run: the temporary motion controller and waypoint time loss remain G8 work. Aiming and destruction FX are unchanged and still approximate.
* fix(patrol): request place patrol speed from Control limitsValentin Popov9 days1-6/+24
| | | | | | | | | | | | | | | | | | | Unengaged PatrolPlace movement uses current owner-profile word 7 times 0.8 instead of one fixed speed for every chassis. Preserve a counted fallback for unavailable profiles and report per-object speed samples. The profile is projected at load time; runtime updates, acceleration, turning and speeds of other orders remain approximate. Confirmed the current-profile selector by executing GOG Behavior.dll RVA 0x1bbe0. A live request at RVA 0x2dc67 maps limit 0x416b55d8 and factor 0x3f4ccccd to 0x413c44ad, covered by a Rust regression. Behavior.dll SHA-256: ddfbdbde07832358fe6e35e01c8dba9b58e7313789498b6049ed51d4ed9baf99. Validated fmt, workspace check/tests, release build, licensed stock profile and patrol-list tests, and all 29 stock missions for 900 seconds. Observed stock AutoDemo movement, combat and replenishment in the window; this does not establish full native movement or opening chronology parity.
* fix(patrol): use native cyclic PatrolPlace point batchesValentin Popov9 days1-4/+103
| | | | | | | | | | | | | | | | | | | | Generate 15-19 goals with Behavior's two random streams, reject candidates within 100 units of map edges, and retain the cyclic list until the native 20-second plus 10-second jitter timer expires. Draw coordinate and timer randomness from the shared Behavior CRT stream rather than a patrol-local copy. Cache chassis CanFly for autonomous checks and reuse the player parser. Keep per-object counts of batches, goals, approximate area checks and missing inputs. The generator's initial seed, owner update order, ground walkability and physical movement remain explicit approximations. Verified native Behavior.dll RVA 0x2dd90 by x86 invocation at CW 0x007f, including edge rejection, and captured a matching batch in live AutoDemo. Rust golden vectors match all goals, RNG states and deadlines. Workspace fmt/check/test and licensed patrol, combat and clan-clock regressions pass. All 29 stock missions reach --sim-report 900 with no script interruptions or new missing patrol inputs. Observed the change in a stock AutoDemo window. This does not establish full G7 chronology or G8 movement parity.
* feat(ai): queue scripted movement and raid ordersValentin Popov10 days1-1/+13
| | | | | | | | | | | | | | | | | | | | | Execute Go, Attack and ShutDown through one ordered queue from Init, Mission and clan AI events. Append preserves the active task; replacement clears its tail. Support the appended point patrol ending mission 19's second raid, and count accepted commands by object and order type. Execute the original ai.dll Handler(15) at RVA 0x8054 with its hash guard: move, attack, shutdown and appended patrol reach the unit without a current problem context, with native insertion modes and missing-unit flag 5. Behavior.dll RVA 0x4280 identifies append and replace paths. Native task completion and profile-dependent behavior remain approximate. Test mixed queues, replacement and deferred patrol; run the licensed mission-19 scenario from its stock start through its first movement. Validate fmt, workspace check/tests, release build and all 29 missions for 900 seconds. Mission 19 has both raid messages and no script stops; mission 29's existing counter/construction stops remain. Check the live stock-start window with normal clocks and Vulkan validation. This does not establish mission completion or native movement/combat parity.
* feat(ai): recruit free groups before assigning their targetValentin Popov10 days1-2/+34
| | | | | | | | | | | | | | | | | | | | Handler(25) TAKE_ALL_FREE takes the free roster in order and returns ERROR for an empty group. Target selection now belongs to Handler(28), so the script can form a group first and then issue its attack. Attack orders remain associated with their group; cleanup preserves a subsequent order. Coverage counts recruitments by clan and mode, including empty results. Original GOG ai.dll RVA 0xab85 confirmed membership across classes, busy and reserved exclusions, assignment updates, order and the empty result. Validated with Rust order-lifecycle checks, a licensed test that waits on the stock empty clan before a deliberate debug roster transfer, workspace fmt/check/test, and 900-second simulations of all 29 missions. Mission 12 ran from stock start in the window with clean Vulkan validation. The debug transfer verifies the attack mechanism, not a mission playthrough. Occupancy and routing remain approximate. Group orders for other classes fail explicitly. Script stops remain in missions 15 (71/72), 19 (Problems0 orders) and 29 (building counters/construction and Handler 40).
* feat(ai): patrol scripted protection pointsValentin Popov10 days1-0/+43
| | | | | | | | | | | | | | | | | PBM_PLACE_PROTECT recruits free warbots for TARGET_BY_PLACE and preserves its patrol group across Continue calls. New factory units can reinforce it; releasing the group preserves a subsequent movement or attack order. Coverage counts point orders and continuations by clan and both coordinates. Validated with fmt/check/test workspace, stock mission 10 group lifecycle, stock building and factory guard regressions, and 900-second simulations of missions 8, 10 and 12. Mission 10 ran in the window from stock start, issued the point order and reinforced it, with clean Vulkan validation. Original Behavior.dll RVA 0x2d520 confirmed point/radius parameters. Routing, free-unit recruitment and continuation timing remain approximate. Mission chronology alongside the original is open. Simulations expose Handler(13) in mission 8 and another group recruitment mode in mission 12.
* feat(ai): execute tower construction ordersValentin Popov2026-11-141-1/+1
| | | | | | Use the first BuildDat scheme for the requested class, check learned components, and route the builder before spending onboard ore. The Behavior.dll oracle rejected the stock scheme and returned 1100 ore after unlocking the components. The stock mission 28 window showed the refusal with its original tech tree. A licensed prepared test exercised construction and ore deduction. Onboard supply remains required pending warehouse refill.
* feat(ai): carry ore from clan mines to storageValentin Popov2026-11-141-0/+5
| | | | Resolve the stock transport order against the newly produced unit. Move between owned endpoints and limit transfers by rate, source stock and destination space. The window logged the first departure and the stock simulation completed an unloading cycle. Native roster selection was called directly. Port approaches and rates remain approximations.
* feat(ai): dispatch scripted warbot groupsValentin Popov2026-11-141-0/+11
| | | | Single.01 selects a free warbot for the capture problem and issues a patrol around the moving capturer from stock startup. Group recruitment uses the supported TAKE_BY_HITS branch. Priority preemption and group expression scheduling remain open.
* feat(ai): dispatch scripted attacks against logical targetsValentin Popov2026-11-141-1/+52
| | | | Resolve the stock logical target and feed it to unit combat. Mission 20 assigns the attack at startup and continues through the remaining Init commands. All 29 original missions completed 15 minutes without a hard Init or periodic Mission stop.
* feat(ai): queue scenario move orders for mobile unitsValentin Popov2026-11-141-2/+94
| | | | Runs the stock order sequence in mission 16. Both mobile headquarters receive five destinations in script order. Movement uses existing terrain routing until the native Go task is wired.
* feat(ai): patrol around script-selected objectsValentin Popov2026-11-141-4/+86
| | | | Uses the TMA logical ID to route a warbot around the current position of a building or unit. The original Behavior.dll confirms target class selection and radius. Mission 13 now assigns building patrols at stock startup.
* feat(ai): honor scenario warbot shutdown ordersValentin Popov2026-11-141-4/+39
| | | | Behavior.dll task dispatch selects ShutDown for order 0x13. Stop autonomous motion and fire until a new supported order is assigned. The field-camp clan now completes Init and all three placed warbots receive the shutdown order.
* fix(ai): keep patrol attacks within their assigned areaValentin Popov2026-11-141-0/+60
|
* feat(combat): damage the building part struck by a projectileValentin Popov2026-11-141-3/+17
|
* feat(ai): route skirmish units toward hostile factoriesValentin Popov2026-11-141-2/+80
|
* feat(runtime): execute scripted place patrol ordersValentin Popov2026-11-141-5/+48
|
* feat(runtime): replenish AutoDemo clans after combat lossesValentin Popov2026-11-141-0/+11
|
* feat(runtime): engage hostile robots in AutoDemoValentin Popov2026-11-141-27/+68
|
* feat(runtime): route AutoDemo patrols through terrain areasValentin Popov2026-11-141-0/+176