Measuring efficiency of ship designs

For topics that do not fit in another sub-forum.

Moderators: Oberlus, Oberlus

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

Measuring efficiency of ship designs

#1 Post by Ophiuchus » Sun Sep 01, 2019 10:25 am

EDIT (Oberlus): That quote from Morlic in the thread about new fuel settings opened an (still ongoing) discussion about measuring efficiency of ship designs, efficiency in the sense of oh much PP they cost and how good are at killing and surviving other kills. I'm moving that part of the discussion to this dedicated thread.

Morlic wrote:
Thu Aug 29, 2019 1:47 pm
Removing another external slot from the robotic hull (i.e 3 external slots) pushes the cost-efficiency of the shielded robotic hulls below the cost efficiency of shielded organic hulls after

* Using the definition cost_efficiency = (structure*damage)/cost^2
I think that cost_efficiency formula is not a good model.

If you calculate the damage a ship does before being taken out, organic ships with shields still are about 30% more expensive than robo shields (only checked for a single weapon but this should be the best case for organic ships with shields i guess as armour evens out the structure advantage of the robos).

(max_hits_of_survival*number_of_external_slots)/cost
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

Morlic
AI Contributor
Posts: 285
Joined: Tue Feb 17, 2015 11:54 am

Re: New Fuel Settings?

#2 Post by Morlic » Sun Sep 01, 2019 11:16 am

Why do you think that is not a good formula for cost efficiency?

(max_hits_of_survival*number_of_external_slots)/cost
1) Number of external slots is a very weird parameter to choose - it does nonlinearly contribute to "max_hits_of_survival" and does (due to cost and hull structure favoring different number of weapon slots) nonlinearly contribute to damage.
2) Weighing cost linearly seems weird. In first order approximation, fleet power scales quadratically with number of ships (twice the damage and twice the survivability = 4 times the power).
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: 1040
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: New Fuel Settings?

#3 Post by Ophiuchus » Mon Sep 02, 2019 11:02 am

Oberlus wrote:
Thu Aug 29, 2019 7:08 am
Ophiuchus wrote:
Wed Aug 28, 2019 9:00 pm
is a huge scout jump range bad for gameplay?
In small maps it means you'll know the whole map very fast, so the exploration part of the game ends quite soon. Some could see that as bad.

The reverse question, is it bad for gameplay to have scouts with 5 or 6 fuel?
That depends what you want to achieve. I certainly think that having scouts available with more jump range than outpost/colony ships is good for gameplay. I think it is good for gameplay if you are able to pass by your early neighbors to find out what is in their back.

See why I started the change: i played stellaris and thought i really really dont miss that scouting minidecisions in freeorion (should i return and rescout? or should i go deep space and get possibly stranded, always hoping for that freaky refuel event? Should i scrap this scout and build a new one or wait ten turns for the next hop? Ok i want to wait for refuel, should i keep some fuel in order to evade travelling monsters?). In stellaris there is no fuel until nobody kills you along the way you can go to the other end of the galaxy.
From that experience i do not really see a reason to restrict scouting by fuel.

But for strategic combat our supply line networks should matter (and fuel is the ugly little brother extending these in unsupplied space). So the increase in fuel for starting scouts and the decrease for the big hitters.
Oberlus wrote:
Thu Aug 29, 2019 7:08 am
Ophiuchus wrote:
Wed Aug 28, 2019 9:00 pm
It maybe even make sense to build small hull war ships for hunting and perimeter control.
4 hops away from your perimeter (and back) is quite a perimeter control.
Not sure I read you. We are talking small hull here. Even death ray small hulls can be cheaply wiped out with beginner tech. But you could deny your enemies knowledge of juicy targets or threaten outpost/colony ships to return
Oberlus wrote:
Thu Aug 29, 2019 7:08 am
Ophiuchus wrote:
Wed Aug 28, 2019 9:00 pm
The introduced changes are big because nobody could feel a difference in fuel in gameplay.
Hehe... Or because no body (aside from you) tested it?
You misunderstood. Nobody really felt a difference between hulls for fuel before that change.

And as you know I use all the feedback I get from the community. I also think nobody playtested, so it seems the only way to get feedback actually is the merge into master. So finally I am happily getting community feedback :)
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

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

