The priorities mess

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.
Message
Author
User avatar
Oberlus
Small Juggernaut
Posts: 704
Joined: Mon Apr 10, 2017 4:25 pm

The priorities mess

#1 Post by Oberlus » Mon Jun 18, 2018 8:32 am

While I was searching for all PRIORITY tags in FOC files to figure out what is what and what is wrong, I've found some weird stuff. I'll post each "issue" on a different post in this thread for discussion.


First issue:

File: ./specials/planet/growth/growth.macros
There are three macros for POPULTION_BOOST_ORGANIC/ROBOTIC/LITHIC, each with two different effects for SetTargetPopulation.
The effects for ORGANIC and ROBOTIC are both EARLY_TARGET_POPULATION_PRIORITY, but the second effect for LITHIC is VERY_LATE_PRIORITY.
I assume all effects should have the same priority and that this is a bug (maybe without consequences).

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12268
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: The priorities mess

#2 Post by Geoff the Medio » Mon Jun 18, 2018 9:08 am

Oberlus wrote:The effects for ORGANIC and ROBOTIC are both EARLY_TARGET_POPULATION_PRIORITY, but the second effect for LITHIC is VERY_LATE_PRIORITY.
I assume all effects should have the same priority and that this is a bug (maybe without consequences).
Your suggestion to change the LITHIC second effect priority to EARLY_TARGET_POPULATION_PRIORITY appears correct to me.

User avatar
Oberlus
Small Juggernaut
Posts: 704
Joined: Mon Apr 10, 2017 4:25 pm

Re: The priorities mess

#3 Post by Oberlus » Mon Jun 18, 2018 9:39 am

Second issue:

File: /species/common/population.macros
The macro PHOTOTROPHIC_BONUS has four EffectsGroups that use SetTargetPopulation depending on the star type. For "VERY_BRIGHT_STAR", "BRIGHT_STAR" and "NO_STAR" the priority is EARLY_POPULATION_PRIORITY, but for "DIM_STAR" (red, neutron) it is EARLY_TARGET_POPULATION_PRIORITY.
Again I assume all four should use the same priority.

Once I've finished the review of every FOCS file calling on SetTargetPopulation, I'll bring up in another post the (IMO) seemingly confusing utilisation of XXXX_POPULATION_PRIORITY and XXXX_TARGET_POPULATION_PRIORITY.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12268
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: The priorities mess

#4 Post by Geoff the Medio » Mon Jun 18, 2018 9:58 am

Oberlus wrote:The macro PHOTOTROPHIC_BONUS has four EffectsGroups that use SetTargetPopulation depending on the star type. For "VERY_BRIGHT_STAR", "BRIGHT_STAR" and "NO_STAR" the priority is EARLY_POPULATION_PRIORITY, but for "DIM_STAR" (red, neutron) it is EARLY_TARGET_POPULATION_PRIORITY.
Again I assume all four should use the same priority.
Looks to me like they should all be EARLY_TARGET_POPULATION_PROIRITY.

User avatar
Oberlus
Small Juggernaut
Posts: 704
Joined: Mon Apr 10, 2017 4:25 pm

Re: The priorities mess

#5 Post by Oberlus » Mon Jun 18, 2018 10:08 am

Here I list all the files that invoke SetTargetPopulation, ordered by priority (in terms of its value, not alphabetically by tag), with a note on the macro they are in case there is any.

Code: Select all

