A suggestion to solve the defense "bug" (off-type degradation)

I got an idea on how to modify the way defense is accounted in combat that would solve the defense bug. Since I found the solution not totally trivial, I'm posting it in case CodeCritter hadn't got the same idea already.

The goals of my solution are :
- Against only 1 type of weapon, X on-type defense is exactly equal to X^2 off-type defense (like in DL).
- Against 2 or 3 types of weapon, no defense has to be degraded twice. A consequence of that is with only one defense, there won't be any difference between if the enemy has 2 different off-type weapons or have only one kind. (Again, like in DL.) So against shield, 5 guns + 5 missiles is the same as 10 missiles.

The solution :
At the beginning of each round, for each ship, calculate these 4 quantities :
Shield Protection = Shield - sqrt(Shield)
Armor Protection = Armor - sqrt(Armor)
Missile Protection = Missile - sqrt(Missile)
Off-type Protection = sqrt(Shield) + sqrt(Armor) + sqrt(Missile)

When the ship is getting attacked with a particular weapon, its defense is the sum of the appropriate on-type protection and the off-type protection.
The value of the on-type protection is then reduced by the attack value. If the on-type protection is empty, the left-over is removed from the off-type protection. (This order could be reversed.)
14,822 views 34 replies
Reply #1 Top
Do you know what is the current state of the accounting? My understanding is that there has been one attempt to fix the bug already, and I have no idea whether it worked or not.

If you're sure your solution is both correct (it does look correct to me) and currently unimplemented, you should probably try to communicate this to CodeCritter directly. The developers don't have much time to read forum posts; email, IRC, or maybe a forum PM are more reliable methods of communication.
Reply #2 Top

It is resolved in beta 4.

We've had people submit games where they thought there was a bug but having gone through it in the debugger it was a case of the player thinking their ship was better than it was.

Reply #3 Top
it was a case of the player thinking their ship was better than it was.


You gotta believe your ships are da bomb... Well, until their destroyed by a group of Thalan dreadnaughts   

I am glad to hear that is squared away.  
 
Reply #4 Top
Ok, I didn't realize it was fixed (it wasn't mentioned in the changelog). I will try to check more carefully the numbers I get in battle.

What technique did you to fix it? A similar one to mine, or something else?
Reply #5 Top

Here is how it works in beta 4: 

When an attacker fires a weapon of type A and rolls X in attack

   + If the defender has type A defenses, type A defenses are decreased by X

   + If the defender does not have type A defenses:

          + If one off-type defense is greater than the other, the larger off-type defense value is decreased by X

          + If the off-type defenses are equal, one off-type defense is randomly selected and decreased by X

 

 

This, in effect, means that if you do not have the right defense, the defenses you do have will be decreased.  Whichever is larger at the time the shot is fired is decreased, so the larger defense will get decreased first until it is below the other defense value (or it reaches 0).

 

For example:

Ship 1 ( Attack: B: 14 M: 0 MD: 0 )     7 weapons, 2 beam attack each

Ship 2 ( Defense: B: 0 M: 6 MD: 4 )

1.  Ship 1 Weapon 1 rolls 1 attack,  Ship 2 missile defenses are greater than mass driver defenses, so they are decreased by 1

    Ship 2 defenses are now ( B: 0 M: 5 MD: 4 )

2. Ship 1 Weapon 2 rolls 2 attack, Ship 2 missile defenses are greater than mass driver defenses, so they are decreased by 2

      Ship 2 defenses are now ( B: 0 M: 3 MD: 4 )

3. Ship 1 Weapon 3 rolls 2 attack, Ship 2 mass driver defenses are now greater than missile defenses, so they are decreased by 2

        Ship 2 defenses are now ( B: 0 M: 3: MD: 2 )

4. Ship 1 Weapon 4 rolls 1 attack, Ship 2 missile defenses are greater than mass driver defenses, so they are decreased by 1

        Ship 2 defenses are now ( B: 0  M: 2 MD: 2 )

