zuPloed zuPloed

Ship component balancing and math

Ship component balancing and math

Hello Stardock,

I think I can point out a couple of issues which would be fundamental for better AI behaviour, more accurate feedback for new players and overall balance.

 

#1 My primary concern: Missiles

Missile weapons have a tech for +20% attack speed and two components for +25% and +50% respectively (according to tooltips). This adds up to +95% attack speed, which would be alright... if that was how you actually implemented it. You didn't increase the attack speed by 95% but reduced the cooldown by 95%.

So attack speed is 1/cooldown, right? Ok. Lets see what this does:

attack speed [new] = 1/cooldown[new] = 1/(cooldown*(1-95%)) = 1/(0.05*cooldown) = 20/cooldown = 20*attack speed

It added 1900% of attack speed instead of 95%. I am sorry for lecturing you like this, but from these numbers you should see why this is a big issue.

edit: while you are at it, it works the same for kinetics and beams, too, but since it adds up to less then 95% it is less dramatic. But these also get:
+100% attack speed instead of +50% for kinetics and
+81% attack speed instead of +45% for beams with both reducing components
I suspect none of this is intentional.

 

#2 Jamming

You can stack up jamming to very high values. With only one tullium invested (and about 20 technologies researched, though realisticly more due to need for economy) you can have a fleet of ships with 65% evasion (20% from racial trade, 10% from thalan tech, 10% from normal jammer, 25% from cover-all-fleet-jammer for 1 Tullium). I suspect accuracy of the attacker and evasion of the attacked are additive, so against kinetics you can get: 80%-75% = 5% chance to hit. To an AI this fleet is virtually invincible (or to express it in terms of an equivalent change to hitpoints: +1500%). The only counter is target scanners, which is basicly the same tech.

 edit: The Snathi tech tree does not have any accuracy boosting components. There is no way the Snathi tech tree can deal with this efficiently.

 

(Combine #1 and #2 to build the death star.)

 

#3 Energy Leech

This is probably a bug, but the component that states: 50% shield piercing does not seem to work. Bema wepaons deployed by a ship I armed with this still did its usual 50% damage to shields and did not harm the ships hitpoints. So it essentially behaved as if the component was not there. The only thing that seems to work is the damage reduction on the smaller variant. But shield piercing is not working.

edit2: This was also addressed with some more details here:
https://forums.galciv3.com/474590

 

Why should these be addressed?

You could now argue, that I should simply not use these things, since I am spoiling my own experience with this. I wuld counter, that the games stands to gain from rethinking some of these features:

1) I suspect the AI thread assessment does not work based on the explicit attack speed, jamming, targetting values, but rather uses the associated 3 stats, fortitude, value and thread (?). Since you only add a fixed value of threat, it can not account for stacking attack speed boni. Same for Jamming and same for not working Leech.

2) The predictions for the outcome of battles are nice, but for the same reasons as in a) they will deliver inaccurate results. With suggested 65% evasion fleet above I consistantly beat fleets I was "likely to lose" against.

 

Ok, so we established now, that +20% and -20% are NOT the same thing. Where else is this in the game?

You can get +X% hull capacity or get -X% component mass (hint: the latter one is better suited to make bigger ships). In addition: these values stack multiplicatively with each other. Whether this is unbalanced is debatable however, since you will have way more expensive ships and can't spread them out so well. At 60 logistics your fleets will be close to invincible though. I don't think this should change, I love to build these really big mother ships, this should stay in the game in some way.

 

That all being said, thanks for the great game. Keep up the good work on it so I can buy some more DLC ;)

Regards,

zuPloed

55,803 views 31 replies
Reply #26 Top

Quoting Tetrasodium, reply 24


Quoting joeball123,

