Fuel parts auto upgrade

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

Moderators: Oberlus, Committer

Message
Author
dbenage-cx
Programmer
Posts: 389
Joined: Sun Feb 14, 2016 12:08 am

Re: Fuel parts auto upgrade

#16 Post by dbenage-cx »

Geoff the Medio wrote:Though why not instant upgrade to the latest available fuel capacity when in supply range?
The current revision of the PR does not require supply line for upgrade (by design).
May add to confusion for new players as it is not consistent with other tech improvements.
If supply will not be required, the pedia entries should probably note the exception (possibly with some flavorful reasoning).
Any content posted should be considered licensed GNU GPL 2.0 and/or CC-BY-SA 3.0 as appropriate.

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

Re: Fuel parts auto upgrade

#17 Post by Dilvish »

dbenage-cx wrote:
Geoff the Medio wrote:Though why not instant upgrade to the latest available fuel capacity when in supply range?
The current revision of the PR does not require supply line for upgrade (by design).
May add to confusion for new players as it is not consistent with other tech improvements.
If supply will not be required, the pedia entries should probably note the exception (possibly with some flavorful reasoning).
I strongly share what I understand to be Geoff's preference on this, that the upgrade be done when in supply range.
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
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Fuel parts auto upgrade

#18 Post by MatGB »

