Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
As I ever done some parameters, there is some about military upgrade. Like a tech giving a %bonus to attack. So here, I need to know what is base attacks of units/empire, then give to AI information if this is worth it or not to get a % bonus about that.
And I was finding the vanilla game parameter quite good, because it look at exactly what I want, what is attack of units.
----------------------------------------------
<AIParameterConverter Name="EmpireUnitAttackPercent">
<!--<ToAIParameter AIParameter="AIEmpireMilitaryPower">$(Input) * 4 * $SumProperty(ClassEmpire/Garrison/ClassUnit:AttributeAttack)</ToAIParameter>-->
<ToAIParameter AIParameter="AIEmpireMilitaryPower">$(Input) * 0.3 * $Property(ClassEmpire:MilitaryPower)</ToAIParameter>
</AIParameterConverter>
----------------------------------------------
I can see this parameter is put into comment in your code, and replace with a global one.
Why ?
If I want to keep my formula but use your mod, probably I will have to use a new converter. But before I would like to know the reason of your change. Because if it's better, I should choose also that.
----------------------------------------------------
<!-- "Mill Foundry" -->
<AIParameterDatatableElement Name="TechnologyDefinitionIndustry0">
<AIParameter Name="CityProduction" Value="6"/>
<AIParameter Name="CityProductionPercent" Value="0.15"/>
<AIParameter Name="AITechMustHave" Value="0.25 * (0 max ($Property(../EmpireTypeMajor:CurrentEra) - 1)) * (0 max (1 - $Count(ClassEmpire/ClassResearch,TechnologyIndustry0)))"/>
</AIParameterDatatableElement>
----------------------------------------------------
I have no question. I find this parameters really amazing. Making AI not rushing era and get a stronger position. I will re use this idea.
I saw change in empire plan.
---------------------------------------------------------------------------
@path=AI/AIStrategicPlanDefinition[EconomicFocus].xml
<ParameterModifiers Name="EmpirePlan">
<AIModifier Name="AIEmpirePlanEconomyAndPopulation1" Value="1"/>
<AIModifier Name="AIEmpirePlanEconomyAndPopulation2" Value="1"/>
<AIModifier Name="AIEmpirePlanEconomyAndPopulation3" Value="1"/>
<AIModifier Name="AIEmpirePlanEconomyAndPopulation4" Value="1"/>
<AIModifier Name="AIEmpirePlanEmpireAndExpansion1" Value="0.2"/>
<AIModifier Name="AIEmpirePlanEmpireAndExpansion2" Value="1"/>
<AIModifier Name="AIEmpirePlanEmpireAndExpansion3" Value="0.2"/>
<AIModifier Name="AIEmpirePlanEmpireAndExpansion4" Value="1.2"/>
<AIModifier Name="AIEmpirePlanMilitary1" Value="0.5"/>
<AIModifier Name="AIEmpirePlanMilitary2" Value="0.2"/>
<AIModifier Name="AIEmpirePlanMilitary3" Value="0.2"/>
<AIModifier Name="AIEmpirePlanMilitary4" Value="0.2"/>
<AIModifier Name="AIEmpirePlanScienceAndIndustry1" Value="0.7"/>
<AIModifier Name="AIEmpirePlanScienceAndIndustry2" Value="0.7"/>
<AIModifier Name="AIEmpirePlanScienceAndIndustry3" Value="0.7"/>
<AIModifier Name="AIEmpirePlanScienceAndIndustry4" Value="0.7"/>
</ParameterModifiers>
---------------------------------------------------------------------------
What I don't understand, it's why Military is so much boosted as this Definition is made for the Economic focus phase, and AI should rather focus on empire plan about economy, pop, even science.
I changed the values related to percentage attack / defense / damage to total military value instead of the 'correct' value because military power has so big values that the others are usually ignored by the AI (in vanilla, AI NEVER gets Brigade System or Serum of Iteru because of this).
About why the L1 military tech has usually high values: because AI will spend 80% of their city build orders in units, no matter what empire state they have. This is optimal in any situation for the AI. The 0.2 values are everywhere in the file to fill the situations in which AI has enough Empire points to cover all four empire plan branches.
I check that about military.
For now I've in mind something like :
<AIParameterConverter Name="EmpireUnitAttackPercent">
<ToAIParameter AIParameter="AIEmpireMilitaryPower">
$(Input) * (4 * $SumProperty(ClassEmpire/Garrison/ClassUnit:AttributeAttack) + 0.3 * $Property(ClassEmpire:MilitaryPower))
</ToAIParameter>
</AIParameterConverter>
And I will adapt the "0.3" multiplicator, maybe "0.25" or what needed according what I see during analys.
So AI have to choose the best. If military power is 1000 and bonus is 10% (let's says it become 1000*0.1*0.25 = 25 after calculation), then AI will choose 25+infantery bonus or 25+archery bonus. So it will keep something for make the good choice, a value higher than another.
That way you can reduce the value or boost it if the AI has Ranged/Infantry units available in their designs.
$Count(ClassEmpire/Garrison/ClassUnit,UnitClassInfantry)
But it was months ago. I didnt release the mod because AI was not ready, and after, last year I didnt mod anything. I'm thinking about release an Alpha version, then work on a better AI. I've done at least a default AI for each tech/improvement, but rather bad.
I don't know what $(NumberOfAvailableRangedUnits), I never saw that, so i will make some search in public and see that. Thanks !
AIParameterConverters[Military].xml
<AIParameterConverter Name="EmpireUnitDamagePercent">
<!--<ToAIParameter AIParameter="AIEmpireMilitaryPower">$(Input) * 6 * $SumProperty(ClassEmpire/Garrison/ClassUnit:AttributeDamage)</ToAIParameter>-->
<ToAIParameter AIParameter="AIEmpireMilitaryPower">$(Input) * 0.5 $Property(ClassEmpire:MilitaryPower)</ToAIParameter>
</AIParameterConverter>
Here :
<ToAIParameter AIParameter="AIEmpireMilitaryPower">$(Input) * 0.5 $Property(ClassEmpire:MilitaryPower)</ToAIParameter>
there is no " * ", it should be :
<ToAIParameter AIParameter="AIEmpireMilitaryPower">$(Input) * 0.5 * $Property(ClassEmpire:MilitaryPower)</ToAIParameter>
Same with EmpireUnitLifePercent
If I resume yours army empire modificator, it make that :
?iMilitaryBalance? = 0.5
?iNinakoruAttackPercent? = 0.3 * $Property(ClassEmpire:MilitaryPower) * ?iMilitaryBalance?
?iNinakoruDefensePercent? = 0.3 * $Property(ClassEmpire:MilitaryPower) * ?iMilitaryBalance?
?iNinakoruDamagePercent? = 0.5 * $Property(ClassEmpire:MilitaryPower) * ?iMilitaryBalance?
?iNinakoruLifePercent? = 0.5 * $Property(ClassEmpire:MilitaryPower) * ?iMilitaryBalance?
?iNinakoruFasterMovement? = 0.3 * $Property(ClassEmpire:MilitaryPower) * ?iMilitaryBalance?
?iNinakoruEquipementSlot? = 0.4 * $Property(ClassEmpire:MilitaryPower) * ?iMilitaryBalance?
?iNinakoruArmySize? = 0.8 * $Property(ClassEmpire:MilitaryPower) * ?iMilitaryBalance?
(it look a little strange, but I put all of this in variables, and it will be replace by values, as Im using a selfmade tool for generating xml files of mods).
In your mod, there is no parameters about that :
--- Initiative, UnitRegenModifier, ExperienceRewardAtCreation
Do you have an idea of what multiplicator i should use ?
And about Flat bonus ?, how to use your method and what values to use ?
Thanks.
<!-- == Increase anything of all units in the empire, formula have to be designed in tech/improvement AI files == -->
<AIParameterConverter Name="GenericMilitaryBonus">
<ToAIParameter AIParameter="AIEmpireMilitaryPower">$(Input)</ToAIParameter>
</AIParameterConverter>
(i use this generic converter, as it's more easy for me because i generate AIParameter with variables).
Here this is for a tech giving to all ranged units a bonus damage of 2% x their Vision.
You can see, I added your army bonus inside * iMilitaryBalance :
<AIParameter Name="GenericMilitaryBonus" Value="0.02 * ((6 * $SumProperty(ClassEmpire/Garrison/ClassUnit,UnitClassRanged:VisionRange)
/ $Count(ClassEmpire/Garrison/ClassUnit,UnitClassRanged) * $SumProperty(ClassEmpire/Garrison/ClassUnit,UnitClassRanged:AttributeDamage))+(0.5 * $Property(ClassEmpire:MilitaryPower) * 0.5))" />
For "ExperienceRewardAtCreation", to have chances to be selected, I would use something like:
$(Input) * ($Property(ClassEmpire:MilitaryPower) / 200)
"EmpireUnitInitiativePercent":
$(Input) * 0.75 * $Property(ClassEmpire:MilitaryPower)
"UnitRegenModifier":
$(Input) * $Property(ClassEmpire:MilitaryPower)
Another option would be to not use (ClassEmpire:MilitaryPower) in any tech, but that would need lots of testing I guess.