Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finally this patch will fix the game slowdown on long AI games. Reason for the slowdown was the engineermanger while ping pong forking functions. This was causing in the end a engine slowdown a finally a stack buffer overrun. This patch also stores almost every forked thread to the corresponding unit/weapon, so it can be destroyed on unit dead to prevent parentless threads. The transport function is now using surfaceghight for the transportation target for faster unit drops. Also fixed an issue where the ACU is not moving on gamestart. This was caused by the `BlockCommandQueue` from the ACU WarpInAnimation Changelog: ------------------------------------------------------------------------------------ aiarchetype-managerloader.lua function ExecutePlan() -Opt: Storing Forked Thread inside the aiBrain Trashbag for better performance ------------------------------------------------------------------------------------ AIBehaviors.lua function CommanderThread() -Opt: Added check for 'BlockCommandQueue' to prevent stucked ACU after WarpInAnimation function CommanderThreadImproved() -Opt: Added check for 'BlockCommandQueue' to prevent stucked ACU after WarpInAnimation function GetClosestShieldProtectingTarget() -Opt: Added safeguard for dead attacker or target function CommanderThreadSorian() -Opt: Added check for 'BlockCommandQueue' to prevent stucked ACU after WarpInAnimation ------------------------------------------------------------------------------------ SorianStrategyBuilders.lua BuilderGroup 'Sorian Excess Mass Strategy' -Opt: Storing Forked Thread inside the aiBrain Trashbag for better performance ------------------------------------------------------------------------------------ AttackManager.lua function FormAttackPlatoon() -Opt: Storing Forked Thread inside the aiBrain Trashbag for better performance ------------------------------------------------------------------------------------ aiutilities.lua function UseTransports() -Opt: Changed command WaitTicks() to coroutine.yield() for better performance -Opt: Added surfacehight to trasnport location for faster unit unloading function EngineerTryReclaimCaptureArea() -Fix: Function now only returns true if we have valid unit for capture function UseTransports -Fix: Added IssueClearCommands for transports to prevent flightloops ------------------------------------------------------------------------------------ sorianutilities.lua function Nuke() -Opt: Storing Forked Thread inside the aiBrain Trashbag for better performance ------------------------------------------------------------------------------------ aibrain.lua function AddBuilderManagers() -Opt: Added a baseType to every expansion for faster expansion count function GetManagerCount() -Opt: To count expansions we are now searching for a baseType not 8 x name search function InitialAIThread -Fix: Delaying the AI so it can't reclaim the start area before it's cleared from the ACU landing blast. ------------------------------------------------------------------------------------ cybranunits.lua Class CConstructionEggUnit() -Opt: Storing Forked Thread inside the Unit Trashbag for better performance ------------------------------------------------------------------------------------ aiattackutilities.lua function GetBestThreatTarget() -Fix: changed missplaced variables in GetThreatAtPosition call ------------------------------------------------------------------------------------ defaultunits.lua function OnPrepareArmToBuild() (ConstructionUnit Class) -Opt: Storing Forked Thread inside the Unit Trashbag for better performance function OnPrepareArmToBuild() (CommandUnit Class) -Opt: Storing Forked Thread inside the Unit Trashbag for better performance ------------------------------------------------------------------------------------ platoon.lua several functions() -Opt: Changed command WaitTicks() to coroutine.yield() for better performance function AssistBody() -Opt: Moved safeguard for nonexisting platoons at the start of the function function EngineerBuildAI() -Opt: Removed old sorianfunction for delaying platoonbuilder -Fix: Excluded StationAssitPods from building tasks -Opt: Using now .Location instead of the functioncall :GetLocationCoords() -Fix: The safeguard at the end of the function is now working function WatchForNotBuilding() -Opt: Removed unused unitstate checks function ProcessBuildCommand() -Opt: replaced BuildToNormalLocation and NormalToBuildLocation and used numbers directly -Fix: Units now get capture/reclaim and buildcommands queued instead of looping the ProcessBuildCommand -Fix: Prevent disbanding a platoon while on a transport function EngineerBuildAISorian -Opt: Removed old sorianfunction for delaying platoonbuilder -Opt: Using now .Location instead of the functioncall :GetLocationCoords() ------------------------------------------------------------------------------------ ScenarioUtilities.lua function CommanderWarpDelay() -Opt: Removed BlockCommandQueue for AI brains ------------------------------------------------------------------------------------ EngineerManager.lua several functions() -Opt: Changed command WaitTicks() to coroutine.yield() for better performance function AddUnit() -Fix: Excluded StationAssitPods from building tasks -Fix: Changed the logic of forking threads to prevent gameslowdown at +1 hour function GetNumCategoryBeingBuilt() -Opt: returning a value directly without defining it local function TaskFinished() -Fix: Changed the logic of forking threads to prevent gameslowdown at +1 hour Removed functions: EngineerWaiting, InitialWait, DelayAssign, DelayAssignBody -Fix: Changed the logic of forking threads to prevent gameslowdown at +1 hour Replaced removed functiosn with new functions: ForkEngineerTask, DelayAssign, Wait, EngineerWaiting -Fix: Changed the logic of forking threads to prevent gameslowdown at +1 hour ------------------------------------------------------------------------------------ Unit.lua function DeathThread() -Opt: Destroy trashbags only if not already done function DestroyAllTrashBags() -New: This function clears all trashbags and unit effects function OnDestroy() -New: Destroy trashbags only if not already done inside DeathThread() function StopRocking() -Opt: Only kill a thread when it actual exist. ------------------------------------------------------------------------------------ Blueprints.lua function HandleUnitWithBuildPresets() -New: Adding SACU presets as unit category for AI builders ------------------------------------------------------------------------------------ CIFArtilleryProton01_script.lua function OnImpact() -Opt: Storing Forked Thread inside the Projectile Trashbag for better performance ------------------------------------------------------------------------------------ UEL0001_script.lua function CreateEnhancement() -Opt: Storing Forked Thread inside the Unit Trashbag for better performance ------------------------------------------------------------------------------------ UEL0301_script.lua function CreateEnhancement() -Opt: Storing Forked Thread inside the Unit Trashbag for better performance ------------------------------------------------------------------------------------ XRB2308_script.lua function OnStopBeingBuilt() -Opt: Storing Forked Thread inside the Unit Trashbag for better performance function StartSinking() -Opt: Storing Forked Thread inside the Unit Trashbag for better performance ------------------------------------------------------------------------------------ XRB2309_script.lua function StartSinking() -Opt: Storing Forked Thread inside the Unit Trashbag for better performance
- Loading branch information