|
Register and log in to move these advertisements down
How to set up AI for a new Faction
Elrond99
|
Category: |
Code |
Level: |
Intermediate
|
Created: |
Sunday August 31, 2008 - 7:08 |
Updated: |
Monday September 1, 2008 - 12:32 |
Views: |
9825 |
Summary: |
Tutorial that takes you through all necessary steps to create a new BFME2/ROTWK AI |
|
Rating
Staff says
3.7
|
Members say
4.2
|
Average
4.0/5.0
|
8 votes
|
Rohan Army
Ok, I´ll post the complete code for the Rohan Army here, and explain it on the next page, cause it´s a lot of code
Code |
ArmyDefinition RohanArmy
Side = Rohan
;//
;// PRODUCTION AI PARAMETERS
;//
MustUseCommandPointPercentage_Phase1 = 90% ;// The AI UnitBuilder tries to keep the army at at least this size
MustUseCommandPointPercentage_Phase2 = 80%
MustUseCommandPointPercentage_Phase3 = 75%
StructureRebuildPriorityModifier = 200%
DefaultUnitPriority = 100.0f; ;// The default build priority for a unit for which there is no ugrency
FortressRebuildPriority = 1950.0f; ;// Priority at which a fortress will rebuild
LowUnitPriorityModifier_Rush = 50.0 ;// When we are low on units we multiply percentCommandPtsUsed/100 * <this number>
LowUnitPriorityModifier_MidGame = 80.0 ;// then add the result to the current unit priority in the build queue
LowUnitPriorityModifier_EndGame = 100.0 ;// (the bigger this number is the faster a unit will bubble to the top when
;// we're low on units)
EconomyBuilderMinFarmsOwned = 4
EconomyBuilderMinMoney = 200
EconomyBuilderPerFarmValue = 70
EconomyBuilderPerSecPriorityIncreaseBase = 30.0
EconomyBuilderMinTimeBetweenFarms_Rush = 15.0f;
PercentToSave_Rush = 1.0%
PercentToSave_MidGame = 3.0%
PercentToSave_EndGame = 4.0%
PhaseDuration_Rush = 270.0 ;//amount of time in seconds from the beginning of a match
PhaseDuration_MidGame = 280.0 ;//amount of time in seconds from end of Rush Phase
ChanceForUnitsToUpgrade = 85%
UpgradeSciencePriorityNormalLow = 200.0
UpgradeSciencePriorityNormalHigh = 700.0
UpgradeSciencePriorityImportantLow = 750.0
UpgradeSciencePriorityImportantHigh = 1000.0
UnitUpgradePriorityLow = 100.0
UnitUpgradePriorityHigh = 200.0
;//
;// TEAM BUILDER PARAMETERS
;//
MaxThreatForOpportunityTargets = 10.0 ;//when building a team for opportunity targets, what will the team builder use as
;//an assumed threat when building the team
ValueToSetForMaxOnDefenseTeam = 10 ;//the max number of each type of unit will get recruited onto a defense team
;//If there are no currently built units of the specific type an AI constructed team is looking for
;//it can search for replacements of a different type that are already built
;//these numbers control how deep along the Combat Chain definition the AI will search for replacements
CombatChainSearchDepthForTeamRecruits_AttackTeams = 2;
CombatChainSearchDepthForTeamRecruits_DefenseTeams = 7;
CombatChainSearchDepthForTeamRecruits_ExploreTeams = 7;
;//
;// TACTICAL AI PARAMETERS
;//
;// the number and types of targets that the AI is simultaneously interested in at any given point
TacticalAITargets = DEFENSIVE ENEMY_STRUCTURE OPPORTUNITY EXPANSION ;//ENEMY_STRUCTURE DEFENSIVE OPPORTUNITY OPPORTUNITY
MaxTeamsPerTarget = 1 2 1 1
SecondsTillTargetsCanExpire = 14.0
ChanceForTargetToExpire = 50%
MaxBuildingsToBeDefensiveTarget_Small = 1
MaxBuildingsToBeDefensiveTarget_Med = 4
;// anything bigger than MaxBuildingsToBeDefensiveTarget_Med is considered a Large defensive target
ChanceToUseAllUnitsForDefenseTarget_Small = 10%
ChanceToUseAllUnitsForDefenseTarget_Med = 25%
ChanceToUseAllUnitsForDefenseTarget_Large = 75%
;//
;// ARMY UNIT DEFINITIONS
;//
AIEconomyAssigment RohanFarm
TemplateName = RohanFarmNew
End
AIWallNodeAssignment RohanWallHub
TemplateName = RohanWallHubSmall
End
ArmyMemberDefinition RohanPeasantNewHorde_Member
Unit = RohanPeasantNewHorde ;infantry
PercentageOfArmyPhase1 = 40.0
PercentageOfArmyPhase2 = 40.0
PercentageOfArmyPhase3 = 30.0
End
ArmyMemberDefinition RohanSpearmenHorde_Member
Unit = RohanSpearmenHorde ;spearmen
PercentageOfArmyPhase1 = 15.0
PercentageOfArmyPhase2 = 20.0
PercentageOfArmyPhase3 = 15.0
End
ArmyMemberDefinition RohanRiderHorde_Member
Unit = RohanRiderHorde ;elite cavalry
PercentageOfArmyPhase1 = 0.0
PercentageOfArmyPhase2 = 15.0
PercentageOfArmyPhase3 = 25.0
End
ArmyMemberDefinition RohanRiderArcherHorde_Member
Unit = RohanRiderArcherHorde ;elite cavalry
PercentageOfArmyPhase1 = 0.0
PercentageOfArmyPhase2 = 15.0
PercentageOfArmyPhase3 = 25.0
End
ArmyMemberDefinition ElvenEnt_Member
Unit = RohanGenericEnt ;siege weapon
PercentageOfArmyPhase1 = 5.0
PercentageOfArmyPhase2 = 15.0
PercentageOfArmyPhase3 = 20.0
End
ArmyMemberDefinition ElvenEnt_Member1
Unit = RohanEntFir ;siege weapon
PercentageOfArmyPhase1 = 5.0
PercentageOfArmyPhase2 = 5.0
PercentageOfArmyPhase3 = 10.0
End
ArmyMemberDefinition ElvenEnt_Member2
Unit = RohanFirBirch ;siege weapon
PercentageOfArmyPhase1 = 5.0
PercentageOfArmyPhase2 = 5.0
PercentageOfArmyPhase3 = 10.0
End
ArmyMemberDefinition ElvenEnt_Treebeard
Unit = RohanTreeBerd ;siege weapon
PercentageOfArmyPhase1 = 5.0
PercentageOfArmyPhase2 = 5.0
PercentageOfArmyPhase3 = 10.0
End
;//
;// HEROES
;//
HeroBuildOrder = ElvenGaladriel_RingHero RohanMerry RohanEowyn RohanEomer RohanTheoden
OffensiveBuildings = RohanBattleTowerNew GondorWell
End
|
Go to top
|
|
|
"One site to rule them all, one site to find them, one site to host them all, and on the network bind them."
© All Rights Reserved Eric Edwards ©2013.
Website programming by Bart van Heukelom, design by Clément Roy.
BFME, Battle For Middle Earth, and all assumed entities associated with them are © EA Games.
|
|