Consider a weapon which can fire once per time period T has a 50% chance of hitting the target per shot, and a weapon which fires twice as fast with the same chance of hitting on any given shot. Over any given time interval T, the weapon which fires more slowly has a 50% chance of hitting the target and a 50% chance of missing the target. Over the same time interval T, the weapon which fires faster has a 25% chance of doing nothing, a 50% chance of hitting once, and a 25% chance of hitting twice. The faster-firing weapon therefore has a 75% chance of damaging the target over a time interval T whereas the slower-firing weapon has only a 50% chance of dealing damage to the target over the same period.



This is a common mistake.

flip a quarter and the odds are 50/50 that you get heads or tails.

flip a quarter twice and the odds are 50/50 each flip

flip a quarter 10 times and the odds are still 50/50 each flip

the odds of getting a given result on a coin flip are not influenced by the result of the prior coin flip.... you could get any combination between 5h:5t to 10h:0t or 0h:10t

 

There is a term for it, but I don't recall the name

End of Tetrasodium's quote

If you have a 50% probability of producing a given result on any given attempt and the probability of producing this result is independent of the success or failure of previous and successive attempts, then the probability that you will succeed at least once in N attempts is (1 - 0.5^N)*100%. For N = 2, that's a 75% chance of producing at least one event. For N = 1, it's a 50% chance of producing a result. There is absolutely nothing wrong with the example I provided. To use your example of coinflips, if you flip an unbiased coin twice, the results you can produce are [0, 0], [0, 1], [1, 0], and [1, 1]. If you flip an unbiased coin twice, you will produce at least one heads 75% of the time.

The example given only becomes incorrect when you start assuming things which were not stated - say, that the weapons have equal maximum DPS. If weapon A can fire twice in the same time that weapon B can fire once, then yes, if weapon A and weapon B have the same maximum DPS the expected damage over some time interval T which is sufficiently long that A can fire twice as many times as B is the same. However, it is not the case within either the game or the example given that weapons A and B must necessarily have the same maximum DPS. To claim that my example is wrong is either a misreading of the example (adding assumptions which were not stated; remember, equal DPS is a special case, not the general case, and so should not be assumed unless it is stated to be the case) or a failure to understand the concepts involved.

Quoting zuPloed, reply 25

Can we quantify this somehow?

I used the example above, reduced the number of kill shots to 5 and 4 for damage boost (to make the effect of the variance more prominent) and calculated the probability of killing the target before the expected kill time. Below hit chances of 0.6 these probabilities are within 1% or 2% (absolute probability) of each other for damage and as and below 0.3 hitchance they acc is also in that range.

Interestingly enough, acc is allways the variable with highest the highest probability to kill before the expected kill time (but with no chance to for early kills, since its minimum kill time is 25% higher).

If you take the probability at 75% expected kill time, the damage boost usually has the highest probability (by a few %).
End of zuPloed's quote

Notice that the model with the higher damage per shot also has higher chances of failing to kill the target within the expected kill time, and that the probability that a given target will take a certain time to kill drops off less rapidly as the time taken to kill increases than it does for the high rate of fire model. In other words, the high damage per shot model is a high-risk model. If you have a high-risk and a low-risk model with the same expected performance, you take the low-risk model, because risk minimization is a good thing.

 

Also, take some time and consider the problem under discussion. It is a three-variable problem, with one variable being a random variable and the expected DPS being linear in any one of the variables. If we want to compare how the expected DPS and its distribution behave for changes in the three variables, we have a couple options. We can hold two of the variables constant while varying the third, and compare the behavior in each case, though we will need to be careful not to neglect to consider how changes in one variable impact the other variables in practice when we consider what this implies for the problem. We can apply a constraint to the problem and see how variations in the variables within that constraint modify the behavior, though we need to be careful not to choose a constraint that biases the comparison for one or more variables. We can do case studies, though these can be difficult to generalize.

