ship part upgrading issue
Posted: Wed Sep 27, 2017 1:25 am
I opened a github Issue on this, and then decided it probably merits a design discussion here. The following is my post in the issue:
Ship part auto-upgrades take place via a two-step process. When an empire has researched a part upgrade tech, then that tech will increase the part's max-capacity meter during the regular meter updating process, wherever the ship is. The actual part capacity meter does not get increased until the next time that the ship is resupplied, which is something that takes place during the turn's movement phase, prior to combat. The result is that one can head into combat thinking that one's enemy's ships have a certain level of firepower, but instead they get upgraded just prior to combat. That can sometimes result in a surprise loss that had not looked possible. This is contrary to how we have generally aimed to handle the timing issues around meter updates and combat.
One possibility to deal with this could be to change this upgrade process. I think the current system was settled on both to constrain the upgrade to Supplied space, and to allow the upgrade to take place in one swoop, rather than having the part meter value slowly climb towards the max over the span of a few turns. An alternative could be to make them behave more like other max-meter increases, but with an increased regen rate akin to the boosted regen from Force-Energy Structures, high enough to let the increase take place in one turn. The trickier part would be constraining it to only take place in Supplied space, perhaps we'd need to add a last_turn_resupplied attribute for ships (and a corresponding ValueRef). And then we'd also need to figure out how to block the min 1-per-turn normal meter regen if not supplied.
Another possibility that comes to mind is to adjust the UI for the human player to show the upgraded values when it can reasonably predict that they would be about to be upgraded. I think it would be able to do this just fine for the majority of cases, and especially for the most important case which is when the enemy fleets are sitting still (clearly either supplied or not) and the player is making a decision about whether to attack them. We could also, at some point, code up some similar predictions for the AI to use.
Those are the ideas that come to mind for me-- any others?