[[EARLY_TARGET_POPULATION_PRIORITY]]	
./buildings/HYPER_DAM.focs.txt	
./specials/planet/GAIA.focs.txt	
./specials/planet/growth/growth.macros						POPULATION_BOOST_ORGANIC (growth special focus)
./specials/planet/growth/growth.macros						POPULATION_BOOST_ORGANIC (growth special local)
./specials/planet/growth/growth.macros						POPULATION_BOOST_ROBOTIC (growth special focus)
./specials/planet/growth/growth.macros						POPULATION_BOOST_ROBOTIC  (growth special local)
./specials/planet/growth/growth.macros						POPULATION_BOOST_LITHIC (growth special focus)
./specials/planet/monster_stealth/DIM_RIFT_MASTER.focs.txt	
./specials/planet/TEMPORAL_ANOMOLY.focs.txt	
./specials/planet/TIDAL_LOCK.focs.txt	
./specials/planet/WORLDTREE.focs.txt	
./species/common/population.macros							 PHOTOTROPHIC_BONUS (Red, Neutron)
./species/SP_BANFORO.focs.txt	
./species/SP_BANFORO.focs.txt	
./techs/construction/N_DIMEN_STRUCT.focs.txt	
./techs/growth/CYBORG.focs.txt	
./techs/growth/ORBITAL_HAB.focs.txt	
./techs/growth/PLANETARY_ECOLOGY.focs.txt	
./techs/growth/SUBTER_HAB.focs.txt	
./techs/growth/SYMBIOTIC_BIO.focs.txt	
./techs/growth/XENO_GENETICS.focs.txt	
./techs/growth/XENO_GENETICS.focs.txt	
./techs/growth/XENO_HYBRIDS.focs.txt	
./techs/growth/XENO_HYBRIDS.focs.txt	
[[EARLY_TARGET_POPULATION_SCALING_PRIORITY]]	
./species/common/advanced_focus.macros						FOCUS_BIOTERROR
./species/common/population.macros							 GOOD_POPULATION
[[EARLY_TARGET_POPULATION_OVERRIDE_PRIORITY]]	
./species/common/population.macros							 ENVIRONMENT_MODIFIER (Uninhabitable)
./species/SP_LEMBALALAM.focs.txt	
[[EARLY_POPULATION_PRIORITY]]	
./species/common/population.macros							 PHOTOTROPHIC_BONUS (Others)
[[EARLY_PRIORITY]]	
./species/common/population.macros							 ENVIRONMENT_MODIFIER (Habitable)
[[DEFAULT_PRIORITY]]	
./species/common/population.macros							 BAD_POPULATION
./species/common/population.macros							 GASEOUS_BONUS
[[LATE_PRIORITY]]	
./species/common/xenophobic.macros	
[[VERY_LATE_PRIORITY]]	
./specials/planet/growth/growth.macros						POPULATION_BOOST_LITHIC  (growth special local)
./species/common/population.macros							 HOMEWORLD_BONUS_POPULATION
./species/common/population.macros							 HOMEWORLD_GROWTH_FOCUS_BOOST
./species/common/population.macros							 SELF_SUSTAINING_BONUS
For what I've understood from the ongoing discussion on github (#2153), I assume most entries after [[EARLY_POPULATION_PRIORITY]] should be reassigned to XXXX_TARGET_POPULATION_XXXX priority tags.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12268
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: The priorities mess

#6 Post by Geoff the Medio » Mon Jun 18, 2018 10:14 am

Oberlus wrote:For what I've understood from the ongoing discussion on github (#2153), I assume most entries after [[EARLY_POPULATION_PRIORITY]] should be reassigned to XXXX_TARGET_POPULATION_XXXX priority tags.
I think that's what I'd do, but I don't know what Dilvish has planned.

User avatar
Oberlus
Small Juggernaut
Posts: 704
Joined: Mon Apr 10, 2017 4:25 pm

Re: The priorities mess

#7 Post by Oberlus » Mon Jun 18, 2018 11:14 am

Now a list of the effects on TargetPopulation (instead of files), to help me visualise a proper order:

Note: I'm assuming all environment and phototrphic effects are with same priority (first and second issues noted before in this thread), the rest are placed/ordered as currently.

EARLY_TARGET_POPULATION_PRIORITY
Gaia: value+3*HabSize (if env==good)
Hyper Dam: value-1*HabSize
Growth specials: value+1*HabSize
Dim. Rift Master: value-4 (is this used anywhere? never saw this effect in-game)
Temporal anoma+ly: value-5*HabSize
Tidal lock: value+1*HabSize
Word tree: value+1
Phototrophic bonus: value {+3, +1.5, +0, -1, -10}*HabSize depending on star type
Banforo light malus: value {-2, -1, +0, +0, +0}*HabSize depending on star type
NDim Structures: value+2*HabSize
All growth techs: value+X*HabSize depending on environment

All growth techs are: Cyborg, Orbital hab., Planetary Ecology, Subter. hab., Symbiotic bio., Xeno gen. and Xeno hybrids

