Logo Platform
logo amplifiers simplified

[Dev Request]

Reply
Copied to clipboard!
7 years ago
May 28, 2017, 3:01:31 AM

In trying to mod the modifiers for the effects of modules I have discovered that I cannot implement negative values. For example I would like to add a modifier to decrease ship evasion for the plasma intensifier to offset the benefits and discourage stacking. I've tried adjusting the min/maxs but to no avail.


Could you please allow for negative bonuses on modules and weapons?

0Send private message
7 years ago
May 28, 2017, 7:16:35 AM

I'm not a Dev but could you give me an example of the exact modifications you are trying ?

As when it comes to -1 in MinValue's & MaxValue's They can mean -infinity & +infinity respectively (See Public/Simulation/HapppinessStatusSetDefinitions.XML)


<!-- Ecstatic -->
<HappinessStatusDefinition Name="HappinessStatusEmpire4" MinValue="85" MaxValue="-1">
<SimulationDescriptorReference Name="HappinessStatusEmpire4"/>
</HappinessStatusDefinition>

But Negative Numbers can be used in Modifiers just fine and are used quite often (mostly in battle related stuff)


<SimulationDescriptor Name="ColonizedStarSystemInfluenceStateOwnerFriend" Type="ColonizedStarSystemInfluenceState">
   <Modifier TargetProperty="NetSystemMoney"           Operation="Percent"       Value="-.25"/>
   <Modifier TargetProperty="NetSystemResearch"        Operation="Percent"       Value="-.25"/>
   <Modifier TargetProperty="NetSystemEmpirePoint"     Operation="Percent"       Value="-.25"/>
</SimulationDescriptor>

0Send private message
7 years ago
May 28, 2017, 4:05:12 PM
Painter448 wrote:

I'm not a Dev but could you give me an example of the exact modifications you are trying ?

As when it comes to -1 in MinValue's & MaxValue's They can mean -infinity & +infinity respectively (See Public/Simulation/HapppinessStatusSetDefinitions.XML)


<!-- Ecstatic -->
<HappinessStatusDefinition Name="HappinessStatusEmpire4" MinValue="85" MaxValue="-1">
<SimulationDescriptorReference Name="HappinessStatusEmpire4"/>
</HappinessStatusDefinition>

But Negative Numbers can be used in Modifiers just fine and are used quite often (mostly in battle related stuff)


<SimulationDescriptor Name="ColonizedStarSystemInfluenceStateOwnerFriend" Type="ColonizedStarSystemInfluenceState">
   <Modifier TargetProperty="NetSystemMoney"           Operation="Percent"       Value="-.25"/>
   <Modifier TargetProperty="NetSystemResearch"        Operation="Percent"       Value="-.25"/>
   <Modifier TargetProperty="NetSystemEmpirePoint"     Operation="Percent"       Value="-.25"/>
</SimulationDescriptor>

Yes negative numbers are used throughout but they don't appear to work for upgrades like modules and weapons.  I tried a whole slew of variations but you just can't seem to get it to give a negative bonus.


As for examples, you could try the one above. Take a energy weapon upgrader like the plasma intensifier (the one that gives bonus to your energy weapons) and then add a negative bonus to evasion...or movement or anything really. It just won't seem to take because I think they are hard coded somewhere. I found a file that deals with min/maxs and tried tweaking that but still no good.

0Send private message
7 years ago
May 29, 2017, 9:50:04 AM

