Measuring efficiency of ship designs

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

Moderator: Oberlus

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

Re: New Fuel Settings?

#16 Post by Ophiuchus »

alleryn wrote: Sun Sep 08, 2019 9:59 pm 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 and also the examples indicate this square relation between fleets of different design with the same "value". (My combinatorics are also a bit shaky but I couldnt see an error in your reasoning.)

The problem with the formula is that is definitly wrong if you add extra weapons in a ship. If you have one weapon in one design (1W) and make the same design but add another weapon into an empty slot (2W), you double the combat value. The build cost goes up from (weapon_cost + other_cost) to (2*weapon_cost + other_cost).

So for 1W: (weapon_cost + other_cost)^2 = (weapons)*(min_hits_to_die)

So for 2W: (2 * weapon_cost + other_cost)^2 = (2 * weapons)*(min_hits_to_die)
  • (2 * weapon_cost + other_cost)^2 = (2 * weapons)*(min_hits_to_die)
  • (4*weapon_cost^2 + 4 * weapon_cost * other_cost + other_cost^2) = 2*(weapons)*(min_hits_to_die)
  • (weapon_cost^2 + 2 * weapon_cost * other_cost + other_cost^2) + (3 * weapon_cost^2 + 2 * weapon_cost * other_cost) = 2*(weapons)*(min_hits_to_die)
  • (weapon_cost + other_cost)^2 + (3 * weapon_cost^2 + 2 * weapon_cost * other_cost) = 2*(weapons)*(min_hits_to_die)
  • (weapon_cost + other_cost)^2 = 2*(weapons)*(min_hits_to_die) - (3 * weapon_cost^2 + 2 * weapon_cost * other_cost)
  • (weapons)*(min_hits_to_die) = 2*(weapons)*(min_hits_to_die) - (3 * weapon_cost^2 + 2 * weapon_cost * other_cost) # using 1W
  • (3 * weapon_cost^2 + 2 * weapon_cost * other_cost) = (weapons)*(min_hits_to_die)
Hm not to sure what that means actually :D :D

So making this easier by saying double value but double cost (i.e. same cost efficieny):
  • (2 * cost)^2 = (2 * weapons)*(min_hits_to_die)
  • 4 * cost^2 = 2 * (weapons)*(min_hits_to_die)
  • 2 * cost^2 = (weapons)*(min_hits_to_die)
So suddenly for the 2W case we have half the cost efficieny compared to the 1W case.
For our formula to work 1W and 2W should reduce each other which obviously they do not because we have squares instead of linearity.


If the formula would be linear: (cost) = (weapons)*(min_hits_to_die)

1WL: cost = (weapons)*(min_hits_to_die)

2WL: (2 * cost) = (2*weapons)*(min_hits_to_die)

this basically "works" (but the formula is wrong for scaling as we know).
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!

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

Re: New Fuel Settings?

#17 Post by alleryn »

I'm not 100% sure i was following what you were saying, but i think so.

If so, we have a slight misunderstanding (probably my fault -- i tried to explain it but not very well:
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.
)

I think what you are saying is that we can have one design with a weapon and an empty slot. If we add another weapon, we double it's "value" (how much we desire the ship, what we would be willing to pay for it), but we don't double it's actual cost.