Re: New Fuel Settings?

#4 Post by Ophiuchus » Mon Sep 02, 2019 11:24 am

Morlic wrote:
Sun Sep 01, 2019 11:16 am
(max_hits_of_survival*number_of_external_slots)/cost
1) Number of external slots is a very weird parameter to choose
Sigh. Badly worded. I meant the number of installed weapons (== the number of free external slots after adding fuel/shields).
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

Morlic
AI Contributor
Posts: 285
Joined: Tue Feb 17, 2015 11:54 am

Re: New Fuel Settings?

#5 Post by Morlic » Mon Sep 02, 2019 6:51 pm

Ophiuchus wrote:
Mon Sep 02, 2019 11:24 am
Sigh. Badly worded. I meant the number of installed weapons (== the number of free external slots after adding fuel/shields).
Assuming you mean armor parts (as both fuel and shields go into the internal slot), it is clear to me now what your formula intends to achieve.

"number of weapon slots" is proportional to total damage and thus functionally equivalent if you are restricted to a single weapon part. In current balancing of FreeOrion, more expensive weapons are also more cost-efficient. So all hulls mostly want to mount the best available weapon. However, if you change the balancing so that more expensive weapons are less cost efficient (but are more slot efficient), then the choice of weapon depends on the hull cost, hull structure and number of slots. Consequently, simply counting the number of weapon slots no longer works as an accurate metric (as the used slots are worth more or less depending on the hull). The damage metric does intrinsically account for this.

The other question is how do you determine "max_hits_of_survival". Obviously, this heavily depends on the enemy weapon damage you are facing. If you model against a particular known enemy with known damage and only a single damage value, then your metric is great and more precise than structure. However, how do you determine that value if you have a mix of weapon damage? Say, the enemy uses both newer laser ships and older Mass Driver designs. Also, there are a few fighters mixed in.

So, ignoring shields for now, it seems natural to go with the structure of the ship as the heuristic - the "max hits of survival" is proportional to the structure (with a constant factor that cancels when comparing designs). Obviously, working with integers means your 1.9 hits you can take are effectively the same as 1.1 hits and against a certain (after shields) weapon damage, there will be optimum values of structure that minimize the overhead.
However, with the introduction of fighters with many small points of damage, the decimal point does matter.


The issue with cost efficiency still stands:
Your formula implies that design B with half the structure but half the price as design A has the same cost efficiency.
If you now build 2 ships of that design B, you get a total structure (or "max hit of survival") and cost equal to design A. However, you have twice the weapon slots available.
So, looking at your fleet, it is more cost efficient to go with two ships of design B. Which means that the design A and B do have not the same cost efficiency. Which means the formula doesn't really work as intended.
Alternative to taking cost squared is taking square root of the numerator. Depends what you want to express.
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: 1040
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: New Fuel Settings?

#6 Post by Ophiuchus » Mon Sep 02, 2019 9:39 pm

Morlic wrote:
Mon Sep 02, 2019 6:51 pm
...it is clear to me now what your formula intends to achieve.
... Which means the formula doesn't really work as intended.
Alternative to taking cost squared is taking square root of the numerator. Depends what you want to express.
Yes, thank you for correcting me. I will crunch the numbers again. Squares are also fine to me.

My feeling that structure is not sufficient is coming more the experience that calculating the beating your ships can stand helps predicting losses. Using this in design and choosing your battles keeps losses down tremendously.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

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

Re: New Fuel Settings?

#7 Post by Ophiuchus » Wed Sep 04, 2019 10:55 pm

So I took your advice and used cost squared. As now the cost is not linear anymore i also had to factor in weapon damage and cost.

So my formula is basically yours, but using the number of hits the ship may take without dying instead of simple structure.

cost_efficiency_survival == weapon_damage * max_hits_survival / cost / cost

max_hits_survival == hits_to_death - 1

hits_to_death = CEILING(structure / (enemy_weapon_damage - shields))

And the results actually differ quite. Lets call the robo hull with only three external slots but 3 fuel ROBO3E

Comparing organic ship with shield 3, one zortrium armour and two Lasers with ROBO3E with shield 3 and three Lasers:

