Excruciating FOCS doubts

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

Moderators: Oberlus, Committer

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

Re: Excruciating FOCS doubts

#166 Post by Geoff the Medio »

Oberlus wrote: Tue Mar 29, 2022 10:49 am Should all hulls include this?
Weapon parts, not hulls, but also no.
Is there a default value for those hulls that doesn't have it?
Weapons are assumed to do damage*shots*bouts total ship damage per combat by default. Some weapons have different mechanics that make that default not apply.
What uses have this valueref presently in backend or scripting? I see they are declared, but what effects have this in game?
It's used when calculating ship total damage per combat estimations in the objects list, I think. Not sure where else.

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

Re: Excruciating FOCS doubts

#167 Post by Oberlus »

Thanks for the explanations. So it is mainly for showing right values in the UI.

But this still puzzles me:

Code: Select all

Value(Target.Shield)
UI can't have a "Target" when showing these values, so is it just a useless piece of code?
Maybe there are uses for this, already in the code or planned for future?

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

Re: Excruciating FOCS doubts

#168 Post by Ophiuchus »

the property has some uses apart from UI;

i think Attack valueref uses it. maybe it is used for Armed condition for blockade etc (to find out if total damage is higher zero)
Oberlus wrote: Tue Mar 29, 2022 10:49 am What uses have this valueref presently in backend or scripting? I see they are declared, but what effects have this in game?
the valuerefs are used in military statistic currently
Oberlus wrote: Wed Mar 30, 2022 10:00 am But this still puzzles me:

Code: Select all

Value(Target.Shield)
UI can't have a "Target" when showing these values, so is it just a useless piece of code?
Maybe there are uses for this, already in the code or planned for future?
this is heavily used. i think ship designs show a value against certain shield strength. Cant remember if blockade considers shield strength or not. I rememember i liked the idea shields could influence blockade - if the enemy cant hurt you, then the enemy cant blockade you. But not sure what the outcome was.

so the mechanic (properties) is very much integrated.
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: Excruciating FOCS doubts

#169 Post by Oberlus »

Ophiuchus wrote: Wed Mar 30, 2022 10:20 am

Code: Select all

Value(Target.Shield)
this is heavily used. i think ship designs show a value against certain shield strength.
I've played with the UI in master (fdeac67) trying to find a use for that Target.Shield. More specifically, I tried to find a shown value of total damage that took into account any non-zero shield value.

I had several ships in the map and ship designs with and without shields. I tried the following:
- Selecting ships in the map, and switching between ships with and without shields (from no-shield to no-shield, no-shield to shield, shield to shield, shield to no shield).
- Selecting ship designs, and switching between designs with and without shields, also with single and double clicking, repeated times.
- Selecting a ship in the map and then checking ship design values, switching between different ships in the map and different ship designs.

Damage shown is always against zero shields.

So in what way is this Target.Value very much integrated? What am I missing?

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

Re: Excruciating FOCS doubts

#170 Post by Ophiuchus »

Oberlus wrote: Wed Mar 30, 2022 11:13 am I tried the following:
...
Damage shown is always against zero shields.
This line shown in design or in pedia entry for a ship should use the valueref in combat value calculation
" (enemy with attack 3.1 and shields 0.0): 239 (5.11 per PP)"

The expected enemy shield value grows when the game progresses. So might not be available at the beginning of the game. If it always sais shields 0.0, there is a bug.

Maybe you can also click on an _enemy_ ship so the game can pick the shield value from there and then show the pedia entry for one of your ships (?). Not sure that exists.
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!

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

Re: Excruciating FOCS doubts

#171 Post by Ophiuchus »

Also, if you dont want to source-dive, set the damage total property 0 for some weapon while leaving the damage non-zero and see if you are still able to blockade.
Best to try in multiplayer i guess.
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!

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Excruciating FOCS doubts

#172 Post by o01eg »

Condition OwnerHasTech accepts empire and name parameters but parser only accepts name and I don't see if empire is even used somewhere. Is it intended?
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-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: Excruciating FOCS doubts

#173 Post by Geoff the Medio »

It should be renamed EmpireHasTech for the empire_id parameter to make sense. That's probably the reason the empire parameter wasn't added to the parser.

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Excruciating FOCS doubts

#174 Post by o01eg »

LienRag wrote: Tue Dec 28, 2021 2:47 pm So that's why documentation is really important. I know where to find Python documentation (mostly) but it would be nice to have python-FOCS documentation.
I've never seen even non-python-FOCS documentation. I treat it as "black box" where I just reproduce input structures and check checksum outputs, sometimes dumps if it somewhat complex.
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-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: Excruciating FOCS doubts

#175 Post by Ophiuchus »

o01eg wrote: Sun Jun 12, 2022 5:53 pm I've never seen even non-python-FOCS documentation.
https://freeorion.org/index.php/FOCS_Scripting_Details
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
Cpeosphoros
Space Kraken
Posts: 124
Joined: Sat Jan 30, 2016 11:29 am

Re: Excruciating FOCS doubts

#176 Post by Cpeosphoros »

First and foremost, thanks Ophiucus for maintaining the snap packaging.

I'm returning to the game and trying to get so custom scripting running here on my side, but, as pointed by the OP, it doesn't seem to be working with snap FO.

In-game options says my resources folder should be "~/snap/freeorion/231/share/freeorion/default", which didn't exist in my instalation, so I've created /default, copied scripting/custom_sitreps.txt from the github repo, and inserted some custom ones from my own.

So far so good.

Game runs, ok, only caveat is that the custom sitreps don't appear in-game.

Anything I'm missing or doing wrong? Or don't snap FO actually work with custom FOCS?

