aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/unit_combat.rs
Commit message (Collapse)AuthorAgeFilesLines
* feat(game): cycle warbot cockpit control modesValentin Popov36 hours1-0/+7
|
* perf(render): prepare live factory scene geometry in backgroundValentin Popov3 days1-13/+32
|
* feat(ui): drive a strategic warbot with an automatic gunnerValentin Popov3 days1-3/+14
|
* feat(ui): assign search and destroy from the warbot panelValentin Popov3 days1-0/+4
| | | | 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(factory): build newly loaded projects without restarting the missionValentin Popov3 days1-96/+108
| | | | | | Transfer a saved design from the original designer panel, prepare it with the regular AniMesh scene builder, and queue the selected factory order. Appended world batches keep existing draw handles and gain the normal cockpit, walking animation, weapon and shield bindings. The Field Camp window witness adds a one-gun Unit DAT after mission start, uses the normal transfer and order controls, supplies the factory with a scripted test fixture, and captures the released unit with Vulkan validation clean. The two licensed factory tests also verify the assembled component records and weapon control.
* fix(combat): fire autonomous turrets along their barrel and sightsValentin Popov4 days1-3/+40
| | | | | | Transform the live CPT axis through the weapon sockets and the chassis. Mounted weapons use the same sight convergence as manual shots for compatible profiles. The autonomous ray checks current chassis and mounted geometry. Checked the Control.dll CPT transform and convergence oracle against the Rust path, observed the initial AutoDemo combat in the Vulkan window, and ran the licensed AutoDemo combat test.
* fix(combat): continue projectile flight after piercing shieldsValentin Popov4 days1-64/+29
| | | | | | Resolve shield sphere entrances before the first physical hit. Carry leftover volume into later ticks for both player and autonomous fire and let a geometric miss pass through a warbot bounding sphere. Checked Control.dll RVAs 0x1e9f0 and 0xd0c0 in-process with a sphere-only contact. The AutoDemo corpus covers a charged stop, a pierced field, and an unchanged hull on a miss. Ran the workspace suite and AutoDemo in the game window with Vulkan validation.
* fix(render): drive warbot muzzle flashes with firing phasesValentin Popov4 days1-0/+26
| | | | Use the first CPT node when the effect has no explicit override. Feed the autonomous weapon banks into the same phase sampling path as manual weapons. Confirm the effect constructor and phase reads in the original DLLs, and compare the two cannon flashes in a live AutoDemo window at the same clock sample.
* fix(combat): let projectiles destroy mounted warbot partsValentin Popov4 days1-5/+22
| | | | Resolve mounted model triangles through the sampled socket chain and publish the damage to the assembled Control provider. Remove the damaged geometry, stop weapons whose provider was depleted, and preserve already separated ranges when the chassis later dies. Confirmed with a licensed AutoDemo ray query and two frames around a controlled hit in the Vulkan window.
* fix(audio): play engine loops for autonomous missilesValentin Popov4 days1-2/+7
| | | | Keep one spatial Op2 source per flight while it moves, with separate identities from manual and scene emitters. Confirm the original mode 5 phase and verify launch, overlap and teardown on the GOG AutoDemo. Flight-speed changes and a listening comparison with the original remain open.
* fix(combat): hold default warbot targets between scansValentin Popov8 days1-19/+62
| | | | Use the Behavior mode-2 score on root XY with the strict 500-unit boundary and preserve the first equal score. Sample the two original timer intervals with their verified CRT step. Keep the prepared hostile-unit roster and disclose the open perception and RNG ordering. In the stock Two Fortresses window the stationary defender turns its turret and fires at the approaching helicopter.
* fix(combat): show muzzle flashes for manual fireValentin Popov8 days1-8/+1
| | | | Send the player's linked Control row through the existing firing flash sampler. On the stock Constructor start, the 25 mm cannon emits the authored sprite and a light at the muzzle from an external camera. Full node-driven mode-4 phase remains open.
* fix(audio): start node-attached laser sounds during wind-upValentin Popov8 days1-0/+45
| | | | | | | | | | | Use the weapon descriptor's Control group to select the mode-1 sound rows. Update them through the existing FX clock and spatial Op2 playback for both manual and autonomous weapons. The GOG Control/Effect entry points confirm the selector, epoch and phase threshold, including retriggering after a sample at the exact phase peak. The stock Two Fortresses helicopter started the original sound at both weapon nodes in a Vulkan window.
* fix(combat): recognize hits absorbed by shieldsValentin Popov9 days1-5/+9
| | | | | | Use the same impact result for manual fire and autonomous weapons. A shield that spends its charge and absorbs a whole shot completes the impact without reporting an unavailable target. Keep the existing hull damage API for callers that only need remaining health. Checked in a window on the stock Two Fortresses map. The laser first ended at the shield and then reduced hull health after the sector was depleted. At 180 seconds of AutoDemo the false unavailable reports disappear and the destruction sequence is identical.
* feat(player): lower the communicator field on captureValentin Popov9 days1-1/+3
| | | | 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.
* fix(ai): follow capture passages through building doorsValentin Popov9 days1-4/+17
| | | | 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.
* fix(combat): keep autonomous weapons active on travel ordersValentin Popov9 days1-4/+24
|
* fix(combat): use authored range for autonomous weaponsValentin Popov9 days1-16/+104
|
* feat(combat): spend directional shield charge before hull damageValentin Popov9 days1-4/+31
| | | | Resolve the nearest sector in the target basis and apply the Control 9/21 capacity before the hull modifiers. Verify power queries and depletion with the original Control DLL, then check live AutoDemo and Two Fortresses encounters from stock starts.
* feat(render): throw detached chassis nodes as fragmentsValentin Popov9 days1-3/+2
| | | | Pass the depleted node to an authored Op10 with a built-in mesh request. Reuse its existing draw ranges for the flight and keep the hull alive. The fixed-camera fixture shows the heavy track section separate and rotate after impact.
* feat(combat): apply projectile hits to chassis nodesValentin Popov9 days1-2/+2
| | | | Use prepared chassis triangles to choose a loaded NDP node. Exhausted ordinary parts play their authored EXPL independently of root death. Unresolved mounted geometry keeps a sphere contact on exit. A stock side-shot fixture exhausts a heavy chassis part while the hull survives.
* feat(combat): enable the authored weapons of hostile animalsValentin Popov9 days1-8/+70
| | | | The armed Constructor creatures use the shared enemy search and fire their CTL weapon from Gun_Y. The stock start is outside range. The close encounter fixture shows the projectile in the Vulkan window and leaves the hero at 30 percent after one hit.
* feat(combat): give idle warbots local defensive fireValentin Popov9 days1-6/+48
| | | | Free armed warbots use the existing hostile target search and fire without a movement order. A boarded warbot keeps manual firing. From the unmodified Two Fortresses start, the plant defender fires at 158.5 s and destroys the scripted capturer at 161.9 s in the Vulkan window.
* feat(production): let new units clear the factory before taking ordersValentin Popov9 days1-1/+3
| | | | 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(combat): show detached assemblies after chassis destructionValentin Popov9 days1-9/+12
|
* feat(combat): play the referenced explosion on chassis destructionValentin Popov9 days1-0/+11
| | | | | | Read the version-one EXPL reference from the depleted NDP root. Retain the death position across slot reuse and show the authored billboard, light and sound after the mesh is removed. Verified the explosion sprite after a stock AutoDemo kill, with Vulkan validation clean. Node detachment, debris particles and building destruction remain open.
* feat(combat): activate mounted flash effects on autonomous shotsValentin Popov9 days1-0/+39
| | | | | | Carry the prepared effect row with each shot. Use the existing mode 4 visual effect for that component at release, with its authored geometry, lights and CPT placement. Keep the one-shot sound on its existing event path. Verified stock AutoDemo shot frames submit the authored muzzle light with Vulkan validation clean. A matched on-screen comparison and the full flash curve remain open.
* feat(combat): play spatial sounds for autonomous weapon shotsValentin Popov9 days1-1/+58
| | | | | | Carry the firing effect and muzzle position on the shot event. Resolve single-gun effects by their matching muzzle point when there is no node link. Play each one-shot as its simulation frame arrives. Verified a stock gun sound enqueues a spatial voice with the flight starting position. AutoDemo ran with Vulkan validation clean and no playback errors. Comparison by ear with the original remains open.
* feat(combat): render authored trails for autonomous projectilesValentin Popov9 days1-1/+57
| | | | | | Send simulated flight segments, clipped at their first contact, to the shared projectile trail renderer. A final trail can be presented after its projectile body is removed. The existing render pool serves both paths independently. Verified three prepared trail families and a visible laser segment from a stock AutoDemo start with Vulkan validation clean. Stock combat tests retain contact and weapon identities.
* feat(combat): aim autonomous turrets with authored tracksValentin Popov9 days1-38/+57
| | | | | | Convert the selected target to the turret mount space and sample the authored azimuth and elevation tracks for rendering and the CPU muzzle query. Leave trigger cadence and target selection intact. Verified the stock AutoDemo launch, turret swivel with Vulkan validation clean, and a stock combat regression. Aim slew and recoil providers remain open.
* fix(behavior): finish attacks against depleted targetsValentin Popov9 days1-0/+5
| | | | | | | | | | | | | | | | | | | | | | | 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.
* feat(diagnostics): retain combat chronology and failures by objectValentin Popov9 days1-12/+95
| | | | | | | | | | | | | | | | | | | Collect shot and destruction counts with first/last mission clocks in the shared window and headless combat loop. Preserve original IDs and slot generations after deletion, including projectiles whose shooter has died. Count preparation, launch, pose and impact failures by object and cause; separate an unavailable damage result from an error and log its first target. Validation: workspace fmt/check/tests, release build, licensed stock AutoDemo through its first destruction, and stock AutoDemo in the window. All 29 stock 900-second simulation summaries and first-event times match the prior build. Rechecked missions 8 and 19 after separating damage result categories. Window/headless first shots were 18404/18533 ms and first kills 25947/25933 ms. The report exposes UnsupportedNodeLifecycle on the factory root in mission 19 and unavailable damage results on building nodes in mission 8. Their behavior is unchanged. Original five-minute chronology and broader G7 acceptance remain open; this diagnostic task identifies concrete runtime paths for further work.
* feat(combat): feed weapon charge from Control energy budgetsValentin Popov9 days1-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Keep factory-2/30 charge in the owner's Control table. AI and player banks read it before firing, debit completed shots and wait for regeneration. Preserve one charge across bank changes and accumulate energy waits by object, including an idle bank publishing after an active bank. Mobile owners now run the resource budget. Restore the shared factory-1 callbacks, factory-2/30 charging and factory-10 passive upkeep. Factory 30 uses the weapon constructor's native disabled default. Motion demand is still an explicit zero-rate stub; unsupported budgets disable charge limiting for that owner and record the reason. Execute unmodified GOG Control.dll callbacks at RVA 0x29a40/0x29a90, 0x264b0/0x26510 and 0x21860/0x21890; check the common constructor at 0x294c0. Rust golden vectors cover disabled refill, zero capacity, negative charge and x87 rounding at control word 0x007f. SHA-256: bcb86318089028548a178b03a21accdce15df0cc85ddd91674cf3c2f55012c6e. Validated fmt, workspace check/tests, release, licensed shared-bank charge exhaustion/recovery, stock combat and damaged-profile regressions. All 29 stock missions reached 900 seconds; the only mobile-budget stub was the known motion input. Observed stock window combat and replenishment. Full live native mission comparison and motion energy remain open.
* fix(combat): launch AI projectiles from mounted weapon CPTsValentin Popov9 days1-29/+163
| | | | | | | | | | | | | | | | | | Resolve weapon node poses and EXTO socket chains on the CPU, replace each mounted component root with its socket, and transform the selected CPT into the world. Test terrain sight lines from each barrel rather than the hull. Share initial Control pose sampling with the window renderer. Count missing mounts and animation fallbacks by original object ID without losing history when an object dies. Checked Control.dll RVA 0x1b4f0 by native invocation, including nonuniform scale and a rotated world matrix. cargo fmt/check/test workspace pass, as do licensed stock AutoDemo and scripted patrol/factory regressions. All 29 stock missions reach --sim-report 900 with no script interruption or weapon pose fallback. Both games were observed in stock AutoDemo windows. AI turret aim, recoil and first-shot chronology remain approximate; this change does not establish full G7 or G8 gameplay parity.
* fix(ai): leave completed clan scripts in controlValentin Popov10 days1-0/+150
| | | | | | | | | | | | | | | Do not enable synthetic guards and factory raids merely because Init used an explicit research stub. Keep the fallback for a genuine Init stop. Completed stock scripts assign defenders and factory work themselves. Replace the fallback-raid acceptance test with a stock-start script-order and robot-production check. Move the projectile regression to unit_combat and issue its patrol explicitly; its debug poses only isolate collision. Document that native idle-unit Behavior and the research-gated assault remain open. Validation: workspace fmt/check/tests, two licensed runtime tests, all 29 stock missions at 900 seconds without stops or fallbacks, and mission 28 in a Vulkan-validation window.
* feat(ai): dispatch scripted attacks against logical targetsValentin Popov2026-11-141-0/+17
| | | | 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-1/+3
| | | | 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-1/+1
| | | | 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-0/+426
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.