I don't know why they aren't working, I may have an in-depth look into it later on if no progress is made (currently I'm focusing on understanding other ares)

0Send private message
7 years ago
Jun 6, 2017, 7:27:48 AM

In case you're still looking for the answer :

a property can not be negative unless it's been specified it can in its declaration. By default a property has a MinValue of 0, and so can not be negative.


Both the Evasion property on Module and Ship do not have a MinValue, you need to modify those two ( add MinValue="Negative" ?or Minvalue="1" if it's really a percentage? ).

Modifying the property of ClassModuleDefense will mean that a module can have a negative Evasion

Modifying the property on ClassShip will mean that a Ship can have a negative Evasion

Updated 7 years ago.
0Send private message
7 years ago
Jun 6, 2017, 8:55:33 AM
Spaz wrote:

In case you're still looking for the answer :

a property can not be negative unless it's been specified it can in its declaration. By default a property has a MinValue of 0, and so can not be negative.


Both the Evasion property on Module and Ship do not have a MinValue, you need to modify those two ( add MinValue="Negative" ?or Minvalue="1" if it's really a percentage? ).

Modifying the property of ClassModuleDefense will mean that a module can have a negative Evasion

Modifying the property on ClassShip will mean that a Ship can have a negative Evasion

In addition and to specify: 
You need to modify the files: Simulation/Battles/SimulationDescriptors[ModuleDefense].xml
> Add MinValue="Negative" to take into account the minimum value of the "Evasion" property: <Property Name="Evasion" BaseValue="0" MinValue="Negative"/>
> Add the property to the module you want to change (here, the base defense module on starter ships "ModuleDefenseHullPlating1"): <Modifier TargetProperty="Evasion" Operation="Addition" Value="-0.1"   Path="ClassModuleDefense"/>


You need to modify the file: Gui/Miscellaneous/PanelFeatureModuleEffectsDefinition.xml
> To change the minimum value (%) for the "Evasion" property: currently "0", change for "-1" to allow the "-100%" maximum negative value: <Item Name="Evasion" Title="%PanelFeatureModuleEvasionTitle" MinValue="-1" IsPercentage="true"/>


I create an example module that changes the base defense module to add a "-10% evasion" value.
You can try it here: EvasionModule.zip

0Send private message
7 years ago
Jun 7, 2017, 1:15:25 AM

Hi Dagart,


While you're right, the module ModuleDefenseHullPlating1 will reduce Evasion, I think the requestor was looking for a weapon that would inflict -10% evasion upon an enemy ship that it's firing on, ie, negate 10% of the Evasion on an enemy ship. 


As in all coding, there's six ways to do the same thing. IMO, the easiest counter to Evasion would be the weapon property Accuracy. In order to knock down 10% Evasion, bump *up* Accuracy a like amount. 


Another option would be to clone the property OpponentEnergyWeaponAccuracyPercent. It looks like that property affects an enemy vessel.

0Send private message
0Send private message
7 years ago
Jun 11, 2017, 2:56:59 PM
Dagart wrote:

He yes! Sorry for the misunderstanding :)
The way you give Knyghtefall is good!

You didn't misunderstand. What Knyghtefall is talking about is something totally different and not what I'm trying to do (although I appreciate him trying to help). The Plasma Intensifier and other support mods like it boosts offensive capability but since you can stack a lot I thought there should be a detriment to using them. The quasi logic is that you're using a lot of power to boost your weapons so in turn that is sapping power from your engines which reduces your evasion capabilities.


What you and Spaz suggested did eventually end up working! Since I was working with the Plasma Intensifier, which is a support module that increases the effectiveness of energy weapons, I had to tweak the values in the SimulationDescriptors[ModuleSupport].xml file:



<SimulationDescriptor Name="ModuleSupportEnergyEnhancer"                   Type="ModuleSupportEnergyEnhancer">
<Property Name="DamageEnergy"                BaseValue="0"/>
<Property Name="CriticalHitChance"                BaseValue="0"/>
<Property Name="Evasion"                                    BaseValue="0" MinValue="Negative"/>
<Modifier TargetProperty="DamageEnergy"      Operation="Addition" Value="$(DamageEnergy)"       Path="../ClassShip"     Priority="1"/>
<Modifier TargetProperty="CriticalHitChance"      Operation="Addition" Value="$(CriticalHitChance)"       Path="../ClassShip"     Priority="1"/>
<Modifier TargetProperty="Evasion"                                  Operation="Addition"        Value="$(Evasion)"                                  Path="../ClassShip"/>
</SimulationDescriptor>

<SimulationDescriptor Name="ModuleSupportEnergyEnhancer1"                   Type="ModuleSupportEnergyEnhancer">
<Modifier TargetProperty="DamageEnergy"         Operation="Addition" Value="0.2" Path="ModuleSupportEnergyEnhancer"/>
<Modifier TargetProperty="Evasion" Operation="Addition" Value="-0.9"   Path="ModuleSupportEnergyEnhancer"/>
</SimulationDescriptor>


Then I edited the GUI file as you said and then it worked perfectly :) 


I then tested it out during battle by doing 90% evasion Vs 90% evasion + negative 90% evasion (should cancel each other out)  Vs no evasion modifiers at all. The results were perfert. The results from the +90 and -90 evasion matched the results for no evasion modifiers while the results for the 90% evasion showed a 64% evasion rate.


But wait, if I had 90% evasion my evasion be much higher right? So I did some experiments and basically what I found is that there is a ~ .72  .6 modifier applied to your evasion (range penalty is left alone). I tried all sorts of different evasion percentages and this modifier held true. Not sure why it's there or if it's intended but it seems to be there.


I also discovered that minimum accuacy doesn't work the way I thought it did. I thought it ensured that no matter what other factors, accuracy would not drop below a certain rate. But it turns out that min accuracy only effects the starting accuracy, not accuracy after evasion and range are taken into consideration. I proved this by giving a ship 2 warp cores with 90% evasion each. If min accuracy worked then at least some shots would have hit but as it turned out the ship was unhittable.  


So to prevent evasion from being too powerful I added a "Max" evasion and thankfuly that worked.


Thanks for all the help!


Updated 7 years ago.
0Send private message
?

Click here to login

Reply
Comment