5. Ship 1 Weapon 5 rolls 2 attack, Ship 2 off type defenses are equal, so one type is randomly selected.  This time mass drivers are randomly chosen, so they are decreased by 2

      Ship 2 defenses are now ( B: 0 M: 2 MD: 0 )

6. Ship 1 Weapon 6 rolls 2 attack, Ship 2's missile defenses are greater than mass driver defenses, so they get decreased by 2

      Ship 2 defenses are now ( B: 0 M: 0 MD: 0 )

7. Ship 1 Weapon 7 rolls 1 attack, Ship 2 has no defenses, so the attack will be able to do its full measure of damage.

That is an example of what could happen with the new system.

 

 

Reply #6 Top
Uh oh.

CodeCritter, there is no mention of the sqrt function in your description. Also, what happened to defense rolls?

I strongly suspect that defense is still not working as designed. My training is in mathematics, and I can tell you that Ephafn's solution is correct; you should implement it.

There is still a nontrivial detail regarding how to implement defense rolls under Ephafn's system, which we can discuss if you're interested. But that's not as high-priority as making off-type defenses square-rooted.
Reply #7 Top
Also, what happened to defense rolls?


DA defenses have never rolled; they've always started at their full value and degraded with damage. that said, i also noticed a lack of mention of square roots. do the missile and armor values in your example represent the square roots of their actual values (36-48 and 16-24, respectively)? as i understood it, that was the core of the off-type defense bug -- that while they only provided a defense value equal to the square root of their stated value, the degredation was applied to the un-square-rooted value, making it take exponentially longer to degrade off-type defense than it should. if that in fact was the problem, was it fixed?
Reply #8 Top
DA defenses have never rolled;


Incorrect:
WWW Link

As per the example, there's no r/p/s system anymore. Any defense is as good as any other to defend against a certain weapon type. No reason for the 3 weapon types anymore.
The example doesn't clarify what happens when there is the right defense, in terms of if the other defenses will be decreased also before the hull gets hit.
Reply #9 Top
DA defenses have never rolled; they've always started at their full value and degraded with damage.


No, I think CodeCritter just forgot to mention them. kryo's description of DA combat in another thread does mention defense rolls. And without defense rolls, ships with defense at least equal to opposing attack would be completely indestructible; I think I've seen my Krynn high-defense ships occasionally take 1-3 damage in such battles.

The big question revolves around sqrt.
Reply #10 Top
CodeCritter : That is what I took was your first try at fixing the "bug" (it is more a misfeature than a bug, but still), Frogboy comment made me think that you tried again.

This is where I think that your solution fails:

- Against only 1 type of weapon, X on-type defense is exactly equal to X^2 off-type defense (like in DL).


Let take a totally unbalanced example (which will still happens, mostly with super dominator corvettes) :

Attacker : B: 0 M: 0 MD: 10x2 (10 corvettes)
Defender : B:25 M: 0 MD: 0

To simplify the calculation, assume that both attack and defense always roll the average value (allowing fraction). This will underestimate damage because there won't be any unlucky defense rolls, but it will correctly account for defense degradation.

Your system :

Corvettes always roll 1 attack.
1st one : Defender has 5 effective defense (sqrt(25)), get 2.5, no damage. Defense degrade to 24.
2d-10th ones : Defender has 4 effective defense (sqrt(24 to 16)), get 2, no damage. Defense degrade up to 15.
So the defender is undamaged.


Under my first goal, this battle should have been equivalent to this one :
Attacker : B: 0 M: 0 MD: 10x2 (10 corvettes)
Defender : B: 0 M: 0 MD: 5

1st one : Defender has 5 defense, get 2.5, no damage. Defense degrade to 4.
2d one : Defender has 4 defense, get 2, no damage. Defense degrade to 3.
3th one : Defender has 3 defense, get 1.5, no damage. Defense degrade to 2.
4th one : Defender has 2 defense, get 1, no damage. Defense degrade to 1.
5th one : Defender has 1 defense, get 0.5, 0.5 damage. Defense degrade to 0.
6th-10th ones : Defender has 0 defense, get 1 damage each time.
So the defender got 5.5 damage.

