Measuring efficiency of ship designs

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

Moderator: Oberlus

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

Re: Measuring efficiency of ship designs

#46 Post by alleryn »

Shields analysis (my first pass):

Higher order notions:
- Shields are useless against Fighters (Aside: i'm going to try to start calling them Boats and calling Fighter-fighters Gunboats, for clarity, but i'll probably forget here and there)
- Shields are not considered in Part-Based Upkeep, which only considers Short Range, Armour, Fighter Hangars (but not Launch Bays), and Troop Pods
- Shields overall increase the cost of ships, so regardless of whether Part-Based Upkeep is on, Fleet Upkeep will be somewhat lower when the player uses shields (along with anything that increases ship cost such as using larger hulls)

Other general comments:
- Each point of shield is better than the last. Going from taking 6 damage per hit to 5 is only a 20% increase in effective structure, but going from 2 to 1 is a 100% increase.
- Shields are more cost effective on more expensive ships. If the shield is half the cost of the ship, it's probably not going to pay for itself.

Shield Cost Efficiency vs Beams Calculations:
Efficiency for shields vs beams is one of the easier calculations, provided the type (damage) of the beam is known. Unlike most ship parts we might add, adding a shield has no slot-opportunity-cost (in terms of combat efficiency) since internal slots on beam ships usually just contain fuel (or are even left empty) otherwise.

Given a ship design without any shield of cost C, a shield with cost S that reduces damage by Y, and an opponent using weapons that deal X damage each, let's calculate the efficiency of a ship with and without a shield:

(I'll just use structure below. As discussed earlier in this thread, min_hits_to_die may be more useful in some circumstances. It'll arithmetically cancel out here, anyways).

Without:
NoShldEfficiency = (damage)*(structure)/C^2

With:

Here we can just multiply our effective structure by a factor of X/(X-Y). Any time we would take X damage on the unshielded ship, we are taking (X-Y) damage instead. Example: If a ship has 100 structure and the opponent is dealing 10 damage each shot, adding a shield that blocks 3 damage with give us an effective structure of 100*10/(10-3) = 142.9. Each ship can withstand 1.429 times the number of hits that it could before ( 1.429 * (10-3) = 1 * 10 ).

YesShldEfficiency = [ (damage)*(structure)*X/(X-Y) ] / (C + S)^2

Now we can look at the ratio of efficiencies:

EffRatio = YesShldEff / NoShldEff = [ X / (X-Y) ] * [ C / (C+S) ] ^ 2

If this ratio is greater than 1, then adding our shield is efficient.

Let's look at a few concrete examples:

(1) Earliest possible ship with shields. Suppose we rush straight to Force Field Harmonics and start adding shields onto Basic Large Hulls. At this stage of the game, we're probably against Mass Drivers still. If our opponent has Average Pilots and has done no Mass Driver tech, our ships won't be taking any damage! A question might be, how much MD tech does our opponent have to do before our shields start becoming cost inefficient (or will they remain efficient even after MD4?) ?

I'll start with the first ship i often build, i call it the Basic 1.1 It's a basic large hull with one Mass Driver and two Standard Armor Plates. (I'd usually add fuel too, but i'll skip that for now).

C = (basic large hull cost) + (mass driver cost) + 2 * (standard armor plating cost) = 30 + 20 + 2*4 = 58

S = 30 (the first shield, the Defense Grid, comes with a PP cost of 30)

X, for the purposes of this experiment/example will vary between 3 and 6, as our opponent researches Mass Driver 2, 3, and 4.