EARLY_TARGET_POPULATION_SCALING_PRIORITY
Focus bioterror: value-4
Good population: value+0.25*abs(value)

EARLY_TARGET_POPULATION_OVERRIDE_PRIORITY
Environment modifiers: -999, value+{-4,-2,0,3} depending on environment
Lembalalam immortal: 5

DEFAULT_PRIORITY
Bad population: -0.25*abs(value)
Gaseous malus: -0.5*abs(value)

LATE_PRIORITY
Xenophobic effects

VERY_LATE_PRIORITY
Homeworld bonus: value+2*HabSize
Homeworld growth focus: value+1*HabSize
Self-sustaining: value+3*HabSize

______________________

The list of priorities suggested by @Morlic:

TARGET_POPULATION_BEFORE_SCALING_PRIORITY
TARGET_POPULATION_SCALING_PRIORITY
TARGET_POPULATION_AFTER_SCALING_PRIORITY
TARGET_POPULATION_OVERRIDE_PRIORITY

______________________

My suggested reordering of priorities according to Morlic's suggestion:

EARLY_TARGET_POPULATION_PRIORITY => TARGET_POPULATION_BEFORE_SCALING_PRIORITY

EARLY_TARGET_POPULATION_SCALING_PRIORITY
Place Bioterror effect on TARGET_POPULATION_BEFORE_SCALING_PRIORITY ???
Place Good population effect on TARGET_POPULATION_SCALING_PRIORITY

EARLY_TARGET_POPULATION_OVERRIDE_PRIORITY
Place Lembalalam immortal effect on TARGET_POPULATION_OVERRIDE_PRIORITY
Place environment modifiers in EARLY_TARGET_POPULATION_PRIORITY

DEFAULT_PRIORITY => TARGET_POPULATION_SCALING_PRIORITY
So Bad population and Gaseous effects at the same time than Good population.

Where to place xenophobic effects (currenty LATE_PRIORITY)???
If it should be affected by scaling factors, then TARGET_POPULATION_BEFORE_SCALING_PRIORITY
Otherwise TARGET_POPULATION_AFTER_SCALING_PRIORITY

Homeworld and self-sustaining bonuses (currently VERY_LATE_PRIORITY)???
If it should be affected by scaling factors, then TARGET_POPULATION_BEFORE_SCALING_PRIORITY
Otherwise TARGET_POPULATION_AFTER_SCALING_PRIORITY

User avatar
Oberlus
Small Juggernaut
Posts: 704
Joined: Mon Apr 10, 2017 4:25 pm

Re: The priorities mess

#8 Post by Oberlus » Tue Jun 19, 2018 11:22 am

Just noting:

The changes in https://github.com/freeorion/freeorion/ ... ad2477162c (i.e. the growth specials pop. bonuses) make them not affected by GOOD/BAD population traits (new priority is TARGET_POPULATION_AFTER_SCALING_PRIORITY), while before it was affected (EARLY_TARGET_POPULATION_PRIORITY was affected by both bad and good pop. effects).

Same goes for https://github.com/freeorion/freeorion/ ... e0c8035023 (rest of specials affecting pop as well as the Gaia special).

The environment effects stay on the same priority (before scaling).