You appear to have chosen to apply a constraint to the problem and see how the behavior changes as the variables are adjusted within this constraint, but the constraint you appear to have chosen biases the comparison in favor of increasing accuracy, because the constraint you have chosen to enforce is constant maximum DPS, which is independent of accuracy. Unfortunately, in the situation we are modeling, maximum DPS is not independent of accuracy. I will use a case study to show this to be the case*: Consider a ship which has a hull capacity of 75 which belongs to a faction which has no component capacity requirement reductions and has access to disruptors, rapid rechargers, and targeting scanners. Such a ship can carry up to five disruptors (25 damage per shot, 5 max DPS), 4 disruptors and either a rapid recharger (17 damage per shot, 4.86 max DPS) or targeting scanner (20 damage per shot, 4 max DPS), or 3 disruptors and both a targeting scanner and a rapid recharger (12.75 damage per shot, 3.64 max DPS). Clearly, maximum DPS has a dependency on rated accuracy, and declines as rated accuracy increases. By holding maximum DPS constant, you favor accuracy because you are not penalizing either rate of fire or damage per shot for increasing accuracy.

If you do impose a constraint, such as constant expected DPS, which penalizes at least one of damage per shot and rate of fire for increasing accuracy, you see that increasing rate of fire while holding accuracy constant causes the distribution to converge to the distribution of expected DPS for a weapon with the same expected DPS and a 100% hit rate, just like increasing accuracy would, whereas increasing damage per shot while holding accuracy constant causes the distribution to converge on the distribution of expected DPS for a weapon which can kill the target in a single shot and has the same hit chance. The distribution behaves the same way for increasing rate of fire as it does for increasing accuracy; therefore if increasing accuracy is a counter to evasion, so is increasing rate of fire.

*It's true that a case study cannot necessarily be generalized, especially to bonuses from technologies, but few ways of increasing accuracy come at no cost to something else, and in many cases that something else is at least indirectly applicable to the problem of countering evasion. The empire trait for accuracy comes at a cost to some other empire trait (the hull capacity bonus is directly applicable, while the income, manufacturing, research, food, and maintenance modifiers are all indirectly applicable; a few others, like growth, speed, and sensor range, are even more indirectly applicable), either directly because you need more points to get the accuracy trait or indirectly because getting the accuracy trait prevents you from spending points elsewhere; the accuracy-boosting specializations come at a cost to whatever the other specialization options could have given you (some of which, such as component capacity requirement reductions and component effect magnitude bonuses, are directly applicable to the problem and others of which, such as manufacturing cost reductions, are in theory indirectly applicable to the problem); the fleet-wide accuracy boosters consume strategic resources which could go towards something else and require either that your fleet includes a support role ship (and even if you were already going to have at least one support role ship, adding a new component to it presumably comes at a cost to some other feature of the ship, though since support-role ships are not generally actively engaged this is somewhat easily ignored) or space on one of your line ships, and so on.

Reply #27 Top

Quoting joeball123, reply 26

I will use a case study to show this to be the case*: Consider a ship which has a hull capacity of 75 which belongs to a faction which has no component capacity requirement reductions and has access to disruptors, rapid rechargers, and targeting scanners. Such a ship can carry up to five disruptors (25 damage per shot, 5 max DPS), 4 disruptors and either a rapid recharger (17 damage per shot, 4.86 max DPS) or targeting scanner (20 damage per shot, 4 max DPS), or 3 disruptors and both a targeting scanner and a rapid recharger (12.75 damage per shot, 3.64 max DPS).
End of joeball123's quote
Let's modify this case study a little. It is relevant to my argument if you compare expected dps values of the variants for different values of evasion.

I choose evasion values of 0.1, 0.5 and 0.9.

For 5 disruptors we get: 4.5 dps, 2.5 dps, 0.5 dps
For 4 disruptors and rapid fire we get: 4.37 dps, 2.43 dps, 0.49 dps
For 4 disruptors and scanners we get: 4 dps, 3 dps, 1.4 dps
For 3 disruptors, rapid fire and scanners we get: 3.64 dps, 2.73 dps, 1.28 dps

