aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/mission_events.rs
Commit message (Collapse)AuthorAgeFilesLines
* fix(runtime): select the local starting hero for mission controlValentin Popov2 days1-9/+125
|
* feat(ui): follow mobile command posts with the strategic cameraValentin Popov3 days1-1/+1
| | | | Connect captured command vehicles and follow their native orbit. Verify the sweep and acceleration against the original DLL. In a Teleport debug copy, verify Enter, edge rotation and Esc with Vulkan validation enabled. The stock start opens cleanly. The stock route and the original window comparison remain pending.
* fix(script): return the registered ID of a produced capturerValentin Popov4 days1-6/+79
| | | | The Mission handler now resolves the eligible warbot through the shared logical ID lookup. The original handler returns the registered roster ID. The Teleport regression reproduces the former stop with a newly registered eligible candidate, and the unmodified mission starts in the game window.
* feat(player): announce vehicle capture when the hero stays outsideValentin Popov4 days1-0/+2
| | | | Restore the original warbot and mobile command centre acknowledgement bank. A capture that also seats the hero remains silent. The bank and non-repeat selection were checked against the native DLL, and a walk from the normal Teleport start queued the authored voice before the objective notice.
* fix(control): use the original neutral vehicle capture rangeValentin Popov4 days1-9/+4
| | | | The GOG Enter handler shares a strict horizontal 20-unit check for capture and boarding. The stock firing-range window transferred both neutral warbots beyond the old radius, and the licensed Teleport check still credited the mobile HQ.
* fix(ai): dispatch building loss to the former clanValentin Popov4 days1-0/+3
|
* fix(mission): recognize the exit from the teleporter floorValentin Popov9 days1-4/+12
| | | | | | Behavior.dll at 0x18310 evaluates the cylinder with a candidate position queried through 0x14b30. Reuse the authored hero spawn clearance for the floor-level walking probe. Keep the cylinder from the licensed DLL oracle and the asset's original center. The stock Teleport input replay captures the portal, transfers to the lower passage and renders the victory at the glowing exit. Correct the focused fixture to use the actual factory and laboratory communicator floors.
* feat(mission): open the main teleporter's lower passageValentin Popov9 days1-2/+2
| | | | | | Use the authored Res17 entry and destination markers for an unboarded hero at an owned main teleporter. The original Behavior.dll entry callback at RVA 0x18ac0 checks the owner, hero and generators, then transfers to the marked destination. Original SHA-256 ddfbdbde07832358fe6e35e01c8dba9b58e7313789498b6049ed51d4ed9baf99. Verified with the licensed transfer regression and a Vulkan input replay from the untouched Teleport mission start through the capture, transfer and lower passage. Generator selection and the hero contact point remain approximate.
* feat(player): lower the communicator field on captureValentin Popov9 days1-0/+6
| | | | Drive the original CTLD type-13 tracks from the local capture. The Constructor window replay shows the raised and lowered field and four player projectiles stop at the mesh. Leaving resumes the authored open pose. Motion timing and exit trigger remain approximate.
* feat(player): announce a successful building captureValentin Popov9 days1-5/+22
| | | | Resolve the neutral or enemy cue through the original voice table. In a stock Constructor window replay the factory capture queues vc_nb_capt.wav before the objective notice.
* fix(player): capture buildings at the communicator floorValentin Popov9 days1-10/+4
| | | | On the stock Constructor map, walk through the factory basement to the communicator and press Enter. The first objective completes and the same path returns to ground level. The green ceiling no longer hides the floor in the contact query.
* fix(ai): account for occupied clan mind slotsValentin Popov10 days1-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Handler(49) read the immutable Init snapshot and always reported all clan minds as free. Project occupied slots from live mobile units (including the hero) and valid factory reservations, including orders queued in the current script pass. Unit loss, capture and factory ownership loss release capacity. Expose per-clan query counts and current capacity/free/reserved values through script_free_minds_approx; retain explicit native-ID and admission boundaries. GOG ai.dll SHA-256 c19cd6cd31cd2896f8c4ba0f0e700dd3408aec8182daaf4863d98a7d233a2abc: native calls to Handler(49), RVA 0xdb2e, confirm that only 0xffffffff is free. In stock Single.01 clan 1 starts with five occupied slots out of nine. Hardware watches in Behavior.dll SHA-256 ddfbdbde07832358fe6e35e01c8dba9b58e7313789498b6049ed51d4ed9baf99 show the factory reserve zero at RVA 0x2a0bb and release it at 0x2a7e5 before birth. Validated fmt, workspace check/tests, release build, ordinary lifecycle tests and an ignored licensed Single.01 test covering startup, order, birth and factory ownership loss. All 29 stock missions finish --sim-report 900 without new script stops. Stock mission 28 also ran in the window: four orders now fill the clan instead of the previous eight over the simulation interval. This does not establish complete mission playthrough or full AI parity. Warbot design ranking still uses the explicit compatible-prebuild fallback; factory logs now include the requested class and selection mode. Native mind IDs, full-capacity order admission and factory timing remain approximate.
* fix(ai): age script deadlines while the world is pausedValentin Popov10 days1-2/+17
| | | | | | | | | | | | | | | | Record paused wall time separately from simulation time. After resuming, Mission and clan AI check their expired deadlines once, then schedule the next interval without replaying missed cycles. Move application pause handling into its own module and retain frozen world, animation and audio. Live ai.dll timer calls confirm that Mission runs before the paused world clock refreshes and the next AI callback uses an already expired deadline. Record the unresolved AutoDemo sphere and first-projectile boundaries. Validation: workspace fmt/check/tests, release build, licensed stock-clock pause test, all 29 missions at --sim-report 900 without script stops, and a stock mission-28 window with a 33-second pause and unchanged world time. Full AI chronology and minimized-window timing remain open.
* fix(ai): start player and clan cycles on the first updateValentin Popov10 days1-2/+2
| | | | | | | | | | | | | | | | 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.
* fix(ai): advance clan cycles when units registerValentin Popov10 days1-0/+8
| | | | | | | | | | | | | | | Advance the signed AI deadline by 1400 ms when an active clan receives a new unit. Connect production, construction, mines, reinforcements and ownership transfers through the shared spawn path. Preserve negative deadlines and count registration notifications per clan. Move the common spawn code and result type out of AutoDemo without changing its public API. Native ai.dll calls cover duplicate and missing IDs, the disabled guard, both registration kinds, negative deadlines and unchanged RNG. A live original warbot registration confirms the same advance. Workspace checks, the licensed stock factory timing test and all 29 900-second reports pass; a stock mission-28 window runs through successive factory outputs. Initial clock phase, complete RNG ordering and full G7 chronology remain open.
* feat(ai): execute scripted mine constructionValentin Popov10 days1-6/+16
| | | | | | | | | | | | | | | | | | | | Mission 29 stopped before choosing a deposit. Implement Handler(40)'s vacant deposit and weakest enemy mine policy, preserve its partial output writes and reserve the chosen site. Follow the script's tail transfer into BUILD_MINE with the original problem context and cells. Move event execution out of the large script module and report stops at the actual destination event. Use the existing prepared deposit slot for the builder's mine order. Completion registers its controls, ore buffer and logical ID with the regular resource loop. Track mine queries by clan, target and coordinates in --sim-report. Validation: fmt, workspace check/tests; licensed stock-start tests construct a working mine, collect ore and subsequently construct a working factory. Calls to GOG ai.dll confirm mine choices/output writes and VM event transfer behavior. The 900-second stock mission now stops only at the research transition 8. Window validation reaches mine creation from the stock start; construction animation was outside the player's view and has not been accepted visually. Native ArealMap deposit binding, builder resupply and live BAS cuts remain open.
* feat(ai): queue scripted movement and raid ordersValentin Popov10 days1-0/+11
| | | | | | | | | | | | | | | | | | | | | 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): deliver clan script notifications to the playerValentin Popov10 days1-44/+12
| | | | | | | | | | | | | | | | | Handle clan Handler(30) through the same host command and first-message state as the Mission event. Carry clan notices in FrameResult and pass them to the existing text and voice queues without changing the Mission tick counter. Extract shared host dispatch and app presentation modules. Execute ai.dll RVA 0xc266 with the original hash guard: clan contexts 0 and 2 call the global host as (0, MESSAGE_INFO, index), reading live varset cells. Extend the licensed stock Convoy test to require message 0 after the delayed attack, and test shared first-message and AutoDemo behavior. Repeated native message UI branches remain explicit debt. Validate fmt, workspace check/tests, licensed stock-start test, release simulation and the mission window. Clock replay checks message delivery, not full mission completion.
* feat(ai): recruit free groups before assigning their targetValentin Popov10 days1-0/+4
| | | | | | | | | | | | | | | | | | | | 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): select free factories for scripted productionValentin Popov10 days1-1/+72
| | | | | | | | | | | | | | | | Handler(13) UNIT_FREE_UNIT now selects the first live clan object of the requested exact class. Reserved objects, assigned runtime workers and busy factories are skipped. Coverage records each selected logical ID. Campaign mission 8 can execute PBM_ROBOT_NEEDED and replenish its guards. Original GOG ai.dll RVA 0x86fb confirmed roster order, exact class matching, exclusion of busy and reserved entries, and ERROR when none are free. Validated with matching Rust roster cases, a licensed stock mission 8 production test, fmt/check/test workspace, and 900-second simulations of missions 8 and 28. Mission 8 also ran in the window with Vulkan validation. Occupancy is inferred from runtime jobs; native problem-slot ownership, other selection modes and mission chronology beside the original remain open.
* fix(ai): dispatch attacks after a scripted unit diesValentin Popov2026-11-151-0/+91
| | | | Match Handler(39) against the live logical-object registry and pass Problems0 attack orders to the existing task. The stock mission 20 regression exercises the branch with the checked warbot present and then removed. The original GOG AI query was called directly for present and missing IDs. Mission 20 completed 900 simulated seconds without a clan-script stop and started in the window with clean Vulkan validation.
* feat(ai): carry ore from clan mines to storageValentin Popov2026-11-141-3/+57
| | | | 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): evaluate factory guards and threats to the baseValentin Popov2026-11-141-1/+1
| | | | Single.01 reaches the end of Problems0 and enters its building protection and construction jobs. Confirm radius boundaries, first-factory order, hero priority and duplicate exclusion via GOG ai.dll. Unavailable building upgrades log a stub and return no eligible target.
* feat(ai): route capturing robots to building communicatorsValentin Popov2026-11-141-64/+92
| | | | Use the communicator triangles as an explicit approximation to the building approach. Share ownership and distributor transfer with player capture. Single.01 reaches the target XY in terrain routing, with the interior height gap still blocking transfer. The capture check rejects the wrong floor.
* feat(ai): send scripted capturers toward hostile buildingsValentin Popov2026-11-141-1/+1
| | | | Single.01 dispatches its placed warbot and later factory robots from stock startup. Approach uses the shared movement task. Ownership transfer, native approach points and the script completion expressions remain open.
* feat(ai): evaluate clan combat strength in scriptsValentin Popov2026-11-141-0/+22
| | | | Use the live roster and Control weapon and capacity data in Handler(38). The original ai.dll rating formula was exercised with three capacity vectors. Single.01 reaches Handler(35) and retains factory production. Remaining ammunition and the exact selector 0x36 capacity are reported as an approximation.
* feat(ai): start the highest-priority clan script problemValentin Popov2026-11-141-0/+23
| | | | Open the matching Start section after Problems0, expose its arguments, and support completion and unreserved placed-unit selection. Two Fortresses enters its laboratory job and reaches Handler(6). Timing, ties and continuation remain explicit approximations.
* feat(ai): expose clan roster counts to problem scriptsValentin Popov2026-11-141-5/+9
| | | | Handler(49) counts free native-format startup slots and Handler(34) reads the live clan roster. The Two Fortresses reaches the research-dependent Handler(65) from every scheduled Problems0 invocation.
* feat(ai): patrol around script-selected objectsValentin Popov2026-11-141-3/+3
| | | | 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/+3
| | | | 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.
* feat(ai): reserve placed units for scenario ordersValentin Popov2026-11-141-0/+49
| | | | Handler(51) changes availability in the owning clan, matching a direct ai.dll call. Reserved units stay out of the free capturer query. Campaign mission 7 now finishes Init and mission 13 reserves the addressed unit.
* feat(script): evaluate scenario deadlines and timeout testsValentin Popov2026-11-141-0/+12
| | | | Handler(59) stores a DWORD deadline in Init or Mission. Handler(60) compares it strictly against the current scenario clock. The original ai.dll confirms overflow and the equality boundary. Mission 16 now reaches its scheduled message.
* feat(ai): issue scripted place patrols from clan InitValentin Popov2026-11-141-32/+6
| | | | Handler(15) читает живые клетки и направляет размещённого варбота в указанную точку. Кампания 01, миссия 02 при штатном старте ставит четыре патруля и продолжает Init до Handler(51).
* feat(runtime): capture enemy buildings from communicatorsValentin Popov2026-11-141-5/+35
|
* fix(runtime): fail the mission when the local hero diesValentin Popov2026-11-141-0/+23
|
* feat(runtime): execute the hero teleport exit eventValentin Popov2026-11-141-14/+89
|
* fix(runtime): capture the main teleport from the communicator floorValentin Popov2026-11-141-2/+4
|
* feat(runtime): enable the Teleport mobile HQ objectiveValentin Popov2026-11-141-132/+215
|
* feat(runtime): execute scripted place patrol ordersValentin Popov2026-11-141-2/+58
|
* fix(runtime): recognize the generator capture platformValentin Popov2026-11-141-5/+24
|
* fix(runtime): transfer captured buildings between resource distributorsValentin Popov2026-11-141-12/+39
|
* fix(runtime): set tutorial production thresholds from live clansValentin Popov2026-11-141-27/+31
|
* feat(runtime): count exact clan classes in mission scriptsValentin Popov2026-11-141-24/+67
|
* feat(runtime): build a free robot at a captured factoryValentin Popov2026-11-141-1/+1
|
* feat(runtime): capture neutral buildings at communicatorsValentin Popov2026-11-141-0/+127
|
* feat(runtime): expose live clan ownership to mission scriptsValentin Popov2026-11-141-11/+31
|
* feat(runtime): replenish AutoDemo clans after combat lossesValentin Popov2026-11-141-1/+7
|
* feat(game): let the player capture neutral warbotsValentin Popov2026-11-141-31/+120
|
* feat(runtime): resolve mission objectives and outcomeValentin Popov2026-11-141-12/+174
|
* feat(runtime): count live clan objects in mission scriptsValentin Popov2026-11-141-15/+85
|