Logo Platform
logo amplifiers simplified

Counting OwnedAnomalies has changed?

Reply
Copied to clipboard!
7 years ago
Aug 6, 2018, 6:21:33 AM

I notice that the technique used to count anomalies has stealthily changed.

The old way was for each individual anomaly descriptor to add 1 to the AnomalyCount of ClassPlanet.


This addition also appeared in the descriptor for PlanetAnomaly, but it was commented out.


Now, PlanetAnomlay does the adding, and individual anomalies no longer add to the count, instead relying on the presence of the reference to PlanetAnomaly in their anomaly definition.


I'm trying to update Endless Moons mod to the new method, but something is still going wrong. My intention is to make them not count as regular anomalies, but still count towards OwnedMoons.


To this end, I've removed reference to PlanetAnomaly in my moon Anomaly definitions. The idea being that no longer referencing PlanetAnomaly should neatly bypass the addition of AnomalyCount.


The problem, is that they still count for some things, but not others.
In particular, the Sefaloros Workspace Oddity bonus still thinks they count despite moons no longer adding to AnomalyCount or OwnedAnomalies in any way I can find.


Out of ideas, I tried making PlanetMoon actualy subtract 1 from AnomalyCount, and this seems to work in most cases. But somehow, the Pilgrims +3 science on anomaly still thinks moons are an anomaly.


So somewhere, anomalies are being counted differently, and I can't understand how.


0Send private message
7 years ago
Aug 6, 2018, 2:12:55 PM

Hey Tychonoir, 


The simulation descriptor PlanetAnomaly is always applied, so you mustn't reference it anywhere in the AnomalyDefinitions.

Your solution of subtracting 1 is good, but the issue is that the Pilgrims don't care about the amount of curiosities, only the presence of one.


What I suggest is:

- Empty the descriptor PlanetAnomaly, so it's only a tag in the simulation.

- Create a new SimulationDescriptor "ActualPlanetAnomaly" which does what PlanetAnomaly currently does, but is not always applied.

- Reference ActualPlanetAnomaly in all the anomalies you want to count towards the anomaly count.

- Change the path in the Pilgrim's effects ( "./PlanetAnomaly/ClassPopulationPlanetModifiersTraitSecondaryScienceAnomaly02") so it uses ActualPlanetAnomaly instead of PlanetAnomaly.


I'm sorry it's a bit of a stretch for you, but we needed to change this for the game's architecture and stuff :/

0Send private message
7 years ago
Aug 7, 2018, 9:21:40 AM

Sooo, this isn't working at all.

I've done what you suggested, and I'm pretty confident I've done it correctly.

I've also looked through the diagnostic logs, and didn't see any obvious loading problems.

Yet now regular anomalies don't register at all, moons still count, and the Pilgrim effect still operates on moons.


Modified PlanetAnomaly descriptors:

    <SimulationDescriptor Name="PlanetAnomaly" Type="PlanetAnomaly" />
     
    <SimulationDescriptor Name="EM_PlanetAnomaly"                 Type="PlanetAnomaly" >
        <Modifier TargetProperty="AnomalyCount" Value="1" Operation="Addition" Path="ClassPlanet" TooltipHidden="true"/>
    </SimulationDescriptor>

Typical moon definition:

    <AnomalyDefinition Name="Moon_SmSingA2" Quality="Moon">
        <SimulationDescriptorReference Name="Moon_SmSingA2"/>
        <SimulationDescriptorReference Name="PlanetMoon"/>
        <SimulationDescriptorReference Name="PlanetAnomaly25"/>
        <EncounterEntityReference Name="PlanetAnomaly25"/>
        <GeneratorInfo/>
    </AnomalyDefinition>

Typical standard anomaly definition:

    <AnomalyDefinition Name="PlanetAnomaly05" Quality="Positive">
        <SimulationDescriptorReference Name="EM_PlanetAnomaly"/>
        <SimulationDescriptorReference Name="PlanetAnomaly05"/>
        <EncounterEntityReference Name="PlanetAnomaly05"/>
        <GeneratorInfo>
            <PlanetFilterNot>PlanetTypeDestroyed</PlanetFilterNot>
            <PlanetFilterNot>PlanetGameplayTypeGas</PlanetFilterNot>
        </GeneratorInfo>
    </AnomalyDefinition>