And this is illustrating what I am saying, it really depends a lot on the enemies evasion. The positive influence of the attack speed over damage at equal nominal dps is marginal in comparison.

Quoting joeball123, reply 26

Notice that the model with the higher damage per shot also has higher chances of failing to kill the target within the expected kill time, and that the probability that a given target will take a certain time to kill drops off less rapidly as the time taken to kill increases than it does for the high rate of fire model. In other words, the high damage per shot model is a high-risk model. If you have a high-risk and a low-risk model with the same expected performance, you take the low-risk model, because risk minimization is a good thing.
End of joeball123's quote
Yes but the effect is very small. Look, here is the example for 10/8 kill shots and chance to hit = 0.5. I am plotting the probability of killing the target at time t or earlier against t. And for illustration the effect of an absolute hit chance bonus, which I am arguing is what you have to do instead of the relative one.

Quoting joeball123, reply 26

because the constraint you have chosen to enforce is constant maximum DPS, which is independent of accuracy.
End of joeball123's quote
Hardly. The first time this constraint pops up is in your home work asignment. You must have read that into one of my posts.

And yes the constant effective dps constraint you suggested is biased if you want to model this game, since you neglect evasion.

Your case study has a very reasonable constraint, in saying your components must not exceed 75 mass. This is a constraint that is close to an ingame decision you have to make and once you actually stop ignoring different evasion values, it also nicely illustrates my point. Feel free to plot the damage distribution or summed distributions for the 4 conficurations.

What happens if you increase the mass? You only model variants with rapid fire and only compare +1 weapon against +1 target scanner. If you go to lower you only work with the cases without rapid fire.

One last remark: how does weapon cooldown work in galciv3? Does it start after you get in range to fire or does it start after each shot, so you can shoot immediately when something is in range? In the latter case you the times in the distributions have to be shifted by one weapon periode. If you are arguing about the few percent due to variance, you will also have to pay some attention to that effect if galciv3 works like that.

Reply #28 Top

Quoting joeball123, reply 26

If you have a 50% probability of producing a given result on any given attempt and the probability of producing this result is independent of the success or failure of previous and successive attempts, then the probability that you will succeed at least once in N attempts is (1 - 0.5^N)*100%. For N = 2, that's a 75% chance of producing at least one event. For N = 1, it's a 50% chance of producing a result. There is absolutely nothing wrong with the example I provided. To use your example of coinflips, if you flip an unbiased coin twice, the results you can produce are [0, 0], [0, 1], [1, 0], and [1, 1]. If you flip an unbiased coin twice, you will produce at least one heads 75% of the time.
End of joeball123's quote

over time it will probably average at around that given a large enough sample,  but... not really.  If you the chance to hit is independent with a 50/50 chance,  each time...

first shot 50/50

second shot 50/50

third shot 50/50

fourth shot 50/50

The odds in getting miss miss miss miss are the same as getting hit miss hit miss hit miss hit miss or hit hit hit hit  in an independent event like that.  I'm being pedantic because you picked 50/50 with an event that has no correlation to the results of the orevious event(s), here is a good explanation.

Reply #29 Top

Quoting Tetrasodium, reply 28

over time it will probably average at around that given a large enough sample, but... not really. If you the chance to hit is independent with a 50/50 chance, each time...

first shot 50/50

second shot 50/50

third shot 50/50

fourth shot 50/50

The odds in getting miss miss miss miss are the same as getting hit miss hit miss hit miss hit miss or hit hit hit hit in an independent event like that. I'm being pedantic because you picked 50/50 with an event that has no correlation to the results of the orevious event(s), here is a good explanation.
End of Tetrasodium's quote

