Asteroid natives dependent on empire
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.
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.
Asteroid natives dependent on empire
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.
Re: Asteroid natives dependent on empire
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)
Re: Asteroid natives dependent on empire
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.
Re: Asteroid natives dependent on empire
Not sure, what is desirable here.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)
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))
Edit: I'm also not convinced that a later priority changes anything if real pop is desired here.
Re: Asteroid natives dependent on empire
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
Re: Asteroid natives dependent on empire
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.Oberlus wrote: ↑Sun Mar 12, 2023 9:22 amUnless 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
Re: Asteroid natives dependent on empire
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!
Look, ma... four combat bouts!
Re: Asteroid natives dependent on empire
Unrelated to the topic: The use of abs here looks suspicious to me.wobbly wrote: ↑Sun Mar 12, 2023 8:44 amCode: Select all
effects = SetRebelTroops value = max(0.0, abs(Value / 1.5))
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.
Re: Asteroid natives dependent on empire
Can rebel troops ever be negative? Probably someone wanted to be extra defensive about it and went bit overboard.Grummel7 wrote: ↑Sun Mar 19, 2023 5:15 pmUnrelated to the topic: The use of abs here looks suspicious to me.wobbly wrote: ↑Sun Mar 12, 2023 8:44 amCode: Select all
effects = SetRebelTroops value = max(0.0, abs(Value / 1.5))
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.
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
-
- Juggernaut
- Posts: 854
- Joined: Wed Aug 26, 2015 6:15 pm
Re: Asteroid natives dependent on empire
If the second term were negative, then max() would return 0.0, so the troop level would never be negative.Can rebel troops ever be negative? Probably someone wanted to be extra defensive about it and went bit overboard.
Re: Asteroid natives dependent on empire
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".