If it makes any difference, I'm playing on Mint with a 8 core amd64 architecture box.
All contributions are released under GPL or LGPL v2 or later, or under appropriate Creative Commons licence, consistent with project guidelines.

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

Re: Excruciating FOCS doubts

#177 Post by Ophiuchus »

Cpeosphoros wrote: Tue Jun 21, 2022 10:52 pm First and foremost, thanks Ophiucus for maintaining the snap packaging.
you are welcome
Cpeosphoros wrote: Tue Jun 21, 2022 10:52 pm In-game options says my resources folder should be "~/snap/freeorion/231/share/freeorion/default", which didn't exist in my instalation, so I've created /default, copied scripting/custom_sitreps.txt from the github repo, and inserted some custom ones from my own.
...
Anything I'm missing or doing wrong? Or don't snap FO actually work with custom FOCS?
that resources folder path "~/snap/freeorion/231/share/freeorion/default" exists only inside the snap freeorion container (the directory getting mounted is /snap/freeorion/231/share/freeorion/default )

we do not support multiple sources/base directories for script files. so you need a complete resources folder, not one with only changed files.

also using revision specific directories probably will break the next time snap updates the revision. the revision you use is 231 so that is the stable (and old) release and probably would only be upgraded very rarely, so it is less of an issue. also note there are changes scheduled for the ~/snap ~/Snap ~/.snap folders, so better do not use those for your changes.

most straightforward solution: in the settings you need to change the base scripting directory (the "default" folder) to one which contains the complete contents including your changes; e.g. you could check out to ~/freeorion
:mrgreen:
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!

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

Re: Excruciating FOCS doubts

#178 Post by wobbly »

Why does this not create a link to the interstellar logistics tech? :

Code: Select all

LOGISTICS_FOCUS_TEXT
'''Planets focused on Logistics have their [[metertype METER_SUPPLY]] increased by 3. This extends the planet's empire's supply network from the planet by 3 starlane jumps.

Unlocked by: [[tech SHP_INTSTEL_LOG]].'''

while this does create a link to the concentration camp tech? :

Code: Select all

XENOPHOBIC_SPECIES_TEXT
'''Xenophobic species will automatically divert some of their industrial efforts into harassing other species that are nearby. The affected nearby species will suffer an industrial penalty due to this harassment. A Xenophobic species of [[encyclopedia SELF_SUSTAINING_SPECIES_TITLE]] will also find the presence of alien species nearby to be disruptive to its natural balances (whether due to some direct effect or simply due to wasted energies being applied to harassing the alien species, has not been determined) resulting in a reduced [[metertype METER_TARGET_POPULATION]].

Xenophobic species start with [[tech CON_CONC_CAMP]].

List of Xenophobic species:'''
The only thing I can see that's different to other examples in the stringtable is interstellar logistics is named as a ship tech(SHP_) instead of a construction tech(CON_)

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

Re: Excruciating FOCS doubts

#179 Post by Ophiuchus »

wobbly wrote: Mon Jul 11, 2022 7:20 amWhy does this not create a link to the interstellar logistics tech? :
i guess its the use site. what is shown if you put the working species trait text to the focus text?

Code: Select all

LOGISTICS_FOCUS_TEXT
'''Xenophobic species will automatically divert some of their industrial efforts into harassing other species that are nearby. The affected nearby species will suffer an industrial penalty due to this harassment. A Xenophobic species of [[encyclopedia SELF_SUSTAINING_SPECIES_TITLE]] will also find the presence of alien species nearby to be disruptive to its natural balances (whether due to some direct effect or simply due to wasted energies being applied to harassing the alien species, has not been determined) resulting in a reduced [[metertype METER_TARGET_POPULATION]].

Xenophobic species start with [[tech CON_CONC_CAMP]].

List of Xenophobic species:'''
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!

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

Re: Excruciating FOCS doubts

#180 Post by wobbly »

wobbly wrote: Mon Jul 11, 2022 7:20 am Why does this not create a link to the interstellar logistics tech? :

Code: Select all

LOGISTICS_FOCUS_TEXT
'''Planets focused on Logistics have their [[metertype METER_SUPPLY]] increased by 3. This extends the planet's empire's supply network from the planet by 3 starlane jumps.

Unlocked by: [[tech SHP_INTSTEL_LOG]].'''

while this does create a link to the concentration camp tech? :

Code: Select all

XENOPHOBIC_SPECIES_TEXT
'''Xenophobic species will automatically divert some of their industrial efforts into harassing other species that are nearby. The affected nearby species will suffer an industrial penalty due to this harassment. A Xenophobic species of [[encyclopedia SELF_SUSTAINING_SPECIES_TITLE]] will also find the presence of alien species nearby to be disruptive to its natural balances (whether due to some direct effect or simply due to wasted energies being applied to harassing the alien species, has not been determined) resulting in a reduced [[metertype METER_TARGET_POPULATION]].

Xenophobic species start with [[tech CON_CONC_CAMP]].

List of Xenophobic species:'''
The only thing I can see that's different to other examples in the stringtable is interstellar logistics is named as a ship tech(SHP_) instead of a construction tech(CON_)
Ok I've had time to play around and the problem goes away if I change every instance of SHP_INTSTEL_LOG in the game to CON_INSTEL_LOG, so basically this must be a parser error caused by:
name="SHP_INTSTEL_LOG",
description="SHP_INTSTEL_LOG_DESC",
short_description="STARLANE_SPEED_SHORT_DESC",
category="CONSTRUCTION_CATEGORY",
notice that the name is SHP_, but the category is CON_ ?
I believe the parser is reading the start of the string, and then looking in the wrong place.

Post Reply