If I flip two unbiased coins once each, or flip one unbiased coin twice, I have a better chance of getting AT LEAST one heads than if I flip only one unbiased coin once, yes? This implies absolutely nothing about the probability of any given event producing a given result. This is a simple concept. I do not care about the probability of getting a specific combination, a specific permutation, or a specific result in the event at the end of (or following) the sequence. I care about the probability that I get AT LEAST k desired results in n trials. The probability of getting AT LEAST 1 heads in four coinflips is 93.75%, the probability of getting at least one heads in 2 coinflips is 75%, and the probability of getting at least one heads in 1 coinflip is 50%. Clearly, the odds that I get AT LEAST one heads improves as the number of coinflips increases, because there are very low odds that ALL of the coinflips will produce tails. The odds of getting at least k desired results in a sequence of n trials also improves as n increases, and if n increases but the time required to complete n trials remains constant this means that the probability of getting at least k desired results in a given period of time increases.

Moreover, it is irrelevant that the probability of the inverse situation (at least k undesired events) behaves the same way, because in the example under discussion I do not care about the probability of getting at least k undesired events, I care about the probability of not getting more than (n - k) undesired events, and the probability of not getting more than (n - k) undesired events is 1 minus the probability of getting at least k desired events. After all, for a sequence of n independent discrete events which all have a probability of p of producing a desired result, the probability that I will get exactly k desired events is n! / (k! * (n - k)!) * p^k * (1 - p)^(n - k), and the probability that I will get at least k' events is the sum of the probabilities that I will get k events for k = k':n, while the probability that I will get less than k' desired events (no more than n - k' undesired events) is the sum of the probabilities that I will get k events for k = 0:(k - 1). Since the probabilities of all the combinations of events must sum to 1, the probability that I will get at least k' desired events is 1 minus the probability that I will get no more than (n - k') undesired events.

Quoting zuPloed, reply 27

Hardly. The first time this constraint pops up is in your home work asignment. You must have read that into one of my posts.
End of zuPloed's quote

Did I? Because the post quoted below comes before I asked you to look at the distribution of expected damage, and it certainly looks as though you've imposed the constraint of equal DPS on comparison of two hypothetical weapons.

Quoting zuPloed, reply 13


Quoting joeball123,

Let us say that in a period of time T you can fire a number of shots N which each have a probability p of hitting the target. You can compute an expected number of shots E(p, N) which will hit the target over the period of time T. If we modify the weapon in such a way that the probability of any one shot hitting the target is p' > p without affecting the rate of fire, we increase the expected number of hits over some time period T. If we modify the weapon so that the number of shots fired over T time is N' > N without affecting the probability that any individual shot will hit, we also increase the expected number of hits over some time period T. Rate of fire increases that do not impact accuracy are similar in effect to accuracy increases which do not impact rate of fire. If increasing accuracy is a counter to evasion, so is increasing rate of fire.

Expected hits is not the variable you are looking for. It would be if you could kill a ship in one hit. In most situations, it does not. The only thing higher attackspeed at equal damage per second does, is reducing the uncertainty of the outcome. But the expected damage is the same. consider your second example, where weapon 1 fires once for 2 damage per T with a 50% hit chance and weapon two fires twice for 1 damage and a 50% hit chance. This results in:

Weapon 1: 50% chance to do 2 damage, 50% chance to do 0 damage. Expected damage: 1

Weapon 2: 25% chance to do 0 damage, 50% chance to do 1 damage, 25% chance to do 2 damage. Expected damage: 1

The only difference is that the spread around the expected damage becomes less for higher attack rate. It is the same for

End of zuPloed's quote

This post is the first time that either one of us introduced the assumption that weapons under consideration had equal DPS. I did not introduce this constraint.

Quoting zuPloed, reply 27

Your case study has a very reasonable constraint, in saying your components must not exceed 75 mass. This is a constraint that is close to an ingame decision you have to make and once you actually stop ignoring different evasion values, it also nicely illustrates my point. Feel free to plot the damage distribution or summed distributions for the 4 conficurations.
End of zuPloed's quote

