aboutsummaryrefslogtreecommitdiff
path: root/docs/appendices
Commit message (Collapse)AuthorAgeFilesLines
* fix(combat): use authored range for autonomous weaponsValentin Popov9 days1-0/+3
|
* fix(render): size warbot shield pulses from mounted modelsValentin Popov9 days1-2/+4
|
* feat(render): play authored shield pulses on impactValentin Popov9 days1-1/+2
| | | | Use the Control 9 resource and impact basis to start three reusable mode-1 instances per owner. Draw the Op9 layers with the sampled MAT0 color and start the authored Op2 sound. Check the blue pulse and its expiry in a fixed-camera Vulkan run.
* feat(combat): spend directional shield charge before hull damageValentin Popov9 days1-0/+2
| | | | 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): animate player weapon tracks during firingValentin Popov9 days1-0/+2
| | | | Sample the authored barrel tracks on the existing weapon clock before resolving the muzzle. Check Control phase interpolation against the original DLL and verify plasma rifle travel in a fixed-camera capture on the stock firing range.
* feat(factory): release assembled warbots above the roofValentin Popov9 days1-3/+3
| | | | 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(render): throw detached chassis nodes as fragmentsValentin Popov9 days1-2/+3
| | | | 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(render): hide exhausted chassis geometryValentin Popov9 days1-1/+2
| | | | Use provider depletion and the node visibility flag to suppress the projected Vulkan ranges of a failed chassis part. The matching camera fixture shows the heavy warbot losing one track section after a hit while the rest of the hull remains visible.
* feat(combat): apply projectile hits to chassis nodesValentin Popov9 days1-3/+4
| | | | 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-3/+2
| | | | 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): reduce damage with Control protection coefficientsValentin Popov9 days1-0/+2
| | | | Keep the two damage coefficients in the existing tag-27 owner cache and apply the native quadratic clamp to projectile contacts. The calculation matches live GOG damage samples at single precision, and the AutoDemo window reaches combat and replacement after the change.
* feat(combat): play explosions for depleted building partsValentin Popov9 days1-0/+2
| | | | Use the EXPL referenced by the struck NDP row once the part runs out of capacity. Queue the blast at contact and keep the rest of the structure alive. The renderer shows the stock bunker effect in the Vulkan damage fixture.
* feat(combat): give idle warbots local defensive fireValentin Popov9 days1-3/+4
| | | | 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.
* fix(combat): let projectiles damage animalsValentin Popov9 days1-0/+2
| | | | Verify the placed Constructor animal can be reached by a projectile segment, wounded and removed. The stock mission also starts in the Vulkan window.
* feat(audio): drive chassis engine loops from actual movementValentin Popov9 days1-1/+5
| | | | Prepare the authored root-node CTL attachments and feed Control speed limits plus observed motion into FX modes 5 and 15. The stock AutoDemo window queues ground and flight engine loops from the starting scene.
* feat(repair): restore hull health on factory and hangar padsValentin Popov9 days1-0/+2
| | | | Check both authored Constructor volumes, ownership and departure in a licensed integration test. Validate Constructor in a window from stock start. Facility power, ammunition and the repair rate are open.
* feat(production): let new units clear the factory before taking ordersValentin Popov9 days1-1/+2
| | | | 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.
* fix(transport): load and unload at the building perimeterValentin Popov9 days1-1/+2
| | | | Verify the AI transport fills at the mine and unloads at the storage facility from stock Single.01, in the licensed test and the game window.
* fix(production): wait for a clear ground release pointValentin Popov9 days1-1/+2
| | | | Validate stock completions from Single.01 with Vulkan validation and check produced hulls against live occupancy. The licensed long transport scenario still fails at storage unloading with both the previous and the new release point.
* feat(combat): show detached assemblies after chassis destructionValentin Popov9 days1-1/+3
|
* feat(combat): play the referenced explosion on chassis destructionValentin Popov9 days1-0/+3
| | | | | | 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-1/+3
| | | | | | 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-2/+5
| | | | | | 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/+3
| | | | | | 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.
* fix(movement): drive tread material cycles from chassis travelValentin Popov9 days1-1/+3
| | | | | | Bind animated tread batches to their individual hull displacements. Preserve the authored phase sequence and derive nominal cycle length from the Control speed, scale and MAT0 duration. Checked stock tracked models in the normal AutoDemo window with Vulkan validation clean. Signed travel, stop and respawn are covered by a unit test. Per-track turning and physical cycle length are approximate.
* feat(combat): aim autonomous turrets with authored tracksValentin Popov9 days1-0/+2
| | | | | | 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.
* feat(movement): play authored walking cycles from chassis travelValentin Popov9 days1-2/+4
| | | | | | 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-0/+2
| | | | | | 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-0/+2
| | | | | | 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.
* feat(movement): roll authored wheel loops from chassis travelValentin Popov9 days1-0/+2
| | | | | | Select wrapping controller rows backed by a full MSH rotation around a fixed axle. Use chassis displacement and the wheel radius to advance each loop. Sample the wheel nodes in the live component hierarchy and reset the phase when the rendered slot gets a new owner. The stock wheeled chassis samples a quarter turn after a quarter circumference and retains it while still. AutoDemo spawned the chassis and ran with clean Vulkan validation. Gait, tracks and in-place turning remain open.
* fix(movement): account for vehicle traffic along ground routesValentin Popov9 days1-5/+5
| | | | | | 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-0/+2
| | | | | | 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-2/+0
| | | | | | 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-0/+3
| | | | | | | | | | | | 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/+4
| | | | | | | | | | 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): exclude depleted objects from clan resourcesValentin Popov9 days1-2/+2
| | | | | | | | | | Apply the original Behavior resource distributor's 0xfffe state guard before resource callbacks in both passes. Keep the object, distributor row, shares and previous scratch words intact. Move the two-pass driver out of lib.rs into resource_distribution.rs without changing its allocation arithmetic. The GOG Behavior.dll RVA 0x19e80 oracle preserves seeded scratch fields and performs only lookup/state callbacks for a depleted object. The licensed stock mission-19 raid reduces clan power output from 10.07 to 10 per second after bunker depletion while retaining its live world object and distributor entry. The small 0.07 contribution is below the window title's display precision. Verified the stock raid in the game window with the hero at the starting position: bunker root reaches zero at 329760 ms, Attack finishes and queued retreat begins. Destruction visuals and other Control lifecycle paths remain incomplete; this does not establish whole-mission parity. Validation: cargo fmt --all -- --check; cargo check --workspace; cargo test --workspace; release build; focused Rust and licensed-stock tests; native DLL oracle; all 29 stock missions at --sim-report 900 (existing motion_factory_5 stub allowed). No new unsupported commands or damage errors, and world summaries match the preceding commit.
* fix(behavior): finish attacks against depleted targetsValentin Popov9 days2-2/+25
| | | | | | | | | | | | | | | | | | | | | | | 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(control): apply static root and critical-node depletionValentin Popov9 days2-5/+25
| | | | | | | | | | | | | | | | | | | | Native Control+0x10f30 marks root/critical depletion with +0x550=0xfffe. Class 3 then returns without death notifications, deletion timers or a root cascade. Preserve that predicate through repair, and permit the native already-marked path while retaining explicit errors for unsupported deaths. Move the shared amount update out of the large runtime module. Validation: native x86 DLL oracle at x87 CW 0x007f for root/critical depletion, repair and an already-marked mobile owner; Rust rule tests; licensed stock mission-19 raid; workspace fmt/check/tests and release build. All 29 stock 900-second reports pass with unchanged world/outcome summaries and no combat damage_error entries. The windowed stock raid depleted bunker node 0 at 329083 ms, with the hero left at the stock start throughout. Scope is Control amount/marker publication. Static structures stay in the world. Stage propagation, ruins, effects and finishing an attack against an exhausted static target remain open; projectile damage is still approximate. The affected mission-19 target is a bunker, not a factory.
* feat(diagnostics): retain combat chronology and failures by objectValentin Popov9 days1-1/+6
| | | | | | | | | | | | | | | | | | | 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 days2-5/+42
| | | | | | | | | | | | | | | | | | | | | | | | | 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(control): refresh motion limits after node damageValentin Popov9 days1-3/+7
| | | | | | | | | | | | | | | | | | | | | | | Run the supported dirty Control profile branch on the resource clock, before the existing factory/laboratory budget pass. Mobile owners now participate in these clocks. Root hits reduce the drive's current E00 value and the next place-patrol speed request uses the updated limit. Keep mutable node-group means and publish profile words atomically. Move FCA0 projection into control_profile rather than extending lib.rs. Count clock checks, publications and unsupported updates per object; alarm damage, activation and mobile device budgets remain explicit gaps. Native Control.dll RVA 0x12a40 -> 0xfca0 confirms mean retention, clean-call behavior and the healthy-critical-group branch that bypasses the aggregate threshold. Golden outputs are covered by Rust tests. SHA-256: bcb86318089028548a178b03a21accdce15df0cc85ddd91674cf3c2f55012c6e. Validated fmt, workspace check/tests, release, licensed stock damage, combat and patrol regressions, plus all 29 stock missions for 900 seconds without new profile-update stops. Stock window AI hits change limits. The additional live native interception yielded no usable sample; its supported calculation branches were executed directly in the DLL.
* fix(patrol): request place patrol speed from Control limitsValentin Popov9 days1-0/+3
| | | | | | | | | | | | | | | | | | | 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-0/+3
| | | | | | | | | | | | | | | | | | | | 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.
* fix(combat): launch AI projectiles from mounted weapon CPTsValentin Popov9 days1-1/+4
| | | | | | | | | | | | | | | | | | 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(research): advance laboratory Control energy budgetsValentin Popov9 days2-8/+8
| | | | | | | | | | | | | | | | | | | | Paid laboratory work read a work-device coefficient that never received a Control budget update. Run the recovered resource clock and budget for laboratories as well as factories, so energy work follows the actual device allocation. Generalize the state and report counters to control_resource_*. A licensed outage regression drains the lab reserve and removes external power: energy work stays fixed while task time advances, then resumes when the original generation is restored. Stock research for both AI clans, player free research and paid factory production still pass. The original laboratory task reaches its class-3 Control owner, whose native budget runs on the same quarter-second resource path as the factory. Verified this in the running stock mission through Behavior 0x2f76e and Control 0x2d340. Workspace fmt/check/tests and release build pass. All 29 stock missions run 900 seconds without script or resource-budget stops. A stock mission-28 window completes paid technologies and starts subsequent projects. Control initial phase, RNG seed, other owners and global ordering remain approximate.
* fix(production): use Control energy budgets for factory workValentin Popov9 days2-2/+13
| | | | | | | | | | | | | | | | | | | | Factories now run the recovered Control resource-budget pass on its own randomized clock before Behavior task updates. Paid production reads its current work-device E00 value, including the local power reserve and allocation, instead of gating full speed on any clan generation. The clock redraws jitter on every accepted frame and uses a separate Control RNG. Initial phase, seed and ordering with other owners remain explicit approximations. Budget failures preserve the table and are counted per owner. Original DLL calls verify the budget callbacks, strict deadline, per-call RNG, forced update and inactive baseline. A live class-3 factory executes the same budget with the default 250 ms setting. Licensed regressions cover an empty factory power reserve, subsequent generator capture, four completed paid orders, the Behavior task deadline and scripted warbot/transport/builder births. Workspace fmt/check/tests and release build pass. All 29 stock missions run 900 seconds without script or new budget stops. Stock mission 28 accepts and completes a free and then a paid player order in the Vulkan-validation window.
* fix(production): pace factory tasks with the Behavior timerValentin Popov9 days1-0/+3
| | | | | | | | | | | | | | Factory orders used to advance on every render/headless step, although the ore request contains a per-call increment. Gate active free and paid orders with the shared Behavior 1/1 task clock, without catch-up updates. Report admitted steps per clan and factory; idle owner phase and full RNG ordering remain explicit approximations. Live GOG Behavior.dll calls at RVA 0x2a4f0 pass through 0x34a30 and 0x54a0 with timer words 1/1. A licensed regression verifies the strict deadline and resource pull; paid production and scripted warbot, transport and builder regressions pass. Workspace fmt/check/tests and release build pass. Stock 29-mission simulation and a stock mission-28 window check cover integration.
* feat(ai): build requested builders from the clan catalogValentin Popov9 days1-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scripted builder requests could not reach production: Handler(15) only accepted warbots/transports, and the factory searched player prebuilds for a builder. Prepare a clan's unique qualified builder design alongside its transport design and allow that class through the factory order callback. Register the produced builder's logical ID and ore state so clan queries and construction tasks can use it. Rename the shared design module by its factory mechanic and retain the existing single-qualified-design boundary. Native evidence: GOG ai.dll SHA-256 c19cd6cd31cd2896f8c4ba0f0e700dd3408aec8182daaf4863d98a7d233a2abc, selector RVA 0x107c0, selects sml_bldr.dat for class 0x01004000 / SELECT_FASTEST from a captured stock Single.01 catalog; clearing its eligibility rejects the request. The same call still selects sml_cargo.dat for transport. Ore initialization reuses the previously executed Behavior RVA 0x8790 class initializer; this does not prove the full native factory lifecycle. Validated fmt, workspace check/tests, release build and all 29 stock --sim-report 900 runs. The licensed regression first exposed the missing scheme, then caught the remaining callback class gate. It now removes the starting builder as a debug casualty, lets the real scenario request its replacement, and checks its birth, owner, clan registration and ore state. The adapted transport regression also passes the joint player/AI queue, player scheme visibility and transport cargo checks with the shared list. Window checks: normal stock mission 28 ran with continuing research and production. A separate debug copy transferred the old builder and moved the hero near the factory; the scenario ordered and visibly produced sml_bldr.dat, then reached a construction request with the new builder. These debug conditions do not establish mission acceptance from stock start. Temporary roots were removed and the original probe's map restored. Handler(58) remains explicit: its candidate predicate still needs Control 0x209/0x20c, next-stage BuildDat lookup and builder order 0x18. Native AI priorities/full chronology, multi-design ranking/RNG and factory timing remain approximate. A live native sample yielded other unit births, so it is not evidence of native builder replacement timing or starting cargo.
* fix(ai): expose the native research catalog scan statusValentin Popov9 days2-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Handler(56) returned a constant zero and was described as an automatic research permission flag. It actually normalizes the cached candidate scan byte. Read ResearchCandidateSet.status without refreshing the catalog and report queries by clan and result instead of counting them as stubs. GOG ai.dll SHA-256 c19cd6cd31cd2896f8c4ba0f0e700dd3408aec8182daaf4863d98a7d233a2abc: Handler(56), RVA 0xe430, reads AI+0x431. Native calls to this getter and the chooser at 0x10f90 confirm that finishing the last candidate preserves the old scan flag until the next refresh. Empty/processed sets, missing pending candidates, stale flags, and noncanonical nonzero bytes were exercised. A live stock Single.01 query also returned zero from the same cached byte. The shipped scream.scr condition suppresses the laboratory request for a nonzero result. An ignored resource test executes that original condition and request for cached bytes 0, 1 and 255; an ordinary Rust test covers the cached-state semantics and missing catalog. This isolated branch check does not establish that an entire mission has exhausted all research naturally. Validated fmt, workspace check/tests, the licensed scenario-branch test and the release build. All 29 stock missions pass --sim-report 900 without new script stops; stock mission 28 also runs in the window with ongoing research and the native zero result. None of these stock runs reached a nonzero scan flag. Handler(58) upgrades and Handler(65) candidate power remain explicit stubs, and full timed AI/mission parity remains open.
* fix(ai): account for occupied clan mind slotsValentin Popov9 days1-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.