Excruciating FOCS doubts

Creation, discussion, and balancing of game content such as techs, buildings, ship parts.

Moderators: Oberlus, Committer

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

Re: Excruciating FOCS doubts

#181 Post by Oberlus »

I
wobbly wrote: Mon Jul 11, 2022 1:47 pm the problem goes away if I change every instance of SHP_INTSTEL_LOG in the game to CON_INSTEL_LOG
Then do it (if nothing else breaks, including AI).

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

Re: Excruciating FOCS doubts

#182 Post by Geoff the Medio »

wobbly wrote: Mon Jul 11, 2022 7:20 am Why does this not create a link to the interstellar logistics tech? :
[...]
while this does create a link to the concentration camp tech? :
Works for me...
links.png
links.png (73.36 KiB) Viewed 1494 times

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

Re: Excruciating FOCS doubts

#183 Post by wobbly »

It's working for me now. With an exact copy of what wasn't working for me... Only difference is a newer build. Presumably I'd just stuffed something up on my end.

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

Re: Excruciating FOCS doubts

#184 Post by wobbly »

Is there a check for game setting Natives = None?

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

Re: Excruciating FOCS doubts

#185 Post by Oberlus »

wobbly wrote: Fri Jul 22, 2022 5:13 am Is there a check for game setting Natives = None?
Did you find an answer for that?



And a totally different question:
I am trying to write a tutorial-ish for policies, and I lack knowledge on too many policies.

This is the FOCS effect's code for Colonialism policy (with my own comments for this question):

Code: Select all

01        // industry-focused planets collect industry output from neutral planets that are in nearby systems in the supply network
02        EffectsGroup
03            scope = And [ // Possible Targets: Colonies owned by Source.Empire supply-connected to and within 3 jumps off an unowned colony outside Target's system.
04                Planet
05                OwnedBy empire = Source.Owner
06                Focus type = "FOCUS_INDUSTRY"
07                ResourceSupplyConnected empire = Source.Owner condition = And [ // needs to be connected to at least one candidate to take industry from...
08                    Not InSystem id = RootCandidate.SystemID
09                    Planet
10                    Species
11                    Unowned
12                    WithinStarlaneJumps jumps = 3 condition = RootCandidate
13                ]
14            ]
15            effects = SetTargetIndustry value = Value +
16                // adjust industry of planets that are collected from by the number of planets that might be simultaneously taking from them
17                (Statistic Sum
18                    value = (LocalCandidate.Industry / // Take the industry generated in an unowned planet (just 0.2*pop unless it's an independent-ed world with retained techs)
19                             max(1.0,                  // and divide it by the... 
20                                 Statistic Count condition = And [ // ... count of Source.Empire planets outside "StatisticSum:LocalCandidate"'s system with industry focus supply-connected to...
21                                         Not InSystem id = RootCandidate.SystemID
22                                         Planet
23                                         OwnedBy empire = Source.Owner
24                                         Focus type = "FOCUS_INDUSTRY"
25                                         //... other Source.Empire planets outside "StatisticSum:LocalCandidate"'s system with industry focus within 3 jumps off "StatisticSum:LocalCandidate"
26                                         ResourceSupplyConnected empire = Source.Owner condition = And [ 
27                                                 Not InSystem id = RootCandidate.SystemID
28                                                 Planet
29                                                 Species
30                                                 OwnedBy empire = Source.Owner
31                                                 Focus type = "FOCUS_INDUSTRY"
32                                                 WithinStarlaneJumps jumps = 3 condition = RootCandidate
33                          ]]))
34                    condition = And [ // Each of the "StatisticSum:LocalCandidate"s: unowned colonies supply-connected to and withing 3 jumps off Target.
35                        Not InSystem id = Target.SystemID
36                        Planet
37                        Unowned
38                        Species
39                        WithinStarlaneJumps jumps = 3 condition = Target
40                        ResourceSupplyConnected empire = Source.Owner condition = Target
41                    ])
I don't have a game in which I can test this properly, will do it in the future. But in case I get answers sooner than that, here I go:

