The priorities mess

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderator: Oberlus

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

Re: The priorities mess

#16 Post by Ophiuchus »

Dilvish wrote:
Ophiuchus wrote:If the techs bonus are at after-scaling, the Sly will be vastly OP I think. GG size is 6 - the gaseous 50% reduction was exactly to make the GG species on par with species on medium sized planets.
It's not so simple as that, to be able to say "exactly". Even during the last few months the Sly were still getting the Homeworld bonuses kicking in after the 50% reduction. Since the Sly don't have growth specials, I think this will affect their pop levels only modestly (from Sub Hab) during the early and mid game.
Well, i say "exactly" because the scaling effect with the huge size and techs was exactly why i set it to 50%. It was very interesting to have the Sly very feeble at the beginning with researching growth techs being paramount for expansion, but it was really too high in the end game.

If we wanted to minimize the difference to before we could add a specific gasgiant homeworld bonus to compensate (so after scaling add another 1 * HabitableSize; or double the bonus in HOMEWORLD_BONUS_POPULATION for gas giants).
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
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: The priorities mess

#17 Post by Dilvish »

Oberlus, there had been a post here about you having some trouble getting the PR. Could be that you resolved it and just deleted the post, but I had a couple tips I wanted to pass on anyways-- getting PRs can be a bit tricky.

The route of grabbing it directly from Morlic's repo can work fine, but most easily if referring to it by his branch name rather than by a PR number.

To get PRs from our main repo, by number, I made a post in our github thread.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: The priorities mess

#18 Post by Oberlus »

Damn, Dilvish, you were fast :)

Yes, it is as you thought.
Dilvish wrote:To get PRs from our main repo, by number, I made a post in our github thread.
Thank you :)