This would be the exact result under my system for the first situation since the defender would get for their protection : B:20 M: 0 MD: 0 Off: 5.


The main difference between both system is when the defender has a lot of off-type defense (more than the half of the total enemy attack). In this situation, the defense degradation is not quick enough since you degrade it in the same way as if it was on-type defense.


I will code some simulator, with both my understanding of the actual code, and my solution.


There is still a nontrivial detail regarding how to implement defense rolls under Ephafn's system, which we can discuss if you're interested. But that's not as high-priority as making off-type defenses square-rooted.


I just put P = On-type Protection + Off-type Protection
Defense roll = rng(0, P)

Unlike the actual system, there is only one roll (not one per defense type).
Reply #11 Top
I just put P = On-type Protection + Off-type Protection
Defense roll = rng(0, P)

Unlike the actual system, there is only one roll (not one per defense type).


When the attacker has two different weapon types, how do you degrade defenses?
Reply #12 Top
When the attacker has two different weapon types, how do you degrade defenses?


With two weapon types, each are shot in succession.
Each weapon will degrade its on-type protection first, and once it is depleted, degrade the shared off-type protection.
Reply #13 Top
Yea, something seems wrong here. I thought the whole point of having 3 types of weapons and 3 types of defenses was that off-type defenses was really bad. It seems that based on CodeCritter's example, pretty much ANY defense is as good as any other. Doesn't that decrease the strategic choices in the game? It also doesn't make any sense from a fluff perspective; how is a point defense gun supposed to degrade phasor fire?
Reply #14 Top
Well, I came up with a way of dealing with it, at least in my opinion. The only downside is instead of each weapon firing alone, all weapons of one type fire at once. However, to me it makes sense, though honestly I am not a master of the exact mechanics, so this may not work. However, I've decided to post it anyways, and take whatever ridcule I receive. Hopefully it helps the discussion. Let me know what you think, but please, be gentle on me ha ha.

L1- Beam weapons ship 1
D1- Mass Drivers ship 1
Mi1 – Missles Ship 1
HP1 – Hit points ship 1

S2- Shields Ship 2
A2 – Armor Ship 2
PD2 – Missle Defense ship 2
HP2 – Hit points ship 2

If(L1>0)
Roll attack 0-L1
If(S2>0)
Roll defense 0-S2
if S2>L1
S2=S2-L1
Else
DMG=L1-S2
S2=0
HP2=HP2-DMG
Endif
Elseif(A2>0)
A2=sqrt(A2)
Roll defense 0-A2
If A2>L1
A2=A2-L1
A2=A2 squared
Else
DMG=L1-A2
A2=0
HP2=HP2-DMG
Endif
Else
PD2=sqrt(PD2)
Roll defense 0-PD2
If PD2>L1
PD2=PD2-L1
PD2=PD2 squared
Else
DMG=L1-PD2
PD2=0
HP2=HP2-DMG
Endif
Endif
Elseif(D1>0)
Repeat similarly as above for rest of them, changing as required for off defenses


Edit: Dang, I was hoping it would keep the formating. Oh well.
Reply #15 Top
Incorrect:
WWW Link


i stand corrected, and i'm not sure why i thought otherwise.
Reply #16 Top
With two weapon types, each are shot in succession.
Each weapon will degrade its on-type protection first, and once it is depleted, degrade the shared off-type protection.


I just reread kryo's description of the current defense behavior, and

(i) okay, you're right that multiple weapon types don't change anything under the current system, but

(ii) that's because the current system gives defenses a bigger bonus over DL's system than I thought.

The quick summary is that nearly no damage gets through until the defenses are pretty much entirely degraded. It's not very different from having no defense roll at all -- a point of defense is worth nearly twice a point of attack. Now, we could leave it this way and say it's by design. But I think players would prefer a system where attack and defense points were on the same scale.

One "right" way to do this, that puts attack and defense points on the same scale, would be:

- At the beginning of each combat round, make FOUR defense rolls: one for each defense type, and one for off-type.

