Ephafn Ephafn

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

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,825 views 34 replies
Reply #26 Top
The battle system still works as it did before.



It seems that strategic weapons and defence planning are no longer a part of this game. You used to be able to look at your opponent's ship and equip your fighters with the correct weapons and defence to beat it. Now, it does not matter which weapon or defence you use.

If and attacker with only lasers attacks a ship with no shields, it should be reducing the hit points of that ship regardless of other defences. It was bad enough before, but now you have to wear down all defence systems on the ship before you can damage it at all.

I am fairly new to this game, so I can't help but wonder what was the driving force that turned such a simple thing into a complicated formula requiring square roots of this and rolls of dice and if this and if that. Wow, enough all ready. Let me remind you of the "KISS" principle. Keep it simple ____ .

Why not get rid of the darn "leak through defence" concept all together? The defence you buy is what you get. Why should a missile defence system stop a laser or a big black hole comming at you? Not only does it not make any sense, but why would you want that feature in the first place? A level one laser shoothing at a level 10 force field is like shoting at a bullet proof jacket with a pea shooter and expecting it to degrade the jacket if you shoot enough at it. Its seems unrealistic to me!

To add some realism, the jacket would be weakened if your keep shoting it with a 22 cal. riffle, you could damage it faster if you shot it with a 32 cal. Using a 44 magnum, you could do some damage to the person wearing it. If you shot an armour peircing round, you would cause lots of damage. If you used a bazooka, pow, he is history. Could the game use a similar concept? So you would need a weapon stronger than the shield's power level to affect it.

Reply #27 Top
The battle system still works as it did before.



It seems that strategic weapons and defence planning are no longer a part of this game. You used to be able to look at your opponent's ship and equip your fighters with the correct weapons and defence to beat it. Now, it does not matter which weapon or defence you use.

If and attacker with only lasers attacks a ship with no shields, it should be reducing the hit points of that ship regardless of other defences. It was bad enough before, but now you have to wear down all defence systems on the ship before you can damage it at all.

I am fairly new to this game, so I can't help but wonder what was the driving force that turned such a simple thing into a complicated formula requiring square roots of this and rolls of dice and if this and if that. Wow, enough all ready. Let me remind you of the "KISS" principle. Keep it simple ____ .

Why not get rid of the darn "leak through defence" concept all together? The defence you buy is what you get. Why should a missile defence system stop a laser or a big black hole comming at you? Not only does it not make any sense, but why would you want that feature in the first place? A level one laser shoothing at a level 10 force field is like shoting at a bullet proof jacket with a pea shooter and expecting it to degrade the jacket if you shoot enough at it. Its seems unrealistic to me!

To add some realism, the jacket would be weakened if your keep shoting it with a 22 cal. riffle, you could damage it faster if you shot it with a 32 cal. Using a 44 magnum, you could do some damage to the person wearing it. If you shot an armour peircing round, you would cause lots of damage. If you used a bazooka, pow, he is history. Could the game use a similar concept? So you would need a weapon stronger than the shield's power level to affect it.




I agree with you on the overcomplication-thing.
Reply #28 Top
Wearing down defenses is the solution to having individual weapons fire at separate targets. It used to be, one ship fired all its guns at the other, one offense roll vs one defense roll.

Now since each gun can fire at a different target, it has to 'wear' it down during the round so later shots can actually damage the ship.

Reply #29 Top
Defences are now cheap enough and small enough that if you needed all three you could fit them. Therefore it may not be such a bad idea to drop off-type defence or place more limits on how it can perform.

Off-type plays a role in avoiding the phalanx-beats-battleship scenario where the AI is left completely defenceless when the human player starts using a weapon that they can't effectively block. If you haven't been gathering intelligence on the fleets of your enemies (and friends) and acquiring or developing appropriate defences, it should be no surprise when you get mowed down by star destroyers.

If off-type defence were to be dropped, I would suggest that the first rung on the defence ladder be a decent one. If an AI is caught flat-footed it can start installing basic defence modules (armour shields or anti-missile) which, while taking up space and costing money that could be used for weapons, stops those first few hits and prevents a fleetwide massacre from occurring.

Defences which are effective but only against on-type weapons mean that only one weapon at a time is weakened. Given that defence can be worn down by the on-type weapon during the combat round, it should be able to take some punishment before failing.
Reply #30 Top
I am fairly new to this game, so I can't help but wonder what was the driving force that turned such a simple thing into a complicated formula requiring square roots of this and rolls of dice and if this and if that.


I think they were trying to be different. It turned out to be an unrealistic and senseless system though. It also doesn't help that they went overboard with the weapons descriptions, like using warp fields in battle and black holes, which can be affected by the most basic defense systems.
It's really a trend in the game, overcomplicating what could be simple.

So you would need a weapon stronger than the shield's power level to affect it.


Yep, but you know, (unfortunately) logic has nothing to do with it. (sigh)
Reply #31 Top
Having three flavours of weapon and three of defence makes things interesting enough. The limitation of these weapons is that their mechanics are essentially the same - if you roll higher than defence you cause hull damage and defence is lowered, if not the defence sucks up all the damage.

It would make some sense to complicate things so that the high-end weapons can partially or even completely bypass the low-end defences, or affect more than one ship at a time. That increases the pressure on the AI and the human player to keep up in the arms race and makes the right defence useful.

Wars should not always be won by filling your ships with Doom Rays though. If history has taught us anything it's that bigger and more destructive weapons are not necessarily better. Certainly in GalCiv it's your economy which determines how long you can afford to stay at war - and the more advanced your ships are, the less of them you can afford to run. That is something which I don't think should change, but the combat system currently favours the least economical approach.
Reply #32 Top
Wars should not always be won by filling your ships with Doom Rays though.

Yeah, and that is the way it was when DA first came out. I'm glad that defense is stronger. So has it been confirmed that off-type is now degrading as intended? I don't have a copy of the beta or the time to test myself.

That small weapon attack values are less worthwhile just adds to the arms race, and is actually an advantage for the AI, IMO. They can often be single minded about getting higher in their favorite weapon tree. It also helps the less cost efficient weapons (Nano Ripper) to have some value to all that money you are spending.

Generally, I'm in favor of the AI getting all the help it can, so on balance it is not a bad change. Considering that the AI is also much better about holding onto its top weapon techs also helps to improve the situation strategically for the AI.

- Wyndstar
Reply #33 Top
So has it been confirmed that off-type is now degrading as intended?



Yes, somebody from Stardock (a programmer, though I don't remember who) recently said that he couldn't see any problem. He thought any new reports were the result of people not entirely understanding the system or falsely estimating their chances.

Reply #34 Top
He thought any new reports were the result of people not entirely understanding the system or falsely estimating their chances.


Um, look at replies #20 and #21 in this thread. Particularly,

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

CodeCritter's method (i.e. how 1.6b5 works)
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


Very strong off-type defense performs a LOT better than its square root on-type value under the 1.6b5 implementation (because defense degrades just as slowly for off-type defense as for on-type). There are multiple ways to fix this, and it's not immediately obvious to me which is better for the game. (See this Galactic Core thread.) But I don't think there's any question that a bug does remain.