- Lines 18-20, 25 & 34: Are the comments I added correct or am I misunderstanding the code?
- Lines 8, 21 & 27: why can't worlds collect from neutral planets in the same system? Couldn't I just remove those "Not InSystem" clauses?
- Line 18: that LocalCandidate.Industry is the Industry meter of an unowned planet, right? Is it intended or was is expected to be LocalCandidate.Population or something like that? With .Industry, if it works as I understood, the more industry-boost techs you get before making a world independent, the better (assuming that the Industry meter of the newly-independent world does keep the bonuses).
- Lines 26-32: why are the owned-planets-that-will-collect-from-the-unowned-candidate checked for being connected to other owned-planets-that-qualify-as-collectors?

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

Re: Excruciating FOCS doubts

#186 Post by Geoff the Medio »

Oberlus wrote: Fri Jul 29, 2022 11:46 amwhy can't worlds collect from neutral planets in the same system? Couldn't I just remove those "Not InSystem" clauses?
I think there was/is another policy for that.
- Line 18: that LocalCandidate.Industry is the Industry meter of an unowned planet, right?
Of planets that match the Statistic sampling condition below, which is unowned planets, not the target object's system, with species, within 3 jumps of the target and supply connected by the source empire to the target.
Is it intended or was is expected to be LocalCandidate.Population or something like that?
Industry was intended, but if you think it should be something else, perhaps it should...
Lines 26-32: why are the owned-planets-that-will-collect-from-the-unowned-candidate checked for being connected to other owned-planets-that-qualify-as-collectors?
If a source planet is having its production taken by two collector planets, then each of the collectors only gets half as much. This way it's not useful to spam collector planets any more than necessary such that each source planet is collected from by at least one collector.

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

Re: Excruciating FOCS doubts

#187 Post by Ophiuchus »

Oberlus wrote: Fri Jul 29, 2022 11:46 am - Line 18: that LocalCandidate.Industry is the Industry meter of an unowned planet, right? Is it intended or was is expected to be LocalCandidate.Population or something like that? With .Industry, if it works as I understood, the more industry-boost techs you get before making a world independent, the better (assuming that the Industry meter of the newly-independent world does keep the bonuses).
currently, industry meter won't profit from previous owners tech (is not saved anywhere). I think (target) population is already.

maybe in 0.5+ we could add a (influence) project "Upgrade native technology" - so one could up the maxima without having to conquer the planet.
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
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: Excruciating FOCS doubts

#188 Post by LienRag »

Ophiuchus wrote: Sat Jul 30, 2022 7:56 am
currently, industry meter won't profit from previous owners tech (is not saved anywhere). I think (target) population is already.

maybe in 0.5+ we could add a (influence) project "Upgrade native technology" - so one could up the maxima without having to conquer the planet.
Interesting...

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

Re: Excruciating FOCS doubts

#189 Post by wobbly »

LienRag wrote: Sat Jul 30, 2022 9:07 pm Interesting...
You don't ever listen to people do you...

https://www.freeorion.org/forum/viewtop ... =2&t=12481

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

Re: Excruciating FOCS doubts

#190 Post by wobbly »

Ok Stringtables question:

Code: Select all