Finally, some of the "growth" tech effects that had been recently (after 0.4.7) changed to before-scaling are now back to after-scaling (https://github.com/freeorion/freeorion/ ... 7b55292bd1). For planetary ecology the change is irrelevant but for subterranean hab. it may have a considerable impact on bad/good and specially on gaseous species in early game.

This means that before a good (bad) pop. species with the three specials and gaia was getting 7.5 (4.5) x HabSize pop and now it is 6.0*HabSize.
So, this implies a considerable reduction of the differences between good pop., average pop., bad pop. and gaseous species. In particular, mid game will be rather equalised for all species, and the weight of the pop. nd gaseous traits diminishes significantly and will affect gameplay and balance.

Therefore, I think growth specials are better at BEFORE_SCALING priority, as they were since at least 0.4.7.
Regardless of that, I think it would make sense to put Gaia (that concerns environment) in the same priority than the other environment effects, i.e. before scaling.

User avatar
Oberlus
Small Juggernaut
Posts: 704
Joined: Mon Apr 10, 2017 4:25 pm

Re: The priorities mess

#9 Post by Oberlus » Tue Jun 19, 2018 11:25 am

In any case, extensive playtesting with Sly and any good/bad population species is required to evaluate the current "balance" they have.

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

Re: The priorities mess

#10 Post by Dilvish » Tue Jun 19, 2018 2:59 pm

Oberlus wrote:Just noting:...Therefore, I think growth specials are better at BEFORE_SCALING priority, as they were since at least 0.4.7.
Oberlus wrote:In any case, extensive playtesting with Sly and any good/bad population species is required to evaluate the current "balance" they have.
Growth specials were not before scaling in 0.4.7. They did not get moved to being pre-scaling until early Feb 2018, apparently semi-accidentally, in PR#1941.

So a lot of the balance testing you did on Sly, etc., was already completed then, but perhaps not all of it, this change slipped in around the same time we were making the final AI adjustments for the Sly. But I guess that makes things uncertain enough that our time checking RC2 probably needs to include some balance assessment also, which we would not normally be dreaming of adjusting for an RC.
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
Small Juggernaut
Posts: 704
Joined: Mon Apr 10, 2017 4:25 pm

Re: The priorities mess

#11 Post by Oberlus » Tue Jun 19, 2018 3:39 pm

Ah, thanks for the correction.

I'll be playing this week as intensively as I can. Do you know if the priorities changes are already on the last test build?

Ophiuchus
Vacuum Dragon
Posts: 544
Joined: Tue Sep 30, 2014 10:01 am

Re: The priorities mess

#12 Post by Ophiuchus » Tue Jun 19, 2018 7:14 pm

Oberlus wrote:...Finally, some of the "growth" tech effects that had been recently (after 0.4.7) changed to before-scaling are now back to after-scaling (https://github.com/freeorion/freeorion/ ... 7b55292bd1). For planetary ecology the change is irrelevant but for subterranean hab. it may have a considerable impact on bad/good and specially on gaseous species in early game.
Hm. 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. Probably have to have a look again at that habitable size thingy.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Oberlus
Small Juggernaut
Posts: 704
Joined: Mon Apr 10, 2017 4:25 pm

Re: The priorities mess

#13 Post by Oberlus » Tue Jun 19, 2018 8:54 pm

I again suggest to change HabitableSize of GasGiants to 3 or 4.
It is the simplest way to get what you want (similar population numbers than other species) and has no effect elsewhere (specifically does not mess with priorities because it removes the need to have fancy effects on the population of gaseous species).
Edit: KISS the void.

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

Re: The priorities mess

#14 Post by Dilvish » Wed Jun 20, 2018 8:20 am

Oberlus wrote:I'll be playing this week as intensively as I can. Do you know if the priorities changes are already on the last test build?
It is not; Morlic is still trying to fine-tune a comment to Geoff's satisfaction. But the changes do not require recompilation, they are purely scripting. Something that would work at least with respect to master is to just make a testing branch and merge PR 2168 into it. The PR is based on master and so it would probably not work to just merge it into a 0.4.8 testing branch; you'd need to cherry pick the individual commits. If cherry-picking is not yet within your git repertoire, well, it shouldn't take much longer for the branch to get merged and then added to 0.4.8, and then (because I don't think any of the recent 0.4.8 commits change content parsing) you could just do a git pull from the 0.4.8 branch into wherever you installed this week's pre-RC2 test build, in order to use the updated content with it.

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.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Ophiuchus
Vacuum Dragon
Posts: 544
Joined: Tue Sep 30, 2014 10:01 am

Re: The priorities mess

#15 Post by Ophiuchus » Wed Jun 20, 2018 8:21 am

Oberlus wrote:I again suggest to change HabitableSize of GasGiants to 3 or 4.
I think also that setting it to 3 is the best thing to do .
Somebody in the course of the discussion added the habitableSize to the planet and a rule to set it and adjusted the AI and the FOCS and everything, so lets do this :)

I did a code review and to do it right one could do the following:
  • document the habitableSize+game rule concept somewhere in the encyclopedia etc
  • growth tech stringtables should know about gas giants
  • growth tech stringtables should use the values actually set int the game rules(?)
  • move habitableSize from Planet to PopulationCenter and adjust conditions (later)
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Post Reply