Doesn't make much difference though, you only really refuel when in supply, having a larger notional tank while unable to fill it doesn't help that much (haven't had time to look at the scripts but...)

Consistency with other effects is good, thus in supply for an upgrade is preferred but in a case like this it doesn't actually matter.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

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

Re: Fuel parts auto upgrade

#19 Post by Geoff the Medio »

I was mainly questioning the slow increase of max part...
Ophiuchus wrote:I would suggest that max_fuel increases in old ships slowly to the current tech given one if the ship is supply-line connected.
Maybe 0,5 per turn?
If there is almost / actually no way to regain fuel without being in supply, then immediately increasing the max fuel meter when a new fuel tech is acquired, regardless of ship location, is probably fine.

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

Re: Fuel parts auto upgrade

#20 Post by Dilvish »

Geoff the Medio wrote:If there is almost / actually no way to regain fuel without being in supply
Sounds rather like you must consider the existing ways to refuel out of supply as "almost no way", but it leaves me puzzled as to why you chose to express it in this indefinite way. Are you trying to indirectly flag that the question would have to be revisited anytime another refueling mechanism is proposed?

And our summary of the policy, for explaining things to new scripters, would go from something like "a ship has to be in supply range for parts on it to be upgraded" to "a ship has to be in supply range for parts on it to be upgraded, except fuel parts can be upgraded anywhere so long as no one adds a way to refuel outside of supply range that is more significant than ways X, Y and Z"?

I fail to understand the benefit of this more complicated policy.
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
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Fuel parts auto upgrade

#21 Post by Geoff the Medio »

Dilvish wrote:I fail to understand the benefit of this more complicated policy.
The benefit would mainly be not having to add a separate meter to track MaxMaxFuel, which is set by tech effects and hull hull and part stat effects, and then set MaxFuel equal to MaxMaxFuel whenever a ship is in supply range and is allowed to receive upgrades, and then set Fuel equal to MaxFuel whenever in supply range to refuel. If there are just MaxFuel and Fuel meters, there's no way to keep track of what a ship's current MaxFuel is independent of what it would be while in supply range, and thus anything that increases the Fuel meter would do so up to the current MaxFuel, which would have a value determined by researched techs regardless of whether it has been in a situation that would normally allow upgrades to take effect. You can't just say the MaxFuel meter gets a boost when it's in supply range, as then that boost will go away when it leaves supply range.

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

Re: Fuel parts auto upgrade

#22 Post by Dilvish »

Geoff the Medio wrote:The benefit would mainly be not having to add a separate meter to track MaxMaxFuel, which is set by tech effects and hull hull and part stat effects...
I'll grant that MaxMaxSomething is a not-so-appealing kind of name, but that seems hardly significant, and besides, couldn't we avoid that by just renaming MaxFuel as FuelCapacity, and then our new meter would be MaxFuelCapacity?

And regarding the bit about adding the extra meter and dealing with using it, well, I'm not seeing the notable difference between that versus the meter you added for upgrading weapons. Though I'll confess I am perhaps not quite 100% conversant with the weapon upgrade handling (and looking through the scripts I find myself puzzled about the meaning for weapon SetMaxSecondaryStat since it only seems to apply to base values and not upgrades).

It also seems to me we should keep in mind that all this same reasoning will likely apply to Fighter Hangar capacity if we were to add some way to upgrade that.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: Fuel parts auto upgrade

#23 Post by Ophiuchus »

Dilvish wrote:It also seems to me we should keep in mind that all this same reasoning will likely apply to Fighter Hangar capacity if we were to add some way to upgrade that.
Would it be possible to remember the last time a ship got upgraded and the turn a technology was research?
Then one could write a generic macro for checking if an supply-based upgrade should happen.
You would not need an extra meter for each part type.

I mean like:
  • I build a ship in turn 10 - its upgrade turn is 10
  • In turn 15 i research a weapon upgrade
  • In turn 20 i research deuterium tanks
  • In turn 15 to 22 the ship is not in supply range. The fuel max and the weapon damage stays where it is.
  • Ship comes back to supply in turn 23 - fuel capacity and weapon damage gets boosted, upgrade turn is 23
  • In turn 23 to 29, the upgrade turn is higher than turn 20 when deuterium tanks were researched, so no further boost.
  • In turn 30 i research antimatter tanks.
  • The upgrade turn is lower than 30, so the antimatter tank boost applies. The upgrade turn is set to 30.
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
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Fuel parts auto upgrade

#24 Post by Geoff the Medio »

Dilvish wrote:I'll grant that MaxMaxSomething is a not-so-appealing kind of name, but that seems hardly significant, and besides, couldn't we avoid that by just renaming MaxFuel as FuelCapacity, and then our new meter would be MaxFuelCapacity?
The point isn't the names, but the (to me) excessive number of meters to track (debatably) one thing. With weapons, it works nicely, in that there aren't many ways to increase current weapon strength without being in supply, so that getting the benefit of upgrades naturally happens when in supply range, and the actual value of the max meter for the weapon strength doesn't matter. If fuel is in practice different, and players are often getting increases to fuel while not in supply range, then to me the solution is to accept that and to either not upgrade fuel parts in that manner (previous or existing behaviour), or to phrase the description of how it works differently (and not to add another meter and associated support code to replicate the behaviour that happened automatically for a different part type).
And regarding the bit about adding the extra meter and dealing with using it, well, I'm not seeing the notable difference between that versus the meter you added for upgrading weapons.
It's not objectionable to me to add a max meter to something that doesn't have one, because there are already many cases in which there are current and max meters that work together in the existing game mechanics. To me, it's a choice between whether something just has an current value (eg. detection) or has separately tracked current and (max or target) meters. It's not just a trivial distinction either, as there are various cases in the code or UI that work with two paired meters or a single meter, but which aren't set up to also know what to do with three related meters.
It also seems to me we should keep in mind that all this same reasoning will likely apply to Fighter Hangar capacity if we were to add some way to upgrade that.
Hangar capacity should work just like other current/max meter pairs, similar to weapon strength. As long as ships aren't generating fighters when out of supply, then the existing game mechanics will work for getting upgrades by only replacing lost fighters when in the same situations that should, to a player, result in getting the benefits of upgrades... "Getting an upgrade" and "replenishing fighters" are effectively the same thing.
...looking through the scripts I find myself puzzled about the meaning for weapon SetMaxSecondaryStat since it only seems to apply to base values and not upgrades...
The part secondary stats have max and current values so that the standard upgrade mechanics can be applied to them if desired. I set up the engine to support this, so that any current or future parts (eg. Flak Cannon) that make use of a secondary stat to determine their behaviour would be possible to upgrade when in supply range.

User avatar
em3
Vacuum Dragon
Posts: 630
Joined: Sun Sep 25, 2011 2:51 pm

Re: Fuel parts auto upgrade

#25 Post by em3 »

Geoff the Medio wrote: Hangar capacity should work just like other current/max meter pairs, similar to weapon strength. As long as ships aren't generating fighters when out of supply, then the existing game mechanics will work for getting upgrades by only replacing lost fighters when in the same situations that should, to a player, result in getting the benefits of upgrades... "Getting an upgrade" and "replenishing fighters" are effectively the same thing.
It's a bit ironic, that I was considering learning focs by creating a core slot fighter factory.
https://github.com/mmoderau
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556

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

Re: Fuel parts auto upgrade

#26 Post by Geoff the Medio »

Ophiuchus wrote:Would it be possible to remember the last time a ship got upgraded and the turn a technology was research?
Is there a difference between when a ship is in range to be resupplied and to be upgraded? In particular, when in allied vs its own supply network, or allied but not actually join through adjacency to its own? Or more so should there be?

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Fuel parts auto upgrade

#27 Post by MatGB »

em3 wrote:
Geoff the Medio wrote: Hangar capacity should work just like other current/max meter pairs, similar to weapon strength. As long as ships aren't generating fighters when out of supply, then the existing game mechanics will work for getting upgrades by only replacing lost fighters when in the same situations that should, to a player, result in getting the benefits of upgrades... "Getting an upgrade" and "replenishing fighters" are effectively the same thing.
It's a bit ironic, that I was considering learning focs by creating a core slot fighter factory.
Core slots are allowed to break the rules, IIRC if you're out of supply and get an increase in current capacity you'd do so at the current rate until/unless you get back into supply.

Having said that, I suspect it'd be a more complex script than you'd expect, a cool idea but possibly for your second thing not to learn with? ;-)

