One line per (dis-)liked building
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.
One line per (dis-)liked building
In master, now you get a bonus for every build that the species likes:
Dislikes Gloom I building Gas Giant Generator: -2.00
Dislikes 5x remote building Gas Giant Generator: -2.05
Likes Gloom II building Interstellar Lighthouse: +4.00
Likes 11x remote building Interstellar Lighthouse: +2.97
I am not sure this can be scripted, but without it the list may become too big to be displayed for large empires. Any ideas?
If this shall remain, the display should probably combine identical values in one line like:Dislikes Gloom I building Gas Giant Generator: -2.00
Dislikes 5x remote building Gas Giant Generator: -2.05
Likes Gloom II building Interstellar Lighthouse: +4.00
Likes 11x remote building Interstellar Lighthouse: +2.97
I am not sure this can be scripted, but without it the list may become too big to be displayed for large empires. Any ideas?
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: One line per (dis-)liked building
The "11x" part is difficult without substantial C++ code changes. The effects of multiple buildings could be refactored into a single effect attached to the species, rather than having each building generate its own effect, with just FOCS changes.
Re: One line per (dis-)liked building
We'll need a way to expand this view one way or another in order to be able to find the Disliked buildings when a planet's stability tanks...
Re: One line per (dis-)liked building
Well, the 11x is not so important. When attaching it to the species however, I don't see how to make it one line per building type.
But than maybe combining all disliked building in other system into one effect is okay. They are all far away after all. It definitely keep the list from getting too long.
I have almost done it, except that I haven't figured out the condition for (dis-)like from the species context. It should be something like this, I guess:
But than maybe combining all disliked building in other system into one effect is okay. They are all far away after all. It definitely keep the list from getting too long.
I have almost done it, except that I haven't figured out the condition for (dis-)like from the species context. It should be something like this, I guess:
Code: Select all
Statistic Count condition = And [
Building
OwnedBy empire = Source.Owner
Not InSystem id = Source.SystemID
(SpeciesContentOpinion species = Source.Species
name = LocalCandidate.??? > 0)
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: One line per (dis-)liked building
I guess that's a bit trickier than I initially thought, as you have no easy way to generate separate effects for each disliked building type if it's not using one of those buildings as the source of the effect, without explicitly writing an effectsgroup in the species script for each disliked building type, which I don't want to do.
You could perhaps rewrite the effect on the building to determine the size of the meter adjustment by counting all the buildings of the same type and that meet the location requirements for the current target planet object(s), and then use a stacking group so that the effect for each building type is only applied once per planet.
Re: One line per (dis-)liked building
I wonder if adding a feature to the effects accounting which allows for merging/accumulating multiple effect accounting entries into one...?
Re: One line per (dis-)liked building
I'm not sure about feature but I think it would be nice to see total merged effect which could be expanded to detailed UI.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-04-14.ad50e93.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-04-14.ad50e93.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
Re: One line per (dis-)liked building
Stringtable entries, including accounting labels, can have parameters, like the following:
Currently, building's (dis)like effect is based on square root of number of the building in the empire:
https://github.com/freeorion/freeorion/ ... os#L63-L82
So it makes sense to see the total value regardless of listing or not each of the planets that have the buildings.
Being able to see in the tooltip the name of the planets or systems that have each of the many instances of a building which we need to cull doesn't seem helpful to me.
Why not just show the total bonus/malus with the name and number of offending buildings, and let the player use the Objects Window to pinpoint the planets that have the buildings? I have never tried to use the Objects Window to filter planets per buildings though, maybe it can't be done...
Code: Select all
# %1% name of empire
# %2% name of policy
DISLIKES_POLICY_LABEL
Dislikes %1% policy %2%
https://github.com/freeorion/freeorion/ ... os#L63-L82
So it makes sense to see the total value regardless of listing or not each of the planets that have the buildings.
Being able to see in the tooltip the name of the planets or systems that have each of the many instances of a building which we need to cull doesn't seem helpful to me.
Why not just show the total bonus/malus with the name and number of offending buildings, and let the player use the Objects Window to pinpoint the planets that have the buildings? I have never tried to use the Objects Window to filter planets per buildings though, maybe it can't be done...
Re: One line per (dis-)liked building
If that was possible, why not. But AFAIK it is not : I have tried to do that to find Transformers or Stargates and never succeeded.Oberlus wrote: ↑Thu Jun 03, 2021 3:39 pm Why not just show the total bonus/malus with the name and number of offending buildings, and let the player use the Objects Window to pinpoint the planets that have the buildings? I have never tried to use the Objects Window to filter planets per buildings though, maybe it can't be done...
Re: One line per (dis-)liked building
Of course I tried that with Filters.
But I tried to use some Filter criteria on the Planets, I actually never noticed that there was a "Building" category for objects, so thanks.
Actually I had asked for this possibility some time ago, and never received answers, so I believed it to be impossible (well, it was impossible the way I was trying to do it).
Indeed since it's possible to find (with the Filters) the buildings that doesn't spark joy, it's less relevant to have the planet name in the display.
But I tried to use some Filter criteria on the Planets, I actually never noticed that there was a "Building" category for objects, so thanks.
Actually I had asked for this possibility some time ago, and never received answers, so I believed it to be impossible (well, it was impossible the way I was trying to do it).
Indeed since it's possible to find (with the Filters) the buildings that doesn't spark joy, it's less relevant to have the planet name in the display.
Re: One line per (dis-)liked building
I'm going to suggest a simpler solution. No stacking, just a single bonus/penalty for closest building.
Re: One line per (dis-)liked building
It is intended that more buildings in the empire cause bigger effect on stability. It helps with building spamming: if your species dislike orbital drydocks, you won't be able to spam them everywhere without making all your population too unstable to get most bonuses or even rebellious.
I think a line per in planet or in system building (that usually won't be more than one in system) and a single line per in empire buildings ("3 BuildingName in empire: x.xx").
If UI is improved to allow unfolding the list of planets with the buildings, great. Meanwhile, player can use Objects Window filtering by owned, present buildings.
Currently, each building will trigger the effect without any stacking group, so each colony will get one penalty per each building with information on the planet that caused it.
https://github.com/freeorion/freeorion/ ... macros#L63
The formula is max(1,#blds)^(-0.5), that multiplied by all the buildings that trigger it gets us a total of max(1,#blds)^0.5
So it could use a stacking group and remove the negative sign of the exponent, and adjust accounting label to not show the name of the planet.
Re: One line per (dis-)liked building
I think this would be the best solution. Could prepare a pull request for it.
An easy solution is to change the scripting for buildings in other systems to result in a text like:
Dislikes remote building Gas Giant Generator 0.41
The GUI then simple combines consecutive effects with the same text an produces:
5 x Dislikes remote building Gas Giant Generator 2.05
Of course there is no way to unfold this.
When the scripting stays like it is, the GUI must explicitly handled building effects and produces a text like:
Dislikes 5x building Gas Giant Generator 2.05
5x could then unfold into a list of planets via mouse over or click, but for that I'd need help.
Regards,
Frank
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: One line per (dis-)liked building
Unfolding would be a bit of UI coding, but just merging related effects could probably be done by adding a call to a function to pre-process the effects accounting info here: https://github.com/freeorion/freeorion/ ... d.cpp#L329 before creating the labels.