Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI Patch V2 #2566

Merged
merged 6 commits into from Sep 14, 2018

Conversation

Projects
None yet
3 participants
@Uveso
Copy link
Contributor

Uveso commented Aug 6, 2018

Again an AI only fix :)

I fixed some engineer assist functions and the sorian custom unit replacement function.
Also added better error messages for ACU enhancments and some AI functions.

Changelog:

AIEconomicBuilders.lua

Added AssisteeType to Builder T1 Engineer Find Unfinished


AILandAttackBuilders.lua

function LandAttackCondition()
-Fix: Added check for missing locationmanager


AISeaAttackBuilders.lua

function SeaAttackCondition()
-Fix: Added check for missing locationmanager


SorianEconomicBuilders.lua

-Fix: Added AssisteeType to several Builders


aiutilities.lua

function AIGetSortedMassWithEnemy()
-Fix: Adjusted masspoint location check for map border

function AIGetSortedMassLocations()
-Fix: Added masspoint location check for map border


AttackManager.lua

function FormAttackPlatoon()
-Fix: Better error mesage in case of invalid location manager


sorianutilities.lua

function GetTemplateReplacement()
-Fix: In case we don't have an default ingame unit squad use the modded squad to 100%.


defaultantiprojectile.lua

unitstate RedirectingState()
-Fix: Added failsafe in case of missing enemy position


SorianBuildConditions.lua

function CanBuildOnHydroLessThanDistance()
-Fix: Better error mesage in case of invalid location manager


EffectUtilities.lua

function SpawnBuildBots()
-Fix: Added failsafe in case a unit is destoyed while building


platoon.lua

function OnDestroy()
-Fix: removed PlatoonDisband() function (added by Duncan).

function PlatoonDisband()
-Fix: Unneded values will now removed from any unit while the platoon is disbanding
-Fix: Destroying AIThread if present, before the platoon is disbanding

function RepairAI()
-Fix: optimized Do-Until loop

function ManagerEngineerFindUnfinished()
-Fix: Added proper loop until the unit is finished.

function ManagerEngineerAssistAI()
-Fix: Added proper loop to check if the enginner is still assisting
-New: Added check for new builder condition AssistUntilFinished for engineers

function EconAssistBody()
-Fix: Added failsafe in case a engineer is missing/destroyed
-Fix: Better error mesage in case of invalid or missing AssistLocatio or AssisteeType
-New: Added AssistClosestUnit. Unit will asssit the nearest building, not the one with least assisters

function EngineerBuildAI()
-Fix: Unitreplacement is no longer using non existing global squads if an modded unit exist.

function UnitUpgradeAI()
-New: Added builder conditon OverideUpgradeBlueprint so we can upgrade to supportfactories

function EconUnfinishedBody()
-Fix: Added UnitBeingAssist for the assist wait loop

function ProcessBuildCommand()
-Fix: Added check for assisting units


Builder.lua

function StoreHandle()
-Fix: Removed forked thread that was waiting 1 second before a platoonhandle was deleted.


EngineerManager.lua

function AssignEngineerTask()
-Fix: Added check for assisting and building engineers to prevent new orders while still working


FactoryBuilderManager.lua

function GetFactoryTemplate()
-Fix: reworked sorian unitreplacement (customunits) for factories. Now using all available units.


Unit.lua

function OnWorkBegin()
-Fix: Better error message in case a ACU enhancment fails


ThreatBuildConditions.lua

function EnemyThreatGreaterThanValueAtBase()
-Fix: Added check for missing locationmanager

function EnemyThreatLessThanValueAtBase()
-Fix: Added check for missing locationmanager

function HaveLessThreatThanNearby()
-Fix: Added check for missing locationmanager


MarkerBuildConditions.lua

function CanBuildOnMassLessThanDistance()
-Fix: Added check for missing locationmanager


SorianBuildConditions.lua

function EnemyThreatLessThanValueAtBase()
-Fix: Added check for missing locationmanager

function CanBuildOnHydroLessThanDistance()
-Fix: Added check for missing locationmanager


UnitCountBuildConditions.lua

Added new function CheckBuildPlattonDelay(aiBrain, PlatoonName)


upgradetemplates.lua

-Fix: Corrected unitID's for sonar upgrades

Uveso added some commits Aug 6, 2018

Finished patch II
AIEconomicBuilders.lua

Added AssisteeType to Builder `T1 Engineer Find Unfinished`

------------------------------------------------------------------------------------

AILandAttackBuilders.lua

function LandAttackCondition()
-Fix: Added check for missing locationmanager

------------------------------------------------------------------------------------

AISeaAttackBuilders.lua

function SeaAttackCondition()
-Fix: Added check for missing locationmanager