- Instead of one defense roll for EACH weapon roll, there are no further defense rolls; weapon damage degrades the appropriate defense roll that has already been made.


Example: Attacker has two Psyonic Beams, two Anti-Matter Torpedoes, and +39% to attack, so each beam is worth 16 points and each torpedo 9 points. Defender has three Invulnerability Field II and +60% to defense for something like 28 Shield and 5 Off-type Protection (depending on exactly how rounding works).

Defender rolls 0-28 for this round's shield effectiveness, and 0-5 for this round's off-type effectiveness. Suppose the rolls are 17 and 1.

Attacker rolls 0-16 twice for the beams, getting 4 and 6. They degrade the shield defense roll to 7.

Attacker then rolls 0-9 twice for the torpedoes, getting 3 and 7. One point is absorbed by the off-type roll, the other 9 points deal damage. (If the defender was low enough on HPs, the second torpedo could of course target another ship.)
Reply #17 Top

Sorry for the confusion.


CodeCritter, there is no mention of the sqrt function in your description. Also, what happened to defense rolls?

For clarification:

The battle system still works as it did before.  The only change is how the max defenses are decreased over the course of the round.

Off-type defenses still use the sqrt function when rolling.  What the beta 4 system does is roll a 0 - sqrt (sum of offtypes) for defense.  The sum of offtypes changes are the offtypes are decreased after each attack roll.

So, a more DETAILED description of my previous example would be:

Ship 1 ( Attack: B: 14 M: 0 MD: 0 )     7 weapons, 2 beam attack each

Ship 2 ( Defense: B: 0 M: 6 MD: 4 ) HP: 20

1.  Ship 1 Weapon 1 rolls 1 attack, Defense rolls 0 - sqrt ( 6 + 4 ) and gets 2.  Damage done is attack 1 - defense 2 so no damage is done.  Ship 2 missile defenses are greater than mass driver defenses,they are decreased by the value of the attack roll 1.

    Ship 2 defenses are now ( B: 0 M: 5 MD: 4 ) HP: 20.

2. Ship 1 Weapon 2 rolls 2 attack.  Defense rolls 0 - sqrt ( 5 + 4) and gets a 1. Damage done is attack 2 - defense 1, so 1 hp is removed. Ship 2 missile defenses are greater than mass driver defenses, so they are decreased by 2. 

      Ship 2 defenses are now ( B: 0 M: 3 MD: 4 ) HP: 19

3. Ship 1 Weapon 3 rolls 2 attack. Defense rolls 0 - sqrt ( 3 + 4 ) and gets a 0. Damage done is attack 2 - defense 0, so 2 hp is removed.  Ship 2 mass driver defenses are now greater than missile defenses, so they are decreased by 2

        Ship 2 defenses are now ( B: 0 M: 3: MD: 2 ) HP: 17

4. Ship 1 Weapon 4 rolls 1 attack. Defense rolls 0 - sqrt ( 3 + 2 ) and gets a 2. Damage done is attack 2 - defense 2, so 0 hp is removed. Ship 2 missile defenses are greater than mass driver defenses, so they are decreased by 1

        Ship 2 defenses are now ( B: 0  M: 2 MD: 2 ) HP: 17

5. Ship 1 Weapon 5 rolls 2 attack. Defense rolls 0 - sqrt ( 2 + 2 ) and gets a 1.  Damage done is attack 2 - defense 1, so 1 hp is removed.  Ship 2 off type defenses are equal, so one type is randomly selected.  This time mass drivers are randomly chosen, so they are decreased by 2

      Ship 2 defenses are now ( B: 0 M: 2 MD: 0 ) HP : 16

6. Ship 1 Weapon 6 rolls 2 attack. Defense rolls 0 - sqrt ( 2 + 0 ) and gets a 0. Damage done is attack 2 - defense 0, so 2 hp is removed. Ship 2's missile defenses are greater than mass driver defenses, so they get decreased by 2

      Ship 2 defenses are now ( B: 0 M: 0 MD: 0 ) HP: 14