cost_efficiency: Organic baby 2,9%/ 15 turn 3,4% / 25 turns 3,8% grows to be better than the ROBO3E 3,2%

But if you use the cost_efficiency_survival metric which factors in survival:
  • Organic 25 turns 1,09% against MD6
  • ROBO3E 1,03% against MD6
  • Organic 25 turns 0,36% against L6
  • ROBO3E 0,39% against L6
So even if you let the organic ship mature, the nerfed robo hull is still more cost efficient, but only if your enemy already deploys Lasers.

Also interesting is that organic ships without shields have a much better cost_efficiency value than with shields (7,2% instead of 3,8%). But if you use my cost_efficiency_survival the organic shield variant is actually a bit more efficient (only 1,03% against MD6, only 0,34% against L6). Beware of ion storms and fighters!
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

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

Re: New Fuel Settings?

#8 Post by Ophiuchus » Sun Sep 08, 2019 1:06 pm

I was pondering a while why it should be exactly cost squared in the numerator. So the base i think is the scaling of value/efficiency if you split your PP between ships.

So it is easy to see that it does not matter much if you have ten Lasers on one ship or ten ships with each on laser as long as those ships stay in combat. And having double the weapons also means double the value (as long as you dont run out of enemies). How long a ship/weapon stays in combat depends on its structure.

So ship value is about weapon_damage*structure; For the same cost efficiency one 20-structure/2x5 damage ship should cost about half of two 20-structure/1x5 damage ships. For the same cost efficiency one 40-structure/1x5 damage ship should cost about half of two 20-structure/1x5 damage ships. For the same cost efficiency one 40-structure/2x5 damage ship should cost about the same as two 20-structure/1x5 damage ships.

With structure it is almost like with weapons. But actually it is a bit more complicated. So if you have one ship with 20 structure this ship will be gone after 4 hits with MD34/L12 but if you have two ships with 10 structure each, you already could have 50% loss after 2 hits, with 50% loss certain with 3 hits and 100% loss with 4 hits. Splitting here seems definitly bad.

Best case for splitting would be eg 23 structure against MD4: single 23-struture-ship dead after 4 hits, one 13-structure-ships/one 10-structure ship maybe one loss after 2 hits, certain 50% loss after 4 hits, certain 100% loss after 5 hits. I think this is still worse than not splitting because you probably loose 50% of the damage capacity early. But this might depend a lot more on the combats you have to fight - splitting here soaks one more hit.

Also with our combat system in a single bout a ship might get overkilled (and soak more hits than its structure), so having an extra vessel on your side is always nice. But employing decoys or tanks might make more sense.


Edit: Looking at my spreadsheet i get some peculiar results. If i have a robo ship and i add a third laser the efficiency always drops - not using the slot seems to be more efficient. But in thruth I have 33% damage increase with unchanged structure and about 23% cost increase. So adding the third laser is efficient. So our metrics using squared price must be wrong(!)
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

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

Re: New Fuel Settings?

#9 Post by Ophiuchus » Sun Sep 08, 2019 2:55 pm

Ophiuchus wrote:
Mon Sep 02, 2019 11:24 am
Morlic wrote:
Sun Sep 01, 2019 11:16 am
(max_hits_of_survival*number_of_external_slots)/cost
1) Number of external slots is a very weird parameter to choose
Sigh. Badly worded. I meant the number of installed weapons (== the number of free external slots after adding fuel/shields).
Morlic wrote:
Mon Sep 02, 2019 6:51 pm
The issue with cost efficiency still stands:
Your formula implies that design B with half the structure but half the price as design A has the same cost efficiency.
If you now build 2 ships of that design B, you get a total structure (or "max hit of survival") and cost equal to design A. However, you have twice the weapon slots available.
So, looking at your fleet, it is more cost efficient to go with two ships of design B. Which means that the design A and B do have not the same cost efficiency. Which means the formula doesn't really work as intended.
Alternative to taking cost squared is taking square root of the numerator. Depends what you want to express.
Trying to get a feeling for this. So lets say
  • design A: 2 max_hits_of_survival, 1 number_of_installed_weapons, 10 PP cost --> 2 value; 0.2 cost efficiency
  • design B: 1 max_hits_of_survival, 1 number_of_installed_weapons, 5 PP cost --> 1 value; 0.2 cost efficiency