Before I read your link, I fetched the changes into a new branch (that's what I was misdoing, I lacked that /head:new_branch part), merged that branch into my master and compiled. I checked all Morlic's changes from the PR are here. I'm already playtesting, including the changes to Sly with gas giant size 3 (game rule), adding self-sustaining and removing the gas bonus of -50% pop, also without self-sustaining and gg size 4.

Homeworld starting populations of some species / and the expected value for first colony, not checked yet, just removing the homeworld bonus and assuming medium size:
- Human (average): 20 / 9
- Egassem (bad pop.): 17 / 6.75
- Laenfa (good pop.): 23 / 11.25
- Scylior (good pop, medium planet): 17.25 / 11.25
- Trith (self-sustaining): 32 / 18
- Sly (self-sustaining, GGsize=3): 24 / 18
- Sly (GGsize=3): 15 / 9
- Sly (GGsize=4): 20 / 12

What do you think about the figures for Sly and Trith? (keeping in mind the abundance/scarcity of good planets for Trith and for Sly).

Edit: Sly self-sustaining gets hostile pop=HabSize with Xeno Gen, and pop=3*HabSize with Xeno Hybrids. Going sub+orb. hab. you get pop=2*HabSize.
Seems pretty fast/op for Sly. So I guess self-sustaining isn't for them.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: The priorities mess

#19 Post by Dilvish »

Oberlus wrote:...merged that branch into my master and compiled.
I hope that you remembered to make a copy of master into some testing branch, and then merge the PR into that. It's best that you keep your actual master branch pristine. Even if you did already merge that PR into your master branch, it's easy enough to clean up-- just make a testing branch from it now, and then with your master checked out do a hard reset back to where upstream/master is, that will put it back to right. And then just keep doing your experimenting in various testing branches.
I'm already playtesting, including the changes to Sly with gas giant size 3 (game rule)...self-sustaining...
I don't think there is much point in playtesting those variations until we've concluded whether or not a further change is really needed-- first focus your playtesting with simply the changes from Morlic's PR.
Homeworld starting populations of some species / and the expected value for first colony, not checked yet, just removing the homeworld bonus and assuming medium size:
- Human (average): 20 / 9
- Sly (GGsize=3): 15 / 9
- Sly (GGsize=4): 20 / 12
Rather than trying to do the calcs yourself, I think you should stick with actually checking ingame. Doing that, I get, for example,
- Human (average): 20 / 9
- Sly (GGsize=6): 21 / 9

Which suggests to me that we should not rush to further nerf the Sly without more evaluation as they are.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: The priorities mess

#20 Post by Oberlus »

Thanks for the git advices, I'll do as you say.
Dilvish wrote:first focus your playtesting with simply the changes from Morlic's PR.
Roger.
Rather than trying to do the calcs yourself
I calculated only the values for first colony, the values for homeworld are tested (easy to start one game for each species).
Anyway, for next two games I'll limit myself to playtest Sly and Trith with only Morlic's changes.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: The priorities mess

#21 Post by Dilvish »

One thing to double check for is the handling of war declarations in your merged build. It looks like this weeks test build went out right before the change to the default status being war, so you need to either not update your 0.4.8 content past what comes with the weekly build, other than merging in Morlic's PR, or else you would need to revert the commit that makes the AI's no longer declare war. Or else rebuild FO.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: The priorities mess

#22 Post by Ophiuchus »

Dilvish wrote:
Ophiuchus wrote:If the techs bonus are at after-scaling, the Sly will be vastly OP I think. GG size is 6 - the gaseous 50% reduction was exactly to make the GG species on par with species on medium sized planets.
It's not so simple as that, to be able to say "exactly". Even during the last few months the Sly were still getting the Homeworld bonuses kicking in after the 50% reduction. Since the Sly don't have growth specials, I think this will affect their pop levels only modestly (from Sub Hab) during the early and mid game.
I think you are right. I think a good_population species is slightly better off than Sly in population on good planets.

Normal species can get the bonus from 3 growth bonus (+9 on midsize) and from gaia planets (another +9 on midsize) which are not accessible to Sly. And they can find large or huge planets to live on.

On gas giants with Sly the after scaling effects
SUBTER_HAB, ORBITAL_HAB and growth focus each give 1x the size, N_DIMEN_STRUCT 2x, and homeworld gives a 3x, summed up a 8x multiplier.
Comparing to midsize planets this means 24 extra population (so 6 pop more than a normal species).
This means after acquiring all possible bonus a Sly gas giant is about the same as a large human planet (note that the human has to have invested in a gaia planet)
And they are really not so good a colonizing non-gas giants.
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
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: The priorities mess

#23 Post by Oberlus »

Dilvish wrote:first focus your playtesting with simply the changes from Morlic's PR.
So far so good. I'm checking during the games the population values for different species, techs, etc. and they all work as expected.

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

Re: The priorities mess

#24 Post by Oberlus »

Something to resurrect this thread:

The Exobot Production policy has an interesting effect, or it's intended to have it:
- Turn the VERY_BAD_INDUSTRY Exobots into BAD_INDUSTRY (or better, it seems, AVERAGE_INDUSTRY, since from VERY_BAD to BAD is too little improvement).

Currently, both the species trait effect and the policy effect that intends to override the trait effect have DEFAULT_PRIORITY. That is arguably wrong since to be able to code the right effect in the policy (so that it actually overrides the VERY_BAD effect to make it a BAD one) you need to know if the policy effect will be processed before or after the species trait effect (AFAIK, there is no such thing as "simultaneously" here). After seems the right choice.
Therefore, the species trait should be processed first:
TargetMeter = TargetMeter * 0.5 (VERY BAD)
And inmediately after that the policy effect:
TargetMeter = TargetMeter * 0.75 (BAD) / 0.5 (VERY BAD) // divide by the species trait factor to remove its effect, multiply by the new factor

Edit: actually, it doesn't matter the order:
TargetMeter = InitialTargetMeter * 0.75 (BAD) / 0.5 (VERY BAD) = InitialTargetMeter*1.5
TargetMeter = TargetMeter * 0.5 (VERY BAD) = InitialTargetMeter*1.5*0.5 = InitialTargetMeter*0.75 (BAD).



Alternatively, the policy effect could be coded in the VERY_BAD_INDUSTRY macro, but that would be much messier and harder to maintain.

There are other effects that multiply the meter value by a factor, e.g. Industrialism, with VERY_LATE_PRIORITY, that is, with the same priority than the flat bonuses (AA, GGG, Micrograv., etc.) as well as the Solar Orb. Gen. Again wrong because a multiplicative effect should have a priority greater or smaller than any other non-multiplicative effect so that engine/coder knows if the multilicative effect will apply before or after the additive effects.

So, it seems we need a more detailed priorities hierarchy for (non-population) target meters:

1. Additive effects before scaling effects (several priority levels here for better ordering of effects in GUI).
2. Scaling effects
3. Additive effects after scaling effects (again several levels).
4. Second scaling effects (for things like that Industrialism policy).
5. Last additive effects (several levels).

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

Re: The priorities mess

#25 Post by Ophiuchus »

Oberlus wrote: Sun Oct 11, 2020 2:14 pm Currently, both the species trait effect and the policy effect that intends to override the trait effect have DEFAULT_PRIORITY. ...(AFAIK, there is no such thing as "simultaneously" here)...
Edit: actually, it doesn't matter the order:
Multiplication is associative and cumulative, so if you stick to multiplication/division, order does not matter for the effect. The result will be the same.
Oberlus wrote: Sun Oct 11, 2020 2:14 pmThere are other effects that multiply the meter value by a factor, e.g. Industrialism, with VERY_LATE_PRIORITY, that is, with the same priority than the flat bonuses (AA, GGG, Micrograv., etc.) as well as the Solar Orb. Gen.
If we mix multiplication and addition the order matters. (1 + 1) * 2 == 4; 1 + ( 1 * 2 ) == 3

Having the same priority is probably "wrong" as we want a deterministic result and a scripter needs to know the order of processing (For EffectsGroups sharing the same Priority number their secondary ordering is determined by their source/cause, as follows: effects from Species, then effects from Specials, then effects from Techs, then effects from Buildings, then effects from Ship Hulls, then effects from Ship Parts. The order of execution of Effects within these groups is deterministic, though not controllable.)
Oberlus wrote: Sun Oct 11, 2020 2:14 pm So, it seems we need a more detailed priorities hierarchy for (non-population) target meters:

1. Additive effects before scaling effects (several priority levels here for better ordering of effects in GUI).
2. Scaling effects
3. Additive effects after scaling effects (again several levels).
4. Second scaling effects (for things like that Industrialism policy).
5. Last additive effects (several levels).
Having a standard layout is good. Maybe we should talk of priority ranges for first layer of additive effects, first layer of scaling effects, ....
Of course it is less complex (less "mess") if you can get rid of some levels; e.g.:

1. Additive effects before scaling effects (several priority levels here for better ordering of effects in GUI).
2. Scaling effects
3. Final additive effects after scaling effects (again several levels).
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
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: The priorities mess

#26 Post by Oberlus »

From what I see in the documentation, activation and scope of all effects are evaluated first, and then the effects are evaluated in the order determined by priorities and sources. So we only care about precedence of values evaluation.

A topology of effects based on their dependencies on other meters or effects could be

- Unordered Independent: depends on nothing, nothing depends on them, order does not matter because there are no concurrent effects or because order of application is irrelevant (e.g. SetEmpireCapital, as long a there can't be two Capital buildings finishing at the same time).
- Ordered Independent: depends on nothing, nothing depends on them, order matters for GUI or for overlapping effects (e.g. mine effects, where the strongest ones must activate first and disable the activation of the others).
- Ordered Population Dependent: depends on Population, nothing depends on them, order matters because there are additive effects before and after scaling effects (TargetResearch, TargetIndustry, TargetStockpile, MaxTroops...). All these could also depend on Happiness, but that is not a thing currently (Happiness is used only on activation/scope to gate effects but not to modify them as a factor or whatever).

All "current" meters are dependent on their corresponging Target/Max meters, that is not considered above.

Happiness and TargetHappiness currently are (Ordered) Independent, but we can't discard some dependence on Population and TargetPopulation (overpopulation could be a thing in the future). So (Target)Happiness effects should apply after Population effects and before any Dependent effect.

So we could have something like
  • TargetPopulation (TARGET_POPULATION)
  • Population (POPULATION)
  • TargetHappiness (TARGET_HAPPINESS)
  • Happiness (HAPPINESS)
  • Rest of target meters (TARGET_OTHER)
  • Rest of meters (OTHER)
That is, adding a dedicated tier of priorities for Happiness meters.

Within each stage, different levels for [EARLY|LATE]_BEFORE_[1ST|2ND]_SCALING , [1ST|2ND]_SCALING, [EARLY|LATE]_AFTER_[1ST|2ND]_SCALING and [1ST|2ND]_OVERRIDE could be used as needed.

Current default priority would correspond to OTHER_BEFORE_SCALING. Target meters using DEFAULT_PRIORITY chould use TARGET_DEFAULT_PRIORITY.

...

I'm working on a complete proposal.

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

Re: The priorities mess

#27 Post by Oberlus »


Post Reply