Y = 3 (that's the Defense Grid, for ya).

EffRatio = [ X / (X-3) ] * [ 58 / (58+30) ] ^ 2 = .4344 * [ X / (X-3) ]

When X is 3, before our opponent has researched any Mass Driver tech, of course our shielded ship is "infinitely" more efficient than our unshielded ship. A single shielded ship could take out whole legions of MD1 ships, given enough time. But, as our opponent starts teching up, the cost efficiency of the Defense Grid drops off quickly.

After MD2, the shielded ship is 1.738 times as efficient as the unshielded one,
MD3 drops the efficiency ratio to 1.086,
and after MD4, the shield stops being cost efficient. EffRatio (MD4 vs Basic Large Hull/MD/2xStdPlate) = 0.8688

A little sad, since we spent 100 RP on Force Field Harmonics (never mind having to research Algorithmic Elegance and Nascent AI), while MD4 cost our opponent just 40 RP (8 for MD2, 12 for MD3, and 20 for MD4). Probably not a practical strategy.

(2) Maybe that wasn't such a surprise. After all, that early hull is pretty cheap. Shields will be a better buy on more expensive base models. Let's try the robo hull. We'll give the robo hull 2 mass drivers and 2 standard armor plates.

C = (robo hull cost) + 2 * (mass driver cost) + 2 * (standard armor plating cost) = 40 + 2*20 + 2*4 = 88
S = 30
X = 6 (we'll look at MD4 here)
Y = 3 (still considering the defense grid)

EffRatio = 6 / (6-3) * [ 88 / (88 +30) ] ^ 2 = 1.11

Here on the Robotic Hull, the Defense Grid remains cost efficient against Mass Drivers, even through MD4. Of course, our opponent researching Lasers will likely render the Defense Grid inefficient, but this should be enough to see that shields still have a niche in the combat ecosystem.

Things i'd like to look at in the near future:
- More on shields: How high does C have to be for each shield to be cost efficient?
- My first look at Boats
- Early game hulls: Is there ever a time to build organic hulls when Static Multicellular will be researched by the time the Incubator is built?

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

Re: Measuring efficiency of ship designs

#47 Post by Morlic »

alleryn wrote: Sat Sep 21, 2019 5:01 am (I'll just use structure below. As discussed earlier in this thread, min_hits_to_die may be more useful in some circumstances. It'll arithmetically cancel out here, anyways).
I agree with your analysis as far as using structure is concerned. However, this statement is incorrect.

Given 6 damage, 3 shields (i.e. MD4 vs tier 1 shields), consider:

a) 12 structure -> 4 / 2 hits with/without shields
b) 13 structure -> 5 / 3 hits

First time correct 2x value is estimated by your formula. In the second case, shields are only improving EHP by a factor of 1.67.


Now, looking at Robo Hulls
25 hull structure + 2x6 standard armor structure = 37 structure.

7 Hits without shield. 13 Hits with shield, i.e. factor ~1.86 and not 2.

Now, shields on the robo hull are only barely more cost efficient: 1.86/2 * 1.11 = 1.03
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: Measuring efficiency of ship designs

#48 Post by Ophiuchus »

While trying to figure out how to calculate efficiency for zero-damage enemies (aka decoys) - I found the current cost efficiency is not really ok for ship estimation. I think it combines the (dam,structure) values unnecessarily. This combination does it make sense in when evaluating a fleet - so the resulting combat value of your death stack is sum(dam)*sum(min-hits-to-die) but you cant really do sum(ship_value(dam,min-hits-to-die)) (for evaluating decoys i use min-hits-to-die, but using instead structure value does not change the composability of the calculation).
Still one can compare two designs by such a metric. If you do not know fleet composition the better ship cost efficiency is the better choice.
If one hit and one min-hits-to-die costs the same -for fleet composition/deciding what to build next- one would probably want sum(dam)==sum(min-hits-to-die) in order to maximize sum(dam)*sum(min-hits-to-die) [although i am not sure how combat bouts influence this - they add up on the damage side but not the min-hits-to-die side].

So here an example.. annihilation game (two fleets kill each other exactly in one bout without overkill), so the fleets in a row are equal in power in a sense:
Empire 1Empire 2Value Calculation
1* 4x hp42* 2x hp2(4,4) vs (2*2,2*2)
1* 4x hp44* 1x hp1(4,4) vs (4*1,4*1)
1* 4x hp41* 2x hp2 + 2* 1x hp1(4,4) vs (1*2+2*1,1*2+2*1)
1* 4x hp41* 2x hp1 + 1* 1x hp1 + 1* hp2(4,4) vs (1*2+1*1,1*1+1*1+1*2)
1* 4x hp41* hp4 + 4*(4,4) vs (4*1,1*4)
Syntax explanation: 1* 2x hp2 + 2* 1x hp1 means the fleet consists of one ship (1*) with 2 hits damage (2x) and min-hits-to-die 2 (2hp) and two other ships (2*) with 1 hit damage (1x) and min-hits-to-die 1 (1hp) each.
Also note there are decoys in the example. The last row is trying to emulate a carrier with untargetable bombers.


This is also relevant for calculating cost efficiency for carrier designs without smoke screen capabiltiy because the current definition cant handle 0-structure enemies.

On a side note: This meaninglessness of ship damage value might also give an explanation why death stacks are as efficient as they are.

So what I am trying to say is - in game design we probably also need to look at damage-cost-efficiency and structure-cost-efficiency for a ship design and treat those as different.
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