alleryn wrote: ↑Sun Oct 13, 2019 8:47 pm
Edit: Also, this is more a matter for my own curiosity, but if someone happens to know, why is % hull->Speed() in there twice? /Edit
Once there was a distinction between ship combat speed and starlane speed. This is most likely an artifact of that. If you look at the commit history of that line you should be able to see it.
Geoff the Medio wrote: ↑Sun Oct 13, 2019 11:24 pm
I don't know what the Statistic If in the existing script that checks for a matching tag is for... The corresponding fuel efficiency effectsgroup should only be added to hulls that have that efficiency anyway.
The tag is necessary for AI to pick up fuel efficiency (and probably we could also use it for generating encyclopedia entries). The check in FOCS is so that you can see that you forgot to add the tag. One would probably miss that the AI miscalculates the fuel on ship design because the tag is missing.
alleryn wrote: ↑Mon Oct 14, 2019 12:19 am
Geoff the Medio wrote: ↑Sun Oct 13, 2019 11:24 pm
The FOCS effects could probably be modified to self-correct for the hull's inherent fuel capacity by subtracting the hull's own fuel before multiplying and then re-adding the hull's own fuel after the scaling effect... Something like
Code: Select all
effects = SetMaxFuel value = (Value - HullFuel name = ThisHull) * @2@ + HullFuel name = ThisHull
(I don't know what the Statistic If in the existing script that checks for a matching tag is for... The corresponding fuel efficiency effectsgroup should only be added to hulls that have that efficiency anyway.)
I don't really understand the idea here. Is this aimed at the pedia fuel display issue or something else?
Yes, the base fuel of the hull could be set to the effective fuel value which is already shown in the pedia. With this implementation fuel efficiency effect description becomes a bit more strange (efficiency only affects fuel tanks and other fuel effects but not base fuel).
This does the trick for ship hulls but it makes the effect more convoluted so I decided against it when doing the implementation.
alleryn wrote: ↑Mon Oct 14, 2019 12:19 am
I can't seem to find where the hull->Speed(), hull->Fuel(), etc stuff is coming from in the code. I can find a lot of places hull_type->Fuel() gets used (where hull_type is a const HullType*) but when i search for HullType* i'm having difficulty following the thread to where these methods are defined.
HullType is defined in universe/ShipDesign.h and universe/ShipDesign.cpp (NB: all game objects are in the universe folder).
alleryn wrote: ↑Mon Oct 14, 2019 12:19 am
Is there some way we could report the "final value" (maxFuel i guess?) instead of Fuel(), in order to bypass the need for the C++ code to check in FOCS for which HULL_FUEL_EFFICIENCY tag is in place for a given hull?
Probably. You need an extra effect application to do this similar to what we do in the ship design screen. But you still need to know the fuel efficiency of a hull (which could be extracted from analysing the fuel efficiency tags).
The question is also which places of pedia you want to address. There are hulls, ship designs, fuel tanks, species fuel effects and other fuel effects which get influenced by efficiency. And the most difficult thing is that fuel tanks effect also depends on your fuel tech research.
For the hull descriptions something like the following should suffice e.g.: this hull has average effective fuel but bad fuel efficiency
For ship design and ship info the effects need to applied and the resulting value shown (which happens).
and so on...
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!