7. Ship 1 Weapon 7 rolls 1 attack. Ship 2 has no defenses, so the attack will be able to do its full measure of damage.  No defenses are left so no defenses get decreased.

      Ship 2 defenses are now ( B: 0 M: 0 MD: 0 ) HP: 13

  8. Ship 2 fires its weapons in the same manner

9. At the beginning of the next round, each ship's defenses are restored to their full values.


When the attacker has two different weapon types, how do you degrade defenses?

Ephafn is right.  Each shot is fired is done in succession.  So the first shot would decrease whichever defense was greater (or randomly pick which if they are equal).  Then the second shot would have to go up against the changed defense values.

I hope this clears things up.  If you still have any questions, please don't hesitate to ask

 

 

Reply #18 Top
Thanks, the initial post was confusing but the more recent one makes everything clear.
Reply #19 Top
Thanks for the clarification, CodeCritter.

The 1.6b4 system looks better than it was in previous DA builds, it's no longer that far out of whack.

Nevertheless, there is a very significant difference between DA 1.6b4 offtype defenses and DL offtype defenses. Namely, in DA 1.6b4 you really need INDIVIDUAL offtype weapons to be able to do lots of damage, because every weapon has to go up against a new full defense roll. One Psyonic Beam is a LOT better than 12 Lasers now against offtype defenses -- this is not a good thing, given that the Psyonic Beam was already seriously overpowered without this new advantage.

To a lesser but still highly noticeable degree, one Psyonic Beam is better than 12 Lasers against on-type defenses as well, for the same reason.
Reply #20 Top
I finished my simulator, here is the code (C++) :


/*
Compare two methods to calculate the effect of off-type defense in Galciv II
Dark Avatar.
*/

#include time.h
#include stdlib.h
#include math.h

#include iostream

/*
Roll a value in [0,max].
*/
int roll(int max)
{
// Note : I know this is using the low-order bytes, but the simulation is
// not sensitive enough to correlations to be affected.
return rand() % (max + 1);
}

/*
Simulate CodeCritter method.
The off-type square root is taken at the defense roll.

Return the total damage done.
*/
int simulCC(int num_att, int att_str, int on_type_def, int off_type_def)
{
int on_type_prot = on_type_def;
int off_type_prot = off_type_def;

int damage = 0;

for(int i = 0; i < num_att; i++)
{
int att = roll(att_str);
int def = roll(on_type_prot) + roll((int)sqrt(off_type_prot));

// do the damage
damage += (def > att ? 0 : att - def);

// degrade defense
on_type_prot -= att;
if(on_type_prot < 0)
{
// I'm unsure about this part
off_type_prot += on_type_prot;
on_type_prot = 0;
}
if(off_type_prot < 0)
off_type_prot = 0;

}

return damage;
}

/*
Simulate my method.
The off-type square root is taken at the protection initialisation.

Return the total damage done.
*/
int simulMe(int num_att, int att_str, int on_type_def, int off_type_def)
{
int on_type_prot = on_type_def;
int off_type_prot = (int)sqrt(off_type_def);

int damage = 0;

for(int i = 0; i < num_att; i++)
{
int att = roll(att_str);
int def = roll(on_type_prot + off_type_prot);

// do the damage
damage += (def > att ? 0 : att - def);

// degrade defense
on_type_prot -= att;
if(on_type_prot < 0)
{
off_type_prot += on_type_prot;
on_type_prot = 0;
}
if(off_type_prot < 0)
off_type_prot = 0;
}

return damage;
}

