related, some extensions, from stealth discussion
Ophiuchus wrote: ↑Wed Feb 03, 2021 8:33 am
Anvil wrote: ↑Tue Feb 02, 2021 9:09 pm
Stealthy planets...: Instead of seeing nothing, potential attackers could see a shield that is preventing them from landing their troops. They see nothing else, especially not where to fire their weapons to disable the shield. .... Without further information however it is risky: Landing troops on an empty planet, you'll lose the troops, while you'll lose an outpost landed on a populated planet.
I definitly like the option of landing troops without knowing how many opponents there are. This might also give rise to multi-turn troop landings (because you do not want to send in a huge amount of troops if it is not necessary. We were also thinking of allowing landing troops through shields (with e.g. four times the losses). So with low detection you might send your troops through shields without knowing. At a higher detection you might be able to sense the shields but not know how many troops are waiting for you. Probably you should be able to attack the shields though (or maybe the next gradual detection level). Defense could also be introduced gradually. So maybe you can take the shields out, but not the defense because you cant see it - and in order not to be shot at all the time you land your troops without exactly knowing how much resistence is there.
...
there is also the UI issue (already considered in the PR), that the automatic invasion button chooses an appropiate amount of ships necessary for invasion.
with stealthed/unknown shields value the calculated troop amount for successful invasion would be completely wrong. but i guess that is OK. One could have the UI option to overcommit (e.g. after pressing invasion, you can press another time to over-commit troops for an expected unknown shield value). Another idea would be to change the you-loose-all-invading-troops mechanic to overcommitted-troops-survive (so sending less than all of your troop ships would make only sense to set an upper bound for losses).
Also should the UI expect a certain default level of shields for an enemy empire based on tech (and what is known about the planet), even if it is not detectable.
with hidden defense troop strength calculated troop amount for successful invasion would be also completely wrong, so some UI mechanism for "overcommit" would be necessary. the same logics like for stealthed shields apply here; e.g. overcommitted-troops-survive might make some sense. Maybe some drop down next to the invasion button to choose the amount of troops you commit.
Note also that there are a lot of small decisions regarding info leakage here which significantly affect invasion work flow. E.g. does invasion through shields leak the shield level (e.g. could one invade with a single troop to figure it out shield strength?; i'd say lets not tell how many defenders were destroyed in order to prohibit leakage), does invasion leak the number of hidden defense troops (same as with shield level; probably not)
but those are extensions, and i would like to see the invasion through shields with higher losses more than those.
in the PR the most important part is the effectiveness calculation; i would like to discuss it
Code: Select all
float Ship::TroopCapacityAgainstShields(float against_shields) const
{ return TroopCapacity() / (1.0f + std::log(std::max(1.0f, against_shields + 1.0f))); }
Side note: not sure why the std::max is necessary, makes sense for negative shield strength, lets ignore it here
so Troops(shields) = Troops / ( 1 + log(shields + 1))
some data points: Troops(0) = Troops; Troops(9) = Troops/2; Troops(99) = Troops/3; Troops(999) = Troops/4
if taking absolute shields, i think a multiplicative factor makes sense, making shield effectiveness diminish makes also sense (logarithm is convenient). even power balance might work (i think the standard shields are 80 (-> 0.344 troops), 240 (-> 0.296),..) .
As alternative there could be the difference between the maximum shields and current shields. E.g. Troops(full shields) = Troops/4; Troops(50% shields) = Troops/2, Troops(0%) shields: Troops.
So a closed formula would be similar to Troops(max_shields, cur_shields) = Troops - (Troops * cur_shields / max_shields * 3.0 / 4.0)
but i would probably defining this in steps:
E.g. Troops(80%-100% shields) = Troops/5; Troops(40%-80% shields) = Troops / 4, Troops(20%-40% shields) = Troops / 3, Troops(10%-20% shields) = Troops/2, Troops(0%-10%) shields: Troops.
Or Troops(75%-100% shields) = Troops/4; Troops(50%-74% shields) = Troops / 3, Troops(25%-49% shields) = Troops / 2, Troops(0%-24% shields) = Troops.
This would of course ignore shield strength, rather be based on integrity. A higher shield strength would only make it harder to diminish the shields, bringing it down to a more acceptable level of losses.
With hidden shields, the effective strength would "always" be minimal (Troops/4). That is if your the shield is not currently upgrading.
So pros/cons for the integrity-based approach as I see it:
- ++ worst case amount much easier to predict and reason about (it is the same multiplier for the whole game)
- + in a step-wise formula one can choose simple troop multipliers (e.g. 1/4, 1/2) instead of some inbetween values (e.g. 0.296, 0.344)
- o upgrading shield tech will for a while lower the defense against invasion-through-shields
- - no good closed formula (yet); stepwise formula is arbitrary
- - better shield tech might take longer to build defense against invasion-through-shields (this is maybe partly against the better-tech-never-means-worse-effects doctrine)
- -- probably overblown effects at low level (maxShield=1, shield=1 has the full effect)
i am torn on the alternatives; maybe geoffs formula could also made to be better. maybe there is a better suggestion
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!