The formula i was suggesting is actually
value^2 = (#_of_weapons)*(min_hits_to_die)
NOT (as i stated in error) cost^2 = (#_of_weapons)*(min_hits_to_die)

I don't expect the actual cost of a ship to double if we replace an empty slot with a second weapon, i expect it's value to change by a factor of
(new #_of_weapons)/(old #_of_weapons)*(new cost^-2)/(old cost^-2) = 2*[(old cost)/(new cost)]^2

In general i don't design warships with empty external slots, so in practice this amounts more to a tradeoff between structure (min_hits_to_die) and #_of_weapons, coupled with a tradeoff in costs.

Is that any more clear/did i correctly understand what you were getting at?

Edit: Flipped old cost and new cost (using -1 exponent)
Edit2: Remembered to square costs (changed -1 exponent to -2)

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

Re: New Fuel Settings?

#18 Post by Ophiuchus »

alleryn wrote: Mon Sep 09, 2019 2:09 pm I think what you are saying is that we can have one design with a weapon and an empty slot. If we add another weapon, we double it's "value" (how much we desire the ship, what we would be willing to pay for it), but we don't double it's actual cost.
Almost. The point was that the formula using squares gets the balance wrong for this case. If you calculate cost efficiency with it it will tell you that a ship with the same value/cost has a worse efficiency if it has more weapons.
And usually as the cost usually does not ~double, in reality cost efficiency should not be even but better for more weapons (as you said you always use all the free slots).
So I think the formula does cost estimation wrong inside a ship design although it does scaling between ship designs right (for the cases we looked at). I am not sure what is the right thing here.
alleryn wrote: Mon Sep 09, 2019 2:09 pm The formula i was suggesting is actually
value^2 = (#_of_weapons)*(min_hits_to_die)
NOT (as i stated in error) cost^2 = (#_of_weapons)*(min_hits_to_die)
So one would try to maximize sqrt((#_of_weapons)*(min_hits_to_die))/cost ? Which is the same maximization problem as (#_of_weapons)*(min_hits_to_die))/cost^2 right?
That formula has that problem.
alleryn wrote: Mon Sep 09, 2019 2:09 pm I don't expect the actual cost of a ship to double if we replace an empty slot with a second weapon, i expect it's value to change by a factor of
(new #_of_weapons)/(old #_of_weapons)*(new cost)/(old cost) = 2*(new cost)/(old cost)
? That formula does not make sense to me. The left side looks like the factor of value change. I am not sure what the right side of the formula is.
alleryn wrote: Mon Sep 09, 2019 2:09 pm Is that any more clear/did i correctly understand what you were getting at?
I think we are getting closer ;)
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!

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

Re: New Fuel Settings?

#19 Post by alleryn »

Ophiuchus wrote: Mon Sep 09, 2019 2:33 pm Almost. The point was that the formula using squares gets the balance wrong for this case. If you calculate cost efficiency with it it will tell you that a ship with the same value/cost has a worse efficiency if it has more weapons.
And usually as the cost usually does not ~double, in reality cost efficiency should not be even but better for more weapons (as you said you always use all the free slots).
So I think the formula does cost estimation wrong inside a ship design although it does scaling between ship designs right (for the cases we looked at). I am not sure what is the right thing here.
Hmm okay i do not understand. I will try to give a concrete example:

1a. I start with a basic medium hull and add one mass driver, leaving the other 2 slots empty. The cost of the ship happens to be 42.8 PP. It has 10 structure, and i'm expecting to go up against MD4, so i estimate it's min_hits_to_die as 2. I calculate

(#_of_weapons)*(min_hits_to_die)/cost^2 = 1*2/42.8^2 ~= .00109

1b. I consider adding a second weapon (still leaving the internal slot empty). This would change the cost from 42.8 PP to 64.2 PP (say). It still has 10 structure, so min_hits_to_die is still 2. I calculate

(#_of_weapons)*(min_hits_to_die)/cost^2 = 2*2/64.2^2 ~= .00097

which is less than .00109 so i conclude (correctly or incorrectly, after all this formula is a supposition whose validity i am attempting to ascertain by my continuing analysis of pitting imaginary fleets vs each other) that this model is less efficient than the model with one weapon. We've doubled the combat efficacy, but my formula predicts that the increase cost is too much. In other words i guess, based on my formula, that

642 ships with 1 weapon are going to outperform 428 ships with two weapons. (These two groups have equal PP costs).

That guess comes from the fact that the 642 ships can sustain 1284 hits while dishing out 642 shots, while the 428 ships can sustain 856 hits while dishing out 856 shots, and

1284*642>856*856 (this inequality is equivalent after some arithmetic to .00109>.00097, with slight rounding error from above).
So one would try to maximize sqrt((#_of_weapons)*(min_hits_to_die))/cost ? Which is the same maximization problem as (#_of_weapons)*(min_hits_to_die))/cost^2 right?
That formula has that problem.
Yes, that is my intention. I'm still not sure what the problem is (not that i dispute there is a problem).
I don't expect the actual cost of a ship to double if we replace an empty slot with a second weapon, i expect it's value to change by a factor of
(new #_of_weapons)/(old #_of_weapons)*(new cost)/(old cost) = 2*(new cost)/(old cost)

? That formula does not make sense to me. The left side looks like the factor of value change. I am not sure what the right side of the formula is.
I fixed both sides of the formula while you were writing the post. (Basically i forgot an exponent of -2 for the cost). To get from the left side to the right side i just took (new # of weapons)/(old # of weapons) --> 2 because the example i was doing was taking a ship with 1 weapon and an empty slot, and filling in the slot with a second weapon. I probably should have just left the generic quantities in there; i only made it more confusing by specifically saying 2 weapons vs. 1, i think.

I don't understand this:
Ophiuchus wrote: Mon Sep 09, 2019 1:36 pm The problem with the formula is that is definitly wrong if you add extra weapons in a ship. If you have one weapon in one design (1W) and make the same design but add another weapon into an empty slot (2W), you double the combat value. The build cost goes up from (weapon_cost + other_cost) to (2*weapon_cost + other_cost).

So for 1W: (weapon_cost + other_cost)^2 = (weapons)*(min_hits_to_die)

So for 2W: (2 * weapon_cost + other_cost)^2 = (2 * weapons)*(min_hits_to_die)
  • (2 * weapon_cost + other_cost)^2 = (2 * weapons)*(min_hits_to_die)
  • (4*weapon_cost^2 + 4 * weapon_cost * other_cost + other_cost^2) = 2*(weapons)*(min_hits_to_die)
  • (weapon_cost^2 + 2 * weapon_cost * other_cost + other_cost^2) + (3 * weapon_cost^2 + 2 * weapon_cost * other_cost) = 2*(weapons)*(min_hits_to_die)
  • (weapon_cost + other_cost)^2 + (3 * weapon_cost^2 + 2 * weapon_cost * other_cost) = 2*(weapons)*(min_hits_to_die)
  • (weapon_cost + other_cost)^2 = 2*(weapons)*(min_hits_to_die) - (3 * weapon_cost^2 + 2 * weapon_cost * other_cost)
  • (weapons)*(min_hits_to_die) = 2*(weapons)*(min_hits_to_die) - (3 * weapon_cost^2 + 2 * weapon_cost * other_cost) # using 1W
  • (3 * weapon_cost^2 + 2 * weapon_cost * other_cost) = (weapons)*(min_hits_to_die)
Can you break it down a little in words?

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

Re: New Fuel Settings?

#20 Post by Morlic »

It is straight forward to derive the quadratic cost scaling.

Problem:
Given x PP, what is the optimum way to build my fleet?

Answer:
total_value = total_damage*total_structure

I can build N(x) = (x/cost) ships which have (structure) and (damage) each.

total_value(x) = (N(x)*damage)*(N(x)*structure) = ((x/cost)*damage) * ((x/cost)*structure) = x^2 * damage*structure / cost^2

In other words, the total value always scales quadratically with the number of PP spent and the factor of proportionality is the design's "cost efficiency": damage*structure / cost^2.
The structure is immediately replacable with hits_until_death (not max_hits_of_survival as Alleryn already pointed out) if you have a good estimate of the expected damage per shot.



Note that, for a small number of N, we would have to actually take the discreteness of the problem into account again: If I have exactly 1000 PP i want to spend, it may be best to use "cost-inefficient" designs that actually use all the 1000 PP rather than cost-efficient designs which add up to 900. However, considering that in a real game the "available number of PP" changes over time and I could squeeze in a few more PP to build another ship, it does not make much sense to optimize for a certain number in the real world. We could also mix designs in a real world scenario. So let's just assume this is a continuous problem, i.e. x/cost >> 1.

If you actually do want consider an arbitrary cap but avoid the discreteness of the math and thus optimizing for each x separately, it may make sense to consider the "average" number of ships you actually can build instead: You are losing [0, 1) ships equally distributed, i.e. on average 0.5 ships. Hence, replace N with <N> = (x/cost) - 0.5. For obvious reasons, this approach favors cheap designs over expensive ones.
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: New Fuel Settings?

#21 Post by alleryn »

Morlic wrote: Mon Sep 09, 2019 7:06 pm total_value = total_damage*total_structure
I think this is not trivial, because of the way damage is distributed randomly among ships. For example, as you can see in the rather simple example above, a fleet of two ships with, say, a single 6-damage-weapon and 6 structure each will statistically outperform one ship with, say, two 6 shot attacks and 12 structure.

The two ships will always destroy the one ship, but the one ship will not always destroy both ships in the opposing fleet, since both guns might target the same ship.

One (at least I) would think that at larger scales this phenomenon will be negligible, but even that is not entirely clear (at least to me). My calculation above still showed a slight favoritism towards the more split (i.e. larger numbers of "smaller" ships) fleet when the sizes of the fleets were each multiplied by 100.

This bias, at least for large fleets, is likely (my opinion) more than offset by Fleet Upkeep (i.e. ramp-up) costs. At least as far as i know
When producing new ships, costs increase by 1% for each ship already owned by the empire.
this statement from the pedia is still accurate, although i haven't really tested.

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

Re: New Fuel Settings?

#22 Post by Morlic »

I also want to point out that what we are discussing here is rather outdated with the introduction of fighters. It also doesn't hold well when cheese tactics like decoys are involved.

For example, if I have 1 main battleship and 9 decoys, then the chance for each shot to hit the battleship in first turn is 10%. In other words, the mean number of shots it takes to destroy the battleship is increased by a factor of 10. If I have 2 battleships instead (with same total stats and same total cost), then the chance to hit any battleship in first turn is 2/11. In other words, the mean number of shots to destroy a battleship is increased by a factor of only 5.5 ...
While the designs are close to equivalent by themselves, a screening shield of decoys for first turn and fighters on subsequent turns drastically favors less ships, scaling with ~1/N (i.e. 1+M/N for M decoys).

This, ironically, means the "true" cost efficiency may actually be proportionally to cost^(-1) after all...
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: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: New Fuel Settings?

#23 Post by Ophiuchus »

alleryn wrote: Mon Sep 09, 2019 2:59 pmI will try to give a concrete example:

1a. I start with a basic medium hull and add one mass driver, leaving the other 2 slots empty. The cost of the ship happens to be 42.8 PP...

1b. I consider adding a second weapon (still leaving the internal slot empty). This would change the cost from 42.8 PP to 64.2 PP...
In other words i guess, based on my formula, that
642 ships with 1 weapon are going to outperform 428 ships with two weapons. (These two groups have equal PP costs).

That guess comes from the fact that the 642 ships can sustain 1284 hits while dishing out 642 shots, while the 428 ships can sustain 856 hits while dishing out 856 shots, and

1284*642>856*856
...
I'm still not sure what the problem is (not that i dispute there is a problem).
Maybe there is no problem. If there is no problem the truth is hard to swallow.
The formula sais it makes rarely sense to add more than one weapon (if we ignore stealth) - this goes strongly against my experience.

Also for the medium base hull using Laser or MD has the same cost efficiency (so Laser only help against fleet upkeep and ).
Morlic wrote: Mon Sep 09, 2019 7:22 pm I also want to point out that what we are discussing here is rather outdated with the introduction of fighters. It also doesn't hold well when cheese tactics like decoys are involved.
...This, ironically, means the "true" cost efficiency may actually be proportionally to cost^(-1) after all...
Also targeting has a big influence on the result. If nobody beats me to it i hope to refactor the combat backend so it can be used as battle simulator... next year probably.

So again accepting the cost efficiency with squares as true, coming back to the original question: is removing an external slot from robo hull (ROBO4E -> ROBO3E) a big nerf or not.
Using 3 shield is not cost efficient against lasers for both ROBO3E and also with four slots.

So the best robo designs are ROBO3E with 2 Zortrium and 1 Laser (c_e 7,68%) versus ROBO4E with 2 Zortrium and 2 Lasers (c_e 8,24%). That ROBO3E design has 93% cost efficiency of the ROBO4E design.
But seeing that using shields for robos on that level makes against other empires only sense if those have a huge investment in mass drivers - expecting people to add a fuel tank might be more sensible?
Comparing with other hulls ROBO3E is more efficient than the organic hull (7,21%). Symbiotic and multicellular hulls are more cost efficient (organic: 10%-14,8%, multicell: 11,6% and a good survival against plasma).

So if the original intended balance was robo hulls are a good choice vs organic line if you put shields in them(?) this is not really true. Shields in robo hulls are only good against some monsters (e.g. maintenance ships) and mass driver enemies.
I suggest to either stronger shield effect against stronger weapons (e.g. halving the effect of extra levels; e.g plasma-3 against basic shields: 9 + 1.5 + 1.5 - 3 == 9 effective damage) or halving shield cost to 15PP.

edit1: had an error in my multicell calc

edit2: added suggestion to increase value of basic shields
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!

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

Re: New Fuel Settings?

#24 Post by alleryn »

Ophiuchus wrote: Tue Sep 10, 2019 12:34 pm If there is no problem the truth is hard to swallow.
The formula sais it makes rarely sense to add more than one weapon (if we ignore stealth) - this goes strongly against my experience.
I hope to gain some more insight as i start playing multiplayer, in terms of what builds are most effective, but i can tell you that this is how i tend to build my ships (with only 1 weapon each).
Also for the medium base hull using Laser or MD has the same cost efficiency (so Laser only help against fleet upkeep and ).
I'm seeing better C_E on the Medium Hull Laser ship vs. Medium Hull MD ship when i run the numbers.
So the best robo designs are ROBO3E with 2 Zortrium and 1 Laser (c_e 7,68%) versus ROBO4E with 2 Zortrium and 2 Lasers (c_e 8,24%). That ROBO3E design has 93% cost efficiency of the ROBO4E design.
I seem to be getting different numbers than you again. (Maybe due to Fleet Upkeep or Hull/Part Cost Scaling in game setup settings? Since cost is ^-2 in the cost efficiency formula, more expensive ships become relatively more cost efficient as, e.g. fleet upkeep, increases, so even the ratio between the cost efficiencies of two designs will change as (linear) cost coefficient changes).
But seeing that using shields for robos on that level makes against other empires only sense if those have a huge investment in mass drivers - expecting people to add a fuel tank might be more sensible?
Comparing with other hulls ROBO3E is more efficient than the organic hull (7,21%). Symbiotic and multicellular hulls are more cost efficient (organic: 10%-14,8%, multicell: 11,6% and a good survival against plasma).
This agrees with my experience.
So if the original intended balance was robo hulls are a good choice vs organic line if you put shields in them(?) this is not really true. Shields in robo hulls are only good against some monsters (e.g. maintenance ships) and mass driver enemies.
I suggest to either stronger shield effect against stronger weapons (e.g. halving the effect of extra levels; e.g plasma-3 against basic shields: 9 + 1.5 + 1.5 - 3 == 9 effective damage) or halving shield cost to 15PP.
With the reiterated disclaimer of my lack of multiplayer experience, leaving most of my opinions firmly rooted in the "no real experience" category, this suggestion makes sense to me.

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

Re: New Fuel Settings?

#25 Post by Oberlus »

alleryn wrote: Tue Sep 10, 2019 4:44 pmthis is how i tend to build my ships (with only 1 weapon each).
If you add to your simulations the alternative that fills up empty slots with armour plates (same level than weapon), it can be more cost-effective in battle than leaving them empty.

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

Re: New Fuel Settings?

#26 Post by Morlic »

alleryn wrote: Mon Sep 09, 2019 7:17 pm One (at least I) would think that at larger scales this phenomenon will be negligible, but even that is not entirely clear (at least to me). My calculation above still showed a slight favoritism towards the more split (i.e. larger numbers of "smaller" ships) fleet when the sizes of the fleets were each multiplied by 100.
Without doing proper math, my intuition is as follows: One relevant number seems to be the expectation value of "wasted shots", i.e. number of shots which hit an already destroyed target. Assuming we start with equal (hitpoints*damage), after first round, whoever wasted more shots is now behind in the (hitpoints*damage) metric and will subsequently lose. By this naive reasoning, we would only have to calculate the first round to estimate the winner if (and only if) the discrepency between wasted shots is high.

In your example, fleet C wastes 26.9% and fleet D wasted 36.7% of shots. So fleet C is expected to win.

With the number of ships and thus shots (i.e. the number of samples) growing, the probability distribution of the hits taken for a single ship in the first round converges to the poisson distribution, i.e. it is eventually defined only by the expectation value (= number of shots / number of targets). The expected number of "wasted shots" is given according to this very probability distribution (and the parameter of ship hitpoints). Therefore, when comparing N ships with N shots and 1 "Hitpoint" vs. N/2 ships with N shots and 2 Hitpoints, it shouldn't really matter if you are looking at N=200 or N=1000 or N=1e6 ships: The ratio of "wasted" shots remains equal and thus after first turn, there will be a significant enough imbalance to decide the battle. "Unfortunately", with relatively small fleet size, the choice of N does actually influence the outcome significantly as your example for N=2 shows (as is expected - the poisson approximation is not valid in that regime).

The effect of wasted shots should reduce if you increase both hitpoints and shots for both sides - the standard deviation scales with the square root of the expectation value, so the relative number of wasted shots is reduced. Also tending towards a symmetric (gaussian) distribution helps to smoothen things out.


However, having equal damage and hitpoints in the fleet certainly is not the only case to consider. In current balancing, structure comes cheaper than damage so asymmetric designs are often favored. Now, when total damage >> total structure, the number of wasted shots in the first rounds are negligible. Instead, we find that the fleet with higher ship count takes earlier losses which reduces the firepower while the tankier ships keep full fire power.


TL;DR: overall nontrivial stuff but for certain edge cases it is relatively trivial to see that and why certain fleet comps are prefered. I am not sure what is the correct approach to condense that into a single number though.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: New Fuel Settings?

#27 Post by Morlic »

Ophiuchus wrote: Tue Sep 10, 2019 12:34 pm So if the original intended balance was robo hulls are a good choice vs organic line if you put shields in them(?) this is not really true. Shields in robo hulls are only good against some monsters (e.g. maintenance ships) and mass driver enemies.
Also vs weak pilots and early laser levels. But yes, I agree that it is a niche and the hull falls off fast. However, considering the fact that you get the tech earlier than the organic line and don't have to build a specialized shipyard (since you start with Drydock), you do have a very defined timing window where the hull can be very strong. Also, Organic Hull kind of needs Zortrium Armor to not suck.

Their other obvious niche is that you can put robotic shields into them.
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: New Fuel Settings?

#28 Post by alleryn »

Morlic wrote: Tue Sep 10, 2019 5:10 pm Without doing proper math, my intuition is as follows: One relevant number seems to be the expectation value of "wasted shots", i.e. number of shots which hit an already destroyed target.
This seems like a good approach.
Assuming we start with equal (hitpoints*damage), after first round, whoever wasted more shots is now behind in the (hitpoints*damage) metric and will subsequently lose. By this naive reasoning, we would only have to calculate the first round to estimate the winner if (and only if) the discrepency between wasted shots is high.

In your example, fleet C wastes 26.9% and fleet D wasted 36.7% of shots. So fleet C is expected to win.
I'm still a bit concerned here that there are at least two additional factors at work that may need to be considered:

- At the start of the first bout fleet D is composed entirely of ships with 2 min_hits_to_die, whereas in subsequent combat rounds it has some ships with varying structure values. Because the composition has changed, the expected fraction of wasted shots will also change. (In round 2 C lands 41/73 shots, wasting 43.8% and D lands 56/80, wasting 30%). I think what you are saying is that the first round imbalance is going to tip the scales enough that future rounds don't matter, but that brings me to the second consideration:

- When you talk about wasted shots, another way to think about it is that any shot that doesn't actually kill a ship is wasted. Your metric of wasted shots is that any shot that doesn't reduce structure is wasted. But the other metric is that any shot that doesn't reduce the number of weapons is wasted.

In this example, in round 1, Fleet C's size was reduced to a factor of 36.5% (73/200), while wasting 26.9% of it's shots (by your shots wasted metric). Fleet D's size was reduced to a factor of 40% (40/100), while wasting 36.7% of its shots. The reduction in fleet size corresponds to decrease in offensive capacity (# of weapons), while the number of wasted shots corresponds to a decrease in defensive capacity (structure/min_hits_to_die) of the opposing fleet (i.e. if Fleet X wastes fewer shots, Fleet Y will end up with less structure).

In this example, the discrepancy between ship losses is quite small compared to the discrepancy in wasted shots.

I think i'm not really structuring well what i'm trying to say (i've tried rewriting this three times now, so i may just settle for this for the time being), but basically consider Fleet E [100 ships 1 min_hit and 1 weapon] vs a single ship with 1 weapon and 10,000 min_hits. Here no shots are wasted, but obviously the single big ship prevails easily (in a really long fight). I think this kind of thing will come into play in calculations as well.

This may be what you were getting at here:
In current balancing, structure comes cheaper than damage so asymmetric designs are often favored. Now, when total damage >> total structure, the number of wasted shots in the first rounds are negligible. Instead, we find that the fleet with higher ship count takes earlier losses which reduces the firepower while the tankier ships keep full fire power.
I didn't quite understand that part.
With the number of ships and thus shots (i.e. the number of samples) growing, the probability distribution of the hits taken for a single ship in the first round converges to the poisson distribution, i.e. it is eventually defined only by the expectation value (= number of shots / number of targets). The expected number of "wasted shots" is given according to this very probability distribution (and the parameter of ship hitpoints). Therefore, when comparing N ships with N shots and 1 "Hitpoint" vs. N/2 ships with N shots and 2 Hitpoints, it shouldn't really matter if you are looking at N=200 or N=1000 or N=1e6 ships: The ratio of "wasted" shots remains equal and thus after first turn, there will be a significant enough imbalance to decide the battle. "Unfortunately", with relatively small fleet size, the choice of N does actually influence the outcome significantly as your example for N=2 shows (as is expected - the poisson approximation is not valid in that regime).
Agreed. That first analysis i did was to test the difference between very small fleets and larger fleets like that, but i hope to do other analysis varying different parameters to see if there are other statistical phenomena that emerge past my limited current horizon of understanding. I think it still may be pertinent to look at what value of N we need to look at for this smoothing to become "enough". Clearly it's somwhere between 2 and 100.

My apologies if this post lost a bit of steam at some point. I had some things i wanted to say, but it didn't seem to come out quite right. Still some decent material here, hopefully.

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

Re: New Fuel Settings?

#29 Post by alleryn »

Oberlus wrote: Tue Sep 10, 2019 5:02 pm If you add to your simulations the alternative that fills up empty slots with armour plates (same level than weapon), it can be more cost-effective in battle than leaving them empty.
Ah, yes, sorry, perhaps i said that poorly. I tend to build my ships with 1 weapon, and the other external slots filled with armor. I usually put fuel in the inners, though i can see how shields can be highly useful if you're able to out-tech an opponent who is out-industrying you. (At equivalent tech levels, i believe shields to be cost-inefficient, with the obvious potential exception of roboshields).

Edit: Oh and probably also with the exception of later game hulls. I don't really have any practice with any hulls after Static Multicellular/Crystallized Asteroid
Last edited by alleryn on Tue Sep 10, 2019 6:57 pm, edited 1 time in total.

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

Re: New Fuel Settings?

#30 Post by Ophiuchus »

One more result for robohulls vs symbiotic/multicell hulls.

I calculated how much value (damage*structure) one can get out of 2000PP if you consider upkeep penalty (1.01^no_of_current_ships) and build one ship after the other. Note i did not include part upkeep yet.

Suddenly "inefficient" designs are back on top.

Robo hulls 2 Zortrium 2 Lasers R2Z2L 16,544
Robo hulls 2 Zortrium 2 Lasers Shield-3 R2Z2L3SH 13,442
Multicell hulls 1 Zortrium 2 Lasers M1Z2L 12,474
Multicell hulls 2 Zortrium 1 Lasers M2Z1L 12,122
..
Multicell hulls 1 Zortrium 2 Lasers Shield-3 M1Z2L3SH 9,504

If one uses (damage*min_hits_to_death) against Lasers, the shielded versions come out slightly on top. R2Z2L3SH 1,680; R2Z2L 1,504; M1Z2L3SH 1,188; M1Z2L 1,134)

So you if your enemy is approaching and you expect losses, go for multicell. If you want to invest/build up fleet, go for robohull.

Symbiotic hull is not a good option as it needs time to become good but if you want to keep the ship around, better go for robohull.

As far as I understand it, this should scale for larger fleets (so the order should stabilize/keep intact).
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!

Post Reply