int main(int argc, char **args)
{
// Initialise the PRNG
srand(time(NULL));

// Parse the arguments
int num_att = atoi(args[1]);
int att_str = atoi(args[2]);
int on_type_def = atoi(args[3]);
int off_type_def = atoi(args[4]);

std::cout << "Attack = " << num_att << " times " << att_str << " damage\n";
std::cout << "Defense = " << on_type_def << " on-type " <<
off_type_def << " off-type\n";

int num_simul;
if(argc >= 6)
num_simul = atoi(args[5]);
else
num_simul = 1000;

std::cout << "Number of runs = " << num_simul << "\n\n";


// And the simulation!
double sum_x = 0.0; // For the mean
double sum_xx = 0.0; // For the variance calculation


std::cout << "CodeCritter's method\n";
for(int i = 0; i < num_simul; i++)
{
double res = (double)simulCC(num_att,att_str,on_type_def,off_type_def);
sum_x += res;
sum_xx += res * res;
}

double mean = sum_x / num_simul;
double variance = (sum_xx - sum_x * mean) / (num_simul - 1);
double std_dev = sqrt(variance);

std::cout << "Mean damage = " << mean << "\t" <<
"Standart deviation = " << std_dev << "\n";



sum_x = 0.0;
sum_xx = 0.0;

std::cout << "My method\n";
for(int i = 0; i < num_simul; i++)
{
double res = (double)simulMe(num_att,att_str,on_type_def,off_type_def);
sum_x += res;
sum_xx += res * res;
}

mean = sum_x / num_simul;
variance = (sum_xx - sum_x * mean) / (num_simul - 1);
std_dev = sqrt(variance);

std::cout << "Mean damage = " << mean << "\t" <<
"Standart deviation = " << std_dev << "\n";


return 0;
}



And here are a few results.
Note that I only considered 1 attack weapons because that is where the difference between both methods are the largest.


Attack = 10 times 1 damage
Defense = 10 on-type 0 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 0.60265 Standart deviation = 0.769434
My method
Mean damage = 0.60055 Standart deviation = 0.768723

No difference for on-type defense only.

Attack = 10 times 1 damage
Defense = 0 on-type 10 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 1.508 Standart deviation = 1.1619
My method
Mean damage = 3.12321 Standart deviation = 1.70904

Small difference when the defense value is relatively small.

Attack = 100 times 1 damage
Defense = 100 on-type 0 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 0.6891 Standart deviation = 0.827072
My method
Mean damage = 0.68131 Standart deviation = 0.826144


Attack = 100 times 1 damage
Defense = 0 on-type 100 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 5.52587 Standart deviation = 2.31874
My method
Mean damage = 42.0173 Standart deviation = 5.14508

Huge difference here. All the damage that the defensive ship got in CodeCritter's method come from unlucky defense hit (10%~12.5% chance since the defense deplete up to 50). For my method, the defense is quickly depleted since it start at 10 instead of 100. So 40 damage go without defense + 2 from unlucky defense rolls.


Attack = 100 times 1 damage
Defense = 10 on-type 0 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 41.9991 Standart deviation = 5.14446
My method
Mean damage = 42.003 Standart deviation = 5.14562


In this case, the on-type defense is equal to the square root of the previous example off-type defense. Same results than for my algorithm.
Reply #21 Top

off_type_def = (int)sqrt(off_type_def) + (int)sqrt(on_type_def);
on_type_def -= (int)sqrt(on_type_def);


int simulDoJ (int num_att, int att_str, int on_type_def, int off_type_def) {
  int att = 0;
  int i;

  on_type_def = roll(on_type_def) + roll(off_type_def);

  for (i = 0; i < num_att; i++) {
    att += roll (att_str);
  }
  return (on_type_def > att ? 0 : att - on_type_def);
}


Attack = 10 times 1 damage
Defense = 10 on-type 0 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 0.60188 Standard deviation = 0.76868
Ephafn's method
Mean damage = 0.60282 Standard deviation = 0.77383
Dog of Justice's method
Mean damage = 1.21828 Standard deviation = 1.73570


Attack = 1 times 10 damage
Defense = 10 on-type 0 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 1.82094 Standard deviation = 2.58245
Ephafn's method
Mean damage = 1.81956 Standard deviation = 2.58509
Dog of Justice's method
Mean damage = 1.64680 Standard deviation = 2.34200