Now i let 5 A designs fight against 10 B designs (each fleet costs 50PP and all designs have same cost efficiency).
  • Bout 1: fleet A scores 5 hits, bringing down about 1 ship of fleet B, damaging 3. fleet B scores 10 hits, bringing down about 1 ships of A, damaging 3 twice and 1 once
  • Bout 2: fleet A scores 4 hits, bringing down about 2 ships of fleet B, two with damage. fleet B scores 9 hits, bringing down 3 A ships, leaving one with two damage
  • Bout 3: fleet A scores 1 hits, bringing down 0 ships of fleet B, three damaged. fleet B scores 7 hits, bringing the last ship
Easy win for B thanks to double the weapons; left with four intact and three damaged ships.

So lets double the survival
  • design A: 4 max_hits_of_survival, 1 number_of_installed_weapons, 10 PP cost --> 2 value; 0.4 cost efficiency
  • design B: 2 max_hits_of_survival, 1 number_of_installed_weapons, 5 PP cost --> 1 value; 0.4 cost efficiency
Now i let 5 A designs fight against 10 B designs (each fleet costs 50PP and all designs have same cost efficiency).
  • Bout 1: fleet A scores 5 hits: Fleet B: 1 damage 2, 2 damage 1, 7 damage 0. fleet B scores 10 hits: Fleet A: 1 damage 3, 3 damage 2, 1 damage 1
  • Bout 2: fleet A scores 5 hits: Fleet B: 1 destroyed, 2 damage 2, 3 damage 1, 4 damage 0. fleet B scores 10 hits: Fleet A: 1 destroyed, 3 damage 4, 1 damage 3
  • Bout 3: fleet A scores 4 hits: Fleet B: 2 destroyed, 3 damage 2, 3 damage 1, 2 damage 0. fleet B scores 9 hits: Fleet A: 4 destroyed, 1 damage 4, 0 damage 3
Again easy win for B. Fleet A can limp away with almost dead ship just because of pure luck in overkill. Fleet B looses only 2 ships, but has repairs to do.

edit 1: experimenting with the formula i got some promising values using squaring of weapon slots and squared cost (probably will not hold though)
edit 2: squaring weapon damage makes more sense and gives similar results

cost_efficiency_survival == weapon_damage * weapon_damage * max_hits_survival / cost / cost
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

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

Re: New Fuel Settings?

#10 Post by alleryn » Sun Sep 08, 2019 3:52 pm

Trying to get a feeling for this. So lets say
design A: 2 max_hits_of_survival, 1 number_of_installed_weapons, 10 PP cost --> 2 value; 0.2 cost efficiency
design B: 1 max_hits_of_survival, 1 number_of_installed_weapons, 5 PP cost --> 1 value; 0.2 cost efficiency
Now i let 5 A designs fight against 10 B designs (each fleet costs 50PP and all designs have same cost efficiency).
Bout 1: fleet A scores 5 hits, bringing down about 1 ship of fleet B, damaging 3. fleet B scores 10 hits, bringing down about 1 ships of A, damaging 3 twice and 1 once
Bout 2: fleet A scores 4 hits, bringing down about 2 ships of fleet B, two with damage. fleet B scores 9 hits, bringing down 3 A ships, leaving one with two damage
Bout 3: fleet A scores 1 hits, bringing down 0 ships of fleet B, three damaged. fleet B scores 7 hits, bringing the last ship
Can you explain where these numbers are coming from?
Like okay in Bout 1, I get fleet A scores 5 hits, and fleet B scores 10. But after that you lost me. For example, how do the 5 hits from fleet A bring down only 1 fleet B ship? If i were doing this, here's how my calculation would look for that entry:
5 hits from fleet A, 10 ships from fleet B each with " 1 hit point ".
First hit from fleet A takes out a ship from fleet B.
Second hit has a 10% chance to hit the already dead ship, 90 % chance to kill a second ship. So now fleet B is a superposition of ((.1 probabliity)*(9 ships) + (.9 probability) * (8 ships))
Chance of third hit scoring a kill and ships remaining = (.9 chance of scoring a kill against 9 ships) * .1 --> .09 8 ships
+ (.1 chance of no kill against 9 ships) * .1 --> .01 9 ships
+ (.2 chance of no kill against 8 ships) * .9 --> .18 8 ships
+ (.8 chance of kill against 8 ships) * .9 --> .72 7 ships
= .72 7 ships + .27 8 ships + .01 9 ships
And the calculation would continue, but we can already see that 99% of the time at least 2 ships would die in the first bout with 3 shots left to fire, so how you are guessing only 1 ship is brought down in that entire first bout, it seems off to me.

