Military Strength Graph - undervaluing large weak stacks

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderator: Oberlus

Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Post Reply
Message
Author
User avatar
alleryn
Space Dragon
Posts: 259
Joined: Sun Nov 19, 2017 6:32 pm

Military Strength Graph - undervaluing large weak stacks

#1 Post by alleryn »

Code: Select all

Statistic name = "MILITARY_STRENGTH_STAT" value =
Statistic Sum value = (LocalCandidate.Attack * (LocalCandidate.Structure + 2 * LocalCandidate.MaxShield))
Ignoring shields, wouldn't Sum(Attack)*Sum(Structure) be a better approximation of military might than Sum(Attack*Structure)?

I mean twenty 5attack 5structure ships is more closely equivalent to ten 10attack 10structure ships than to five 10attack 10 structure ships, isn't it?

It seems like this statistic is currently undervaluing large stacks of weak ships (or, contrapositively, overvaluing small stacks of strong ships).

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

Re: Military Strength Graph - undervaluing large weak stacks

#2 Post by Dilvish »

alleryn wrote:Ignoring shields, wouldn't Sum(Attack)*Sum(Structure) be a better approximation of military might than Sum(Attack*Structure)?... It seems like this statistic is currently undervaluing large stacks of weak ships.
The current statistic is more of an assessment of the force an empire can distribute across its territory; it does undervalue all stacks. Coding it up in the way you suggest could be valid for considering the forces as a single stack, and would be useful for the purpose of assessing what is the max combat value an empire could have defending a single planet, like their home planet, but I don't really think that assessment is more valuable/interesting than the current one. But you can of course change it on your machine however you prefer it, or simply add a new statistic.

What might be even more interesting, I think, would be a sum across systems of sum_attack_in_system*_sum_structure_in_system, which would be a better assessment of total strength as currently deployed. I'm not quite 100% sure that is currently possible to script up, but I am inclined to think it is. It would be important to read up on the significance of RootCandidate and LocalCandidate, and our Scripting Details Subsection on Statistics unfortunately only gives the barest of summaries, without syntax for it, so you'd have to dig through the parser code or look for existing examples to figure out the syntax (and then a proposed revision for the above subsection would be much appreciated).
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
alleryn
Space Dragon
Posts: 259
Joined: Sun Nov 19, 2017 6:32 pm

Re: Military Strength Graph - undervaluing large weak stacks

#3 Post by alleryn »

Dilvish wrote:The current statistic is more of an assessment of the force an empire can distribute across its territory; it does undervalue all stacks. Coding it up in the way you suggest could be valid for considering the forces as a single stack, and would be useful for the purpose of assessing what is the max combat value an empire could have defending a single planet, like their home planet, but I don't really think that assessment is more valuable/interesting than the current one.
I'm not sure i understand this logic. 1/5 of the fleet is 1/5 of the fleet no matter how big the original fleet is.

If 20 5-5 (attack-structure) ships are roughly equivalent to 10 10-10 ships, i don't see how asking each fleet to defend, say, 5 star systems affects their relative strengths.

4 5-5 ships are roughly equivalent to 2 10-10 ships.

Edit: In any case, i just happened across this code snippet while i was looking for something else, and thought the formula might be a simple order-of-operations oversight. As long as it's intended to be that way, i'm happy with it.

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

Re: Military Strength Graph - undervaluing large weak stacks

#4 Post by Oberlus »

After reading this I thought for a moment "Now I understand!", but no.

And I mean to understand what happens to that statistic when the most current situation in my games arises: I have fewer stronger ships in a single stack attacking the biggest stack of my enemy (usually I have robos with 5 shields and top lassers while they have robos with 3 shields and mass or suboptimal lassers if I had a good ind./bad research species, or I'll have self-grav. hulls with shields 5 or 9 and top plasma against robos or asteroid huls with shields 3 or 5 and top lassers if playing a good research species). Before the attack, the statistic will show that my enemy has 3-5x times my military strength (total), and after the attack I will lose around 25% of my fleet (and 25% of the statistic) while the enemy will lose all its stack and around 80% of their military strength statistic, so that my military strength will be higher than the enemies.

So it is the opposite of I have thought. It is like fewer, stronger ships are undervaluated by that statistic, despite the formula appearing to the the opposite.

I don't understand.

User avatar
Krikkitone
Creative Contributor
Posts: 1559
Joined: Sat Sep 13, 2003 6:52 pm

Re: Military Strength Graph - undervaluing large weak stacks

#5 Post by Krikkitone »

Oberlus wrote:After reading this I thought for a moment "Now I understand!", but no.

And I mean to understand what happens to that statistic when the most current situation in my games arises: I have fewer stronger ships in a single stack attacking the biggest stack of my enemy (usually I have robos with 5 shields and top lassers while they have robos with 3 shields and mass or suboptimal lassers if I had a good ind./bad research species, or I'll have self-grav. hulls with shields 5 or 9 and top plasma against robos or asteroid huls with shields 3 or 5 and top lassers if playing a good research species). Before the attack, the statistic will show that my enemy has 3-5x times my military strength (total), and after the attack I will lose around 25% of my fleet (and 25% of the statistic) while the enemy will lose all its stack and around 80% of their military strength statistic, so that my military strength will be higher than the enemies.

So it is the opposite of I have thought. It is like fewer, stronger ships are undervaluated by that statistic, despite the formula appearing to the the opposite.

I don't understand.
Shields specifically mess with the calculations by subtracting some of the enemies effective attack capability.

And sum Attack * sum Structure would be a better representation of total fleet strength

(of course that means if you use 1/5 of your fleet, you are only using 1/25 of your total possible strength)

User avatar
alleryn
Space Dragon
Posts: 259
Joined: Sun Nov 19, 2017 6:32 pm

Re: Military Strength Graph - undervaluing large weak stacks

#6 Post by alleryn »

Oberlus wrote:(usually I have robos with 5 shields and top lassers while they have robos with 3 shields and mass or suboptimal lassers if I had a good ind./bad research species, or I'll have self-grav. hulls with shields 5 or 9 and top plasma against robos or asteroid huls with shields 3 or 5 and top lassers if playing a good research species)
It's hard to properly valuate shields, since their worth depends on the enemy's weapon tech. If you have class 5 shield against mass drivers, the shields will be extremely undervalued [and are probably undervalued in general... they're only counting for 2*(shield strength) worth of structure...personally i don't see a lot of ships destroyed in only 2-3 hits].

Post Reply