Attack = 10 times 1 damage
Defense = 0 on-type 10 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 1.51361 Standard deviation = 1.16218
Ephafn's method
Mean damage = 3.12143 Standard deviation = 1.70945
Dog of Justice's method
Mean damage = 3.52087 Standard deviation = 1.89513


Attack = 1 times 10 damage
Defense = 0 on-type 10 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 3.72153 Standard deviation = 3.02684
Ephafn's method
Mean damage = 3.72751 Standard deviation = 3.01743
Dog of Justice's method
Mean damage = 3.71706 Standard deviation = 3.02244


Attack = 100 times 1 damage
Defense = 100 on-type 0 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 0.68638 Standard deviation = 0.82804
Ephafn's method
Mean damage = 0.68257 Standard deviation = 0.82579
Dog of Justice's method
Mean damage = 11.54482 Standard deviation = 15.12348


Attack = 100 times 1 damage
Defense = 0 on-type 100 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 5.54366 Standard deviation = 2.31138
Ephafn's method
Mean damage = 42.02582 Standard deviation = 5.11930
Dog of Justice's method
Mean damage = 45.01311 Standard deviation = 5.90769


Attack = 100 times 1 damage
Defense = 10 on-type 0 off-type
Number of runs = 100000

CodeCritter's method
Mean damage = 42.01329 Standard deviation = 5.13755
Ephafn's method
Mean damage = 42.01815 Standard deviation = 5.11490
Dog of Justice's method
Mean damage = 44.99740 Standard deviation = 5.60740


Remember back when you sent a 100 on-type defense ship against 100 attack, you actually took more than 1 damage? My method faithfully reproduces that DL behavior. With both CodeCritter's and Ephafn's methods, the ship is essentially invincible.

Also notice:

- 100 attack vs. 10 on-type defense or 100 off-type defense = (100-10)/2 = 45 damage with my method, just like in DL.

- My method yields the smallest differences between one 10-attack weapon and ten 1-attack weapons.
Reply #22 Top
The battle system still works as it did before.


Hmm, before this fix you didn't have to degrade both off-type defenses. Now you do, which makes them stronger. Especially at low values when opponent has all types of defense.
So when opponent has the on-type defense, you don't have to degrade (both) the off-types?
Isn't there the risk of NOT having the on-type defense but having the other two types actually being better (than having the on-type)?
Reply #23 Top
every weapon has to go up against a new full defense roll

As far as I can tell this is the reason why defenses are much stronger in DA than they were in DL: Imagine 5x10 beam shooting against a 50 shield. Each attack rolls from 0-10, but the defense starts at 0-50 and goes down by 5 points on the average, resulting in about 0-30 (!) for the last shot. Total damage inflicted will probably be very low overall, although the numbers (equal attack and defense value) suggest otherwise.

Additionally, maybe off-type defenses should degrade by the square of each hit in order to account for the original sqrt functionality - that might be overdone though.
Reply #24 Top
What you have to bear in mind is that as the weapons become more potent, they have that little bit more potential to roll higher than defence and cause some bleed-through hull-damage. Low-damage weapons are invariably going to be spent wearing down any defencces before doing damage.
Reply #25 Top
What you have to bear in mind is that as the weapons become more potent, they have that little bit more potential to roll higher than defence and cause some bleed-through hull-damage. Low-damage weapons are invariably going to be spent wearing down any defencces before doing damage.


Yes, but at the same time the defense will be higher, what really count for how much damage will leak through the defense is ration between the individual weapon strength and the total defense.


Attack = 10 times 10 damage
Defense = 100 on-type 0 off-type
Number of runs = 1000000

CodeCritter's method
Mean damage = 2.67089 Standart deviation = 3.78391
My method
Mean damage = 2.67394 Standart deviation = 3.77988

Attack = 10 times 10 damage
Defense = 0 on-type 100 off-type
Number of runs = 1000000

CodeCritter's method
Mean damage = 21.5849 Standart deviation = 8.95287
My method
Mean damage = 44.0213 Standart deviation = 10.5264


In this example, the will be a lot of damage leakage even with CodeCritter's method since the reduced defense (10) will be similar to the individual weapon damage.