SH_ORGANIC_DESC
'''A living hull with one external slot and one internal slot.
Organic Growth: starts with 5 [[metertype METER_STRUCTURE]], but grows an additional 5 structure over 25 turns.
So both those 5s need to be 5 * (GameRule name = "RULE_SHIP_STRUCTURE_FACTOR") and I could add a namedreal for organic hull structure, but then I'd need to do the same for every single value that has a structure entry in the pedia.

What I'd like to do is something like [[MACRO_SHIP_STRUCTURE(5)]] but apparently you can't within the stringtables?

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

Re: Excruciating FOCS doubts

#191 Post by wobbly »

wobbly wrote: Sun Jul 31, 2022 4:05 pm What I'd like to do is something like [[MACRO_SHIP_STRUCTURE(5)]] but apparently you can't within the stringtables?
Ok slight clarification, I can do:

[[MACRO_SHIP_STRUCTURE(1)]], [[MACRO_SHIP_STRUCTURE(2)]], [[MACRO_SHIP_STRUCTURE(3)]] etc. (but each would have to be a named real defined in-game with individual string entries.)

but not [[MACRO_SHIP_STRUCTURE(x)]]

Edit: I guess I'm looking for clarification about how best to update these.
  1. I can attach a named value to every hull, every weapon, every shield, every relevant tech
  2. I can attach a named value to individual values: structure = 1*scaling, structure = 5*scaling etc.
  3. Some better solution that I haven't thought of

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

Re: Excruciating FOCS doubts

#192 Post by Geoff the Medio »

wobbly wrote: Sun Jul 31, 2022 4:05 pm...those 5s need to be 5 * (GameRule name = "RULE_SHIP_STRUCTURE_FACTOR") and I could add a namedreal for organic hull structure, but then I'd need to do the same for every single value that has a structure entry in the pedia.

What I'd like to do is something like [[MACRO_SHIP_STRUCTURE(5)]] but apparently you can't within the stringtables?
I don't understand what you want to do or what the difficulty is...

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

Re: Excruciating FOCS doubts

#193 Post by wobbly »

Geoff the Medio wrote: Mon Aug 01, 2022 8:29 am
wobbly wrote: Sun Jul 31, 2022 4:05 pm...those 5s need to be 5 * (GameRule name = "RULE_SHIP_STRUCTURE_FACTOR") and I could add a namedreal for organic hull structure, but then I'd need to do the same for every single value that has a structure entry in the pedia.

What I'd like to do is something like [[MACRO_SHIP_STRUCTURE(5)]] but apparently you can't within the stringtables?
I don't understand what you want to do or what the difficulty is...
These numbers are wrong. It's actually 3 * (GameRule name = "RULE_SHIP_STRUCTURE_FACTOR") = 24 and grows 3 * (GameRule name = "RULE_SHIP_STRUCTURE_FACTOR") = 24

OrganicHull.png
OrganicHull.png (78.45 KiB) Viewed 1289 times
Also wrong. Its capped at 20 * GameRule = 120

Shield.png
Shield.png (93.2 KiB) Viewed 1289 times
These numbers (+12 and -12) are correct with default game rules. They are actually +2 * 6 and -2 * 6 and are wrong if you change the game rules.

laser.png
laser.png (117.54 KiB) Viewed 1289 times
The pedia is full of these values. Some are correct for 4 round combat and weapon/shield scaling. Some are the old values from before 4 round combat and weapon/shield scaling. Some are namedvalues and auto-update if values are changed. Some are not namedvalues and don't update if values change. The ones with named values show correct values when you change the starting options. The ones without named values don't show correct values when you change starting options.

I would like to update these entries and I'm looking for the best way to handle it. Ideally I'd like to change 5 to 5 * Game Rule so that the pedia shows correct value for current game settings.

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

Re: Excruciating FOCS doubts

#194 Post by wobbly »

Note:

Simplest solution is I make sure that every value is correct for default settings, before release, and the bigger issue is sorted out later.

Daybreak
Vacuum Dragon
Posts: 641
Joined: Mon Aug 13, 2018 10:14 pm

Re: Excruciating FOCS doubts

#195 Post by Daybreak »

Oberlus wrote: Fri Jul 29, 2022 11:46 am I am trying to write a tutorial-ish for policies, and I lack knowledge on too many policies.
Can you publish what you do have now, and update as you go?

From what I have seen and read, you probably have the most knowledge of the subject, and we could all benefit from it.

In the future this could be placed in the Pedia

Post Reply