So could you explain how you are doing your approximation?


P.S. I must be entirely misunderstanding what you are doing, because you talk about fleet B's ships getting damaged, even though you said they only have 1 max_hits_of_survival... i guess i need to read some of the earlier posts in this thread more carefully.

Edit: Oh, i see max hits while still surviving so like n max_hits_survival is what i think of as (n+1) "hit points". Alright, need to rethink this; i'll get back to y'all.
Last edited by alleryn on Sun Sep 08, 2019 5:00 pm, edited 1 time in total.

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

Re: New Fuel Settings?

#11 Post by Ophiuchus » Sun Sep 08, 2019 4:38 pm

alleryn wrote:
Sun Sep 08, 2019 3:52 pm
So could you explain how you are doing your approximation?
Mostly gut feeling. Simulating rolling a die for every shot basically. Should not be too improbable.
alleryn wrote:
Sun Sep 08, 2019 3:52 pm
I must be entirely misunderstanding what you are doing, because you talk about fleet B's ships getting damaged, even though you said they only have 1 max_hits_of_survival... i guess i need to read some of the earlier posts in this thread more carefully.
max_hits_of_survival == 1 means you can be hit once and still survive
alleryn wrote:
Sun Sep 08, 2019 3:52 pm

Edit: Oh, i see max hits while still surviving so like n max_hits_survival is what i think of as (n+1) "hit points". Alright, need to rethink this; i'll get back to y'all.
Jip
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

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

Re: New Fuel Settings?

#12 Post by alleryn » Sun Sep 08, 2019 5:11 pm

Well it doesn't surprise me that fleet B is consistently winning. Have you tried adjusting your formula to use my "hit points" instead of your "max_hits_of_survival"?

I mean i see y'all've moved away from that approach, perhaps:
Morlic wrote:
Mon Sep 02, 2019 6:51 pm
So, ignoring shields for now, it seems natural to go with the structure of the ship as the heuristic - the "max hits of survival" is proportional to the structure (with a constant factor that cancels when comparing designs). Obviously, working with integers means your 1.9 hits you can take are effectively the same as 1.1 hits and against a certain (after shields) weapon damage, there will be optimum values of structure that minimize the overhead.
However, with the introduction of fighters with many small points of damage, the decimal point does matter.
But, with your current approach, you are valuing ships with 0 max_hits_of_survival (say 1 to 6 structure vs MD4) as having zero value, which seems intuitively wrong to me.

Edit: Just to elaborate a bit, my thinking is this:
For MD4 (6 damage):
* A ship with 7 structure is qualitatively better than a ship with 6 structure (on this i think everyone in the thread is in agreement). We shouldn't try to use structure as the parameter when valuing our ships because there is this discrete (non-continuous) nature of damage (which is offset somewhat by fighters, out of date ships, etc).
* My bone of contention is you are valuing ships like 1-6 struc value 0, 7-12 struc value 1, etc. Whereas to me i feel like it makes more sense to say 1-6 struc value 1, 7-12 struc, value 2, etc. Basically i'm just wondering why you decided to subtract 1.

In your two examples, when i look at them, i'm imagining 10 ships with 7 - 12 struc fighting 5 ships with 13 - 18 struc (120 structure vs 90 structure), and then 10 ships with 13-18 struc vs. 5 ships with 25-30 struc (180 structure vs 150 structure). It doesn't surprise me that the fleet with more overall structure is winning both times.

I'd be more interested in a comparison of 10 ships with 7-12 struc vs 5 ships with 19-24 struc. (Essentially 120 struc vs 120 struc). I'll put together a simulation later when i have a bit more time.

