FreeOrion

Forums for the FreeOrion project
It is currently Thu Dec 14, 2017 8:40 pm

All times are UTC


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 new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sun Nov 26, 2017 7:47 pm 
Offline
Space Squid
User avatar

Joined: Sun Nov 19, 2017 6:32 pm
Posts: 82
Code:
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).


Top
 Profile  
 
PostPosted: Sun Nov 26, 2017 9:07 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
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


Top
 Profile  
 
PostPosted: Sun Nov 26, 2017 10:32 pm 
Offline
Space Squid
User avatar

Joined: Sun Nov 19, 2017 6:32 pm
Posts: 82
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.


Top
 Profile  
 
PostPosted: Mon Dec 04, 2017 5:11 pm 
Offline
Space Dragon
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 253
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.


Top
 Profile  
 
PostPosted: Thu Dec 07, 2017 1:43 am 
Offline
Creative Contributor
User avatar

Joined: Sat Sep 13, 2003 6:52 pm
Posts: 1396
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)


Top
 Profile  
 
PostPosted: Thu Dec 07, 2017 7:28 pm 
Offline
Space Squid
User avatar

Joined: Sun Nov 19, 2017 6:32 pm
Posts: 82
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].


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group