Asteroid natives dependent on empire

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderator: Oberlus

Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Post Reply
Message
Author
wobbly
Cosmic Dragon
Posts: 1874
Joined: Thu Oct 10, 2013 6:48 pm

Asteroid natives dependent on empire

#1 Post by wobbly »

Got a native on asteroids with negative stability. Hovering the rebel troops gives a claim they are dependent on the empire, even though they had positive pop before being conquered.

BlueAward
Vacuum Dragon
Posts: 646
Joined: Mon Aug 08, 2022 3:15 am

Re: Asteroid natives dependent on empire

#2 Post by BlueAward »

wobbly wrote: Thu Mar 02, 2023 6:37 am Got a native on asteroids with negative stability. Hovering the rebel troops gives a claim they are dependent on the empire, even though they had positive pop before being conquered.
There's a quirk to those natives that asteroids for them are not "good", they're just "adequate", and I think that's it - it is dependence on Empire due to environment after all, not due to being negative pop without the empire.

I can imagine this coming to play also for something like Laenfa in a blue star system on a poor planet (but I have not checked)

That would explain it, but if that is the expected behavior is open to debate. Should it be due to environment itself, or due to just plain dying out without the empire (after all even just with the first growth tech, Planetary Ecology, they would be worse off without empire should they rebel in terms of max pop)

wobbly
Cosmic Dragon
Posts: 1874
Joined: Thu Oct 10, 2013 6:48 pm

Re: Asteroid natives dependent on empire

#3 Post by wobbly »

Looking at the scripting, it is checking planet environment. e.g. laenfa on bright star is another case. Laenfa on ocean with dull star/no star will not be affected. Nor will a species on a temporal anomaly special or tidal lock special. Exobots will always be affected and same with the GG native.

wobbly
Cosmic Dragon
Posts: 1874
Joined: Thu Oct 10, 2013 6:48 pm

Re: Asteroid natives dependent on empire

#4 Post by wobbly »

BlueAward wrote: Fri Mar 10, 2023 8:19 am That would explain it, but if that is the expected behavior is open to debate. Should it be due to environment itself, or due to just plain dying out without the empire (after all even just with the first growth tech, Planetary Ecology, they would be worse off without empire should they rebel in terms of max pop)
Not sure, what is desirable here.

Code: Select all

       EffectsGroup
            scope = Source
            activation = Planet environment = Adequate
            accountinglabel = "DEPENDENCE_ON_IMPERIAL_SUPPORT_DUE_TO_ENVIRONMENT"
            priority = [[TARGET_SCALING_PRIORITY]]
            effects = SetRebelTroops value = max(0.0, abs(Value / 1.5))
In a way that activation could easily be changed to something like target pop, but the priority line is probably firing before all pop modifiers are calculated. I guess it depends on what is desired here.

Edit: I'm also not convinced that a later priority changes anything if real pop is desired here.

User avatar
Oberlus
Cosmic Dragon
Posts: 5714
Joined: Mon Apr 10, 2017 4:25 pm

Re: Asteroid natives dependent on empire

#5 Post by Oberlus »

wobbly wrote: Sun Mar 12, 2023 8:44 am the priority line is probably firing before all pop modifiers are calculated
Unless there is an error somewhere in the scripts, all population modifiers apply before any other kind of meters in the game.

https://github.com/freeorion/freeorion/ ... orities.py

wobbly
Cosmic Dragon
Posts: 1874
Joined: Thu Oct 10, 2013 6:48 pm

Re: Asteroid natives dependent on empire

#6 Post by wobbly »

Oberlus wrote: Sun Mar 12, 2023 9:22 am
wobbly wrote: Sun Mar 12, 2023 8:44 am the priority line is probably firing before all pop modifiers are calculated
Unless there is an error somewhere in the scripts, all population modifiers apply before any other kind of meters in the game.

https://github.com/freeorion/freeorion/ ... orities.py
So maybe I'll leave this as a question to the devs/anyone interested this could be as is environment = simple or based on actual target.population.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Asteroid natives dependent on empire

#7 Post by Ophiuchus »

wobbly wrote: Sun Mar 12, 2023 11:46 am So maybe I'll leave this as a question to the devs/anyone interested this could be as is environment = simple or based on actual target.population.
it would make more sense to depend on target population. but in general it is actually not so easy to figure out what target population would be without empire bonus (e.g. tech, growth focus and policy(?) effects).

so if nobody comes up with a good implementation (e.g. triggering at the right moment/priority if Value(TargetPopulutation) < 0 ; or < 1 ?), id say the current implementation is sensible enough
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Grummel7
Space Dragon
Posts: 335
Joined: Mon Oct 09, 2017 3:44 pm

Re: Asteroid natives dependent on empire

#8 Post by Grummel7 »

wobbly wrote: Sun Mar 12, 2023 8:44 am

Code: Select all

            effects = SetRebelTroops value = max(0.0, abs(Value / 1.5))
Unrelated to the topic: The use of abs here looks suspicious to me.
If Value is negative, this will turn it into a positive value. Is this intended?
And, if it is, the max is useless since the second part cannot be less than 0.0.

BlueAward
Vacuum Dragon
Posts: 646
Joined: Mon Aug 08, 2022 3:15 am

Re: Asteroid natives dependent on empire

#9 Post by BlueAward »

Grummel7 wrote: Sun Mar 19, 2023 5:15 pm
wobbly wrote: Sun Mar 12, 2023 8:44 am

Code: Select all

            effects = SetRebelTroops value = max(0.0, abs(Value / 1.5))
Unrelated to the topic: The use of abs here looks suspicious to me.
If Value is negative, this will turn it into a positive value. Is this intended?
And, if it is, the max is useless since the second part cannot be less than 0.0.
Can rebel troops ever be negative? Probably someone wanted to be extra defensive about it and went bit overboard.

But generally negative rebel troops make no sense to me and by extension even max alone without abs makes no sense. Probably this case is never hit so neither abs nor max are of consequence.

So on that, what practical meaning would negative rebel troops have, and is it even possible/envisioned to be possible

defaultuser
Juggernaut
Posts: 854
Joined: Wed Aug 26, 2015 6:15 pm

Re: Asteroid natives dependent on empire

#10 Post by defaultuser »

Can rebel troops ever be negative? Probably someone wanted to be extra defensive about it and went bit overboard.
If the second term were negative, then max() would return 0.0, so the troop level would never be negative.

User avatar
Oberlus
Cosmic Dragon
Posts: 5714
Joined: Mon Apr 10, 2017 4:25 pm

Re: Asteroid natives dependent on empire

#11 Post by Oberlus »

This "bug" is 2 years old. I guess rebel troops are never negative and it doesn't cause any problem. But better to remove those "abs".

User avatar
LienRag
Cosmic Dragon
Posts: 2146
Joined: Fri May 17, 2019 5:03 pm

Re: Asteroid natives dependent on empire

#12 Post by LienRag »

BlueAward wrote: Fri Mar 10, 2023 8:19 am There's a quirk to those natives that asteroids for them are not "good", they're just "adequate",

Maybe that is what should be adressed ?

Post Reply