Cheers, i have been meaning to do this kind of analysis for a while (i've been relying on rudimentary dmg*structure/cost^2 valuation thus far), so i'm glad to see this discussion in motion.

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

Re: New Fuel Settings?

#13 Post by Ophiuchus » Sun Sep 08, 2019 8:26 pm

alleryn wrote:
Sun Sep 08, 2019 5:11 pm
Well it doesn't surprise me that fleet B is consistently winning. Have you tried adjusting your formula to use my "hit points" instead of your "max_hits_of_survival"?
Not yet. Just to make sure we are talking the same: is it correct to call your "hit points" "min_hits_to_die"?
alleryn wrote:
Sun Sep 08, 2019 5:11 pm
But, with your current approach, you are valuing ships with 0 max_hits_of_survival (say 1 to 6 structure vs MD4) as having zero value, which seems intuitively wrong to me.
It looks max_hits_of_survival is maybe only suited to estimate losses and the combined metric does not scale.

The main point for using "hit points" or similar in this discussion is that it allows to use a simpler model.

The main point for using "hit points" or similar in the model is that it factors in shield values.

The non-continuous nature I think is secondary/mostly more detailed. But our old formula is way off of reality i think. So we could also thinking about the fineprint later.
alleryn wrote:
Sun Sep 08, 2019 5:11 pm
Basically i'm just wondering why you decided to subtract 1.
If you want to know how much damage a ship can soak you should not subtract 1. If you want to know how much damage a ship can soak and still float you need to subtract 1.
alleryn wrote:
Sun Sep 08, 2019 5:11 pm
In your two examples, ..
Well said. If you look at the double structure example you have with mass drivers, 10 ships with 13 - 18 struc fighting 5 ships with 25 - 30 struc (180 structure vs 150 structure). That is about 20% more structure. I think adding that 20% more structure would not greatly shift the result. So while I think you are right that hit_points is better than max_hits_of_survival, i am pretty sure the battle will not be even.

The main point about damage vs structure we must answer should be rather:
How much structure do you have to add if you are fighting the double amount of ships/weapons to achieve the same level of damage? So in the examples: how much more structure do the 5er fleet's ships need in order to shot as many shots as the 10er fleet.

edit1: Not sure i got it right, trying a simple case i chose to let 4 ships with a single hit point each fight 2 ships and tried to find the structure for an even fight. It looks like the 2 ships need 4 hit points each to get even.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

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

Re: New Fuel Settings?

#14 Post by alleryn » Sun Sep 08, 2019 9:25 pm

Ophiuchus wrote:
Sun Sep 08, 2019 8:26 pm
Just to make sure we are talking the same: is it correct to call your "hit points" "min_hits_to_die"?
Yes, that is a better (more descriptive) name.

min_hits_to_die = max_hits_of_survival + 1 = CEILING( structure / (enemy_weapon_damage - shields) )

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

Re: New Fuel Settings?

#15 Post by alleryn » Sun Sep 08, 2019 9:59 pm

I guess, the first analysis i would be prone to do, is to determine the expected value of a battle between Fleet A {two ships with 1 min_hits_to_die and 1 weapons ea] vs. Fleet B [one ship with 2 min_hits_to_die and 2 weapons].
This is based on the premise that cost^2 = (weapons)*(min_hits_to_die), or in other words, that we should be building ships that maximize the value of (weapons)*(min_hits_to_die)/cost^2.

The reasoning for that formula is that if we double the cost of a single ship, we could instead double the size of the fleet (here we neglect ramp-up cost for fleet building, and some other factors). Doubling the size of the fleet, of course, doubles both it's total damage (# of weapons) and total structure -- here modeled by (min_hits_to_die) * (ship count). So if we double the size of the fleet we gain a factor of four in total strength (2x for offense and 2x for defense).

If we are trying to get the same effect from a single ship (or rather by improving each ship in the fleet, instead of making the fleet bigger) we need to either double both its structure (min_hits_to_die) and double its number of weapons OR multiply either structure or weapons by a factor of 4. This is where the square of cost in the formula comes from. Sorry if you've already been over this, i only skimmed the thread, but it can't hurt to mention this again, in any case.

Fleet A {two ships with 1 min_hits_to_die and 1 weapons ea] vs. Fleet B [one ship with 2 min_hits_to_die and 2 weapons]
Bout one:
Fleet A lands two hits, killing Fleet B.
Fleet B lands two hits. One ship in Fleet A dies, Second shot has 50% chance to kill the second ship in Fleet A.
Expected value: Fleet A 75% losses, Fleet B 100% losses.

Will continue analysis later! Sorry if i'm going too slow or anything with my analysis. I think you've been thinking about this a while longer. I will just say what i'm thinking, but feel free to ignore it if you are already beyond this :)

Ultimately would like us to be able to answer your question
How much structure do you have to add if you are fighting the double amount of ships/weapons to achieve the same level of damage? So in the examples: how much more structure do the 5er fleet's ships need in order to shot as many shots as the 10er fleet.
Edit 1: Corrected 50% --> 75% in expected value above.

Edit 2: Next i'd like to take a look at what happens if we increase the size of both fleets by a factor of, say, 100.

Fleet C [200 ships with 1 min_hits_to_die and 1 weapons ea] vs Fleet D [100 ships with 2 min_hits_to_die and 2 weapons ea]

Bout One:

Fleet D lands 200 hits. (I'm starting with Fleet D's hits on Fleet C because that seems like an easier calculation). For each ship is Fleet C, its chance of survival is (chance of a given shot hitting some other ship)^(number of hits) = (199/200)^200 = .367 = 36.7%. The other 63.3% of Fleet C is destroyed in Bout One. So the expected value of ships left in fleet C after bout 1 is 200*.367 = 73.4.

Fleet C lands 200 hits. The chance of a Fleet D ship taking no hits can be calculated similarly to our last calculation: P_0 = (99/100)^200 = .134 = 13.4%

Now we will calculate the chance of a Fleet D ship taking exactly one hit:
P_1 = (number of shots)*(chance of that shot hitting)*(chance of every other shot missing) = 200 * (1/100) * [ (99/100)^199 ] = .271 = 27.1%.

The remaining 59.5% of Fleet D is destroyed in Bout One.

Bout Two (If I was being more rigorous i should really carry the whole probability distribution through to this step, but i'll just see what happens to the expected value case, at least for now):
Fleet C [73 ships with 1 min_hits_to_die and 1 weapons ea] vs Fleet D [13 ships with 2 min_hits_to_die and 2 weapons ea + 27 ships with 1 min_hit_to_die and 2 weapons ea]

Fleet C takes 80 hits. Chance to survive = (72/73)^80 = .332 = 33.2%. Total survivors = .332 * 73 ~= 24

Fleet D receives 73 hits. For the 27 ships that only have 1 min_hit_to_die left, chance of survival is (39/40)^73 = .158 = 15.8%, leaving .158 * 27 ~= 4 ships left of these 27.

For the other 13 ships, we get 13 * P_0 = (39/40)^73 * 13 ~= 2 ships with 2 min_hits_left_to_die

and P_1 = 73 * (1/40) * [ (39/40)^72 ] = .295 chance of taking exactly 1 hit, leaving another .295*13 ~= 4 ships with 1 min_hits_left_to_die from the group of 13.

Bout Three:
Fleet C [24 ships with 1 min_hits_to_die and 1 weapons ea] vs Fleet D [2 ships with 2 min_hits_to_die and 2 weapons ea + 8 ships with 1 min_hit_to_die and 2 weapons ea]

Fleet C survivors: 24 * [ (23/24)^20 ] ~= 10
Fleet D: injured ships surviving: 8 * [ (9/10)^24 ] ~= 1
uninjured ships unhit: 2 * P_0 = 2 * [ (9/10)^24 ] ~= 0
uninjured ships surviving with one min_hit_to_die: 2 * P_1 = 2 * [ 24 * (1/10) * [ (9/10)^23 ] ~=0

Final results : 10 ships from Fleet C survive (95% losses), 1 ship from Fleet D survives with 1 min_hit_to_die (99% losses)

Phew! I doubt i made it through all that without errors. I'll try to look through it again later, or maybe dig up my old college combinatorics textbook and try to remember how power series work or something, lol!

Post Reply