Constant hull capacity required is a very accurate constraint and so is very good for case studies, but it does not generalize well. Constant expected DPS is not a perfect constraint, but it is a constraint that follows the same general behavior as constant hull capacity (increasing rated accuracy requires reducing at least one of damage per shot and rate of fire, increasing rate of fire requires reducing at least one of rated accuracy and damage per shot, increasing damage per shot requires reducing at least one of rated accuracy and rate of fire) and is a simplifying assumption which can be used to generalize to variations against a target with a given evasion rating.

Also, constant expected DPS implicitly incorporates evasion. You cannot compute what the value of expected DPS should be without making an assumption about the evasion rating of your target, because expected DPS is dependent upon hit rate.

Reply #30 Top

I read the coin example assuming more than two flips the probability for a certain goes up if you don't get it. It goes down equally if you do get it increasing the chance for the other face. Over time on even throws of a quarter it should be the same. The number of rounds are significant here. If the enemy has the right defence for your weapon. Evasion, jamming, and accuracy should work together. Sensors vs. Thrusters should be significant. Cool down. Rate of fire. Hull points. How much damage and defence. 

If you have a lot of ships, rate of fire, hull points then you get more chances that would be significant for jamming, evasion, or accuracy. Then low numbers would be significant othwise, this is not the most significant. Here high damage would probably be the best. Not if the enemy has just as good or better defense.  High evasion then hull points, and good and right defence irreverent. 

Now if you have longevity then accuracy and evasion would work better.

Reply #31 Top

Quoting joeball123, reply 29

This post is the first time that either one of us introduced the assumption that weapons under consideration had equal DPS. I did not introduce this constraint.
End of joeball123's quote
Where am I mentioning effective hit chance here? That you have to treat effective hit chance the same, is your (flawed) assumption.

You should have realized long before, that I don't use that assumption (unless replying to your arguments). Reply 20 was a very accurate description of my argument, but you ignored it. Reply 20 illustrates the calculations you do in order to decide what is your last component on your ship (acc, AS or damage per hit). It gives a criterion when to choose AS over damage per hit which is independent of evasion rating. Therefor you should allways have that optimized anyways. Secondly I give a criterion, when to choose Acc over AS or damage, which is dependent of evasion.

With this and the case study and the quantitative data I produced for YOUR model the discussion is done for me.

Quoting zuPloed, reply 27

Let's modify this case study a little. It is relevant to my argument if you compare expected dps values of the variants for different values of evasion.

I choose evasion values of 0.1, 0.5 and 0.9.

For 5 disruptors we get: 4.5 dps, 2.5 dps, 0.5 dps
For 4 disruptors and rapid fire we get: 4.37 dps, 2.43 dps, 0.49 dps
For 4 disruptors and scanners we get: 4 dps, 3 dps, 1.4 dps
For 3 disruptors, rapid fire and scanners we get: 3.64 dps, 2.73 dps, 1.28 dps
End of zuPloed's quote
Have fun continuing to cherry pick my quotes out of context. I don't know if that's intentional on your end or just how you are. But it makes further discussions pointless.
Quoting Tetrasodium, reply 28

The odds in getting miss miss miss miss are the same as getting hit miss hit miss hit miss hit miss or hit hit hit hit in an independent event like that. I'm being pedantic because you picked 50/50 with an event that has no correlation to the results of the orevious event(s), here is a good explanation.
End of Tetrasodium's quote
Quoting from your link:

"Secondly, if you toss a coin nineteen times and it comes up heads each time, then it is not more likely that the next toss will be a tail."

I think this is the fallacy you are refering to. Joeball123 didn't do that. An example for doing it would be:

I have a probability of 93.75% to get at least 1 heads in four coin flips. Now I flip 3 times tails and assume that the probability of the fourth flip coming up heads is 93.75%. That would be wrong because then it is no 1 heads out of 4 flips but 1 heads out of 1 flip and therefore 50%.