------------------------------------------------------------------------------------

SorianEconomicBuilders.lua

-Fix: Added AssisteeType to several Builders

------------------------------------------------------------------------------------

aiutilities.lua

function AIGetSortedMassWithEnemy()
-Fix: Adjusted masspoint location check for map border

function AIGetSortedMassLocations()
-Fix: Added masspoint location check for map border

------------------------------------------------------------------------------------

AttackManager.lua

function FormAttackPlatoon()
-Fix: Better error mesage in case of invalid location manager

------------------------------------------------------------------------------------

sorianutilities.lua

function GetTemplateReplacement()
-Fix: In case we don't have an default ingame unit squad use the modded squad to 100%.

------------------------------------------------------------------------------------

defaultantiprojectile.lua

unitstate RedirectingState()
-Fix: Added failsafe in case of missing enemy position

------------------------------------------------------------------------------------

SorianBuildConditions.lua

function CanBuildOnHydroLessThanDistance()
-Fix: Better error mesage in case of invalid location manager

------------------------------------------------------------------------------------

EffectUtilities.lua

function SpawnBuildBots()
-Fix: Added failsafe in case a unit is destoyed while building

------------------------------------------------------------------------------------

platoon.lua

function OnDestroy()
-Fix: removed PlatoonDisband() function (added by Duncan).

function PlatoonDisband()
-Fix: Unneded values will now removed from any unit while the platoon is disbanding
-Fix: Destroying AIThread if present, before the platoon is disbanding

function RepairAI()
-Fix: optimized Do-Until loop

function ManagerEngineerFindUnfinished()
-Fix: Added proper loop until the unit is finished.

function ManagerEngineerAssistAI()
-Fix: Added proper loop to check if the enginner is still assisting
-New: Added check for new builder condition `AssistUntilFinished` for engineers

function EconAssistBody()
-Fix: Added failsafe in case a engineer is missing/destroyed
-Fix: Better error mesage in case of invalid or missing AssistLocatio or AssisteeType
-New: Added `AssistClosestUnit`. Unit will asssit the nearest building, not the one with least assisters

function EngineerBuildAI()
-Fix: Unitreplacement is no longer using non existing global squads if an modded unit exist.

function UnitUpgradeAI()
-New: Added builder conditon `OverideUpgradeBlueprint` so we can upgrade to supportfactories

function EconUnfinishedBody()
-Fix: Added UnitBeingAssist for the assist wait loop

function ProcessBuildCommand()
-Fix: Added check for assisting units

------------------------------------------------------------------------------------

Builder.lua

function StoreHandle()
-Fix: Removed forked thread that was waiting 1 second before a platoonhandle was deleted.

------------------------------------------------------------------------------------

EngineerManager.lua

function AssignEngineerTask()
-Fix: Added check for assisting and building engineers to prevent new orders while still working

------------------------------------------------------------------------------------

FactoryBuilderManager.lua

function GetFactoryTemplate()
-Fix: reworked sorian unitreplacement (customunits) for factories. Now using all available units.

------------------------------------------------------------------------------------

Unit.lua

function OnWorkBegin()
-Fix: Better error message in case a ACU enhancment fails

------------------------------------------------------------------------------------

ThreatBuildConditions.lua

function EnemyThreatGreaterThanValueAtBase()
-Fix: Added check for missing locationmanager

function EnemyThreatLessThanValueAtBase()
-Fix: Added check for missing locationmanager

function HaveLessThreatThanNearby()
-Fix: Added check for missing locationmanager

------------------------------------------------------------------------------------

MarkerBuildConditions.lua

function CanBuildOnMassLessThanDistance()
-Fix: Added check for missing locationmanager

------------------------------------------------------------------------------------

SorianBuildConditions.lua

function EnemyThreatLessThanValueAtBase()
-Fix: Added check for missing locationmanager

function CanBuildOnHydroLessThanDistance()
-Fix: Added check for missing locationmanager

------------------------------------------------------------------------------------

UnitCountBuildConditions.lua

Added new function CheckBuildPlattonDelay(aiBrain, PlatoonName)
@speed2CZ

This comment has been minimized.

Copy link
Member

speed2CZ commented Aug 6, 2018

It looks good

AutoSandbox
This fix is for skirmish singleplayer launch
in case the game victory setting is not sandbox.
You can now start the game and sandbox is set automatically.

@PhilipJFryFAF PhilipJFryFAF changed the base branch from develop to deploy/fafdevelop Sep 14, 2018

@PhilipJFryFAF PhilipJFryFAF merged commit 6b59b23 into FAForever:deploy/fafdevelop Sep 14, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Uveso Uveso deleted the Uveso:AIUpdateII branch Jan 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.