Population effect:

    <SimulationDescriptor Name="WithPopulationPlanetModifiersTraitSecondaryScienceAnomaly01"        Type="WithPopulationPlanet">
        <Modifier TargetProperty="BonusPopulationScience"   Operation="Force"       Value="6" Priority="-3"     Path="PopulationGrowthScoreBoosted/./ClassEmpire/ClassColonizedStarSystem/EM_PlanetAnomaly/ClassPopulationPlanetModifiersTraitSecondaryScienceAnomaly01,ClassPopulation" TooltipHidden="true" />
        <Modifier TargetProperty="BonusPopulationScience"   Operation="Addition"    Value="3"                   Path="EM_PlanetAnomaly"/>
    </SimulationDescriptor>


Updated 7 years ago.
0Send private message
0Send private message0Send private message
7 years ago
Aug 8, 2018, 12:16:43 PM

Using the Simulation debugger (available with the modding tools) I noticed I forgot the simulation descriptor ClassPopulationPlanetModifiersTraitSecondaryScienceAnomaly01 !

It's the base effect for the pilgrims, the ones I mentioned were the collection bonuses.


As for the count, it appears to work properly on my end: regular anomalies add 1 to OwnedAnomalies, moons add 1 to OwnedMoons and 0 to OwnedAnomalies.

0Send private message
7 years ago
Aug 8, 2018, 1:30:50 PM

Ok, so there's:


ClassPopulationPlanetModifiersTraitSecondaryScienceAnomaly01

ClassPopulationPlanetModifiersTraitSecondaryScienceAnomaly02


WithPopulationPlanetModifiersTraitSecondaryScienceAnomaly01

WithPopulationPlanetModifiersTraitSecondaryScienceAnomaly02

What about PopulationModifiersTrait?

    <PopulationModifiersTrait Name="PopulationModifiersTraitSecondaryScienceAnomaly01" SubCategory="Secondary" ShowInCustom="true" Cost="5">
        <Tags>PlanetAnomaly,BonusPopulationScience</Tags>
          [etc.]

Does the tag PlanetAnomaly need to be changed too?


As to the counting problems, I'll do some more testing.

But, I'm not looking at the actual count data, but rather how FIDSI are totaling. (Whether or not Pilgrims population is adding 2 or 5 science, for example)
I guess I'll make the count visible and see if the FIDSI agree. If this still doesn't work, it might be time to validate and/or re-install the game.

Thank you for your efforts here.

0Send private message
7 years ago
Aug 8, 2018, 3:31:12 PM

The PopulationModifiersTrait Tags are used for the System management scan view iirc, so you may need to update it for clarity but it's optional.

0Send private message
7 years ago
Aug 9, 2018, 11:15:05 AM

Ok, I did some more testing.

Looking at the variables in the debug overlay, it appear that the moon/anomaly counting is being done correctly.

Traits such as Workspace Oddity are working correctly.
Improvements such as Magnetic Field Generators are working correctly.
But, Pilgrim and Pulsos Population bonus are still incorrectly counting moons as anomalies, despite both AnomalyCount and OwnedAnomalies properties in the system being 0. (For example, the Pulsos +5 science on anomaly is getting added to the planet science output on planets with a moon.)

Updated 7 years ago.
0Send private message
7 years ago
Aug 9, 2018, 1:12:44 PM

I recommend using the Simulation debugger for these issues, it's very helpful.

It will show all the descriptors which affect a property, and you'll be able to fix them very easily by looking at the path, the values, etc.



Using it with Vanilla anomalies/pilgrims showed me that the descriptor ClassPopulationPlanetModifiersTraitSecondaryScienceAnomaly01 was the one providing the science bonus on planets with anomalies. If you have overriden its Modifier's path it should work in your mod, can you check if it is properly overriden?

Updated 7 years ago.
0Send private message
0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message