(seriously, we need to add more core slots, we need to do more with fighters than just have them, and I'd happily playtest that idea: if CPO Tyrell can build fighters in his spare time in BSG then a galaxy spanning empire should be able to).
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

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

Re: Fuel parts auto upgrade

#28 Post by Ophiuchus »

Geoff the Medio wrote:
Ophiuchus wrote:Would it be possible to remember the last time a ship got upgraded and the turn a technology was research?
Is there a difference between when a ship is in range to be resupplied and to be upgraded? In particular, when in allied vs its own supply network, or allied but not actually join through adjacency to its own? Or more so should there be?
Ah. Funky stuff. I think there could/should be a difference. So we maybe should define that differently. If I could get it free I would vote for:
For upgrading the ship must be directly or indirectly (via allied supply lines) supply-line connected to your empire.
Maybe it could be more specific and a connection to one of your shipyards is necessary.
Maybe even certain parts need to be connected to certain buildings/specials.
Not sure how implementation should work in an efficient way there.
But is it necessary to figure that out right now? Having any kind of (allied) supply connection is a useful restriction in itself i think.

Was your post a general idea or an answer to my post?
My post was about tracking the turn of the last upgrade.
I don't think we should track the turn of the the last resupply.
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
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Fuel parts auto upgrade

#29 Post by Dilvish »

Seems to me that tracking the turn of last resupply (along with tracking what turn techs were acquired on) is the route with most promise to simplify things. Upgrade techs would apply to all ships whose last resupply turn was on or after the turn that the upgrade tech was acquired on. At first glance at least it seems to me that would let us avoid the MaxMaxSomething kind of meters, but I'll confess I haven't taken enough time to fully review meters & max meters, etc.
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
em3
Vacuum Dragon
Posts: 630
Joined: Sun Sep 25, 2011 2:51 pm

Re: Fuel parts auto upgrade

#30 Post by em3 »

Dilvish wrote:Seems to me that tracking the turn of last resupply (along with tracking what turn techs were acquired on) is the route with most promise to simplify things. Upgrade techs would apply to all ships whose last resupply turn was on or after the turn that the upgrade tech was acquired on. At first glance at least it seems to me that would let us avoid the MaxMaxSomething kind of meters, but I'll confess I haven't taken enough time to fully review meters & max meters, etc.
On the other hand the MaxSomething and MaxMaxSomething wil give a good visual cue, that the ship needs retrofitting in supply zone. Especially, if accounting label for the max something would include the upgrade, but the current value would not (until upgraded in supply).
https://github.com/mmoderau
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556

Post Reply