So I did an extensive search and I found different results when it comes to offense and defense. Let's focus on the beam and shield first. I read somewhere that for an attacker a role is made between 1 and beam attack let's call it X. For the defender then a role is made between 1 and the shield defense let's call it Y. The amount of damage then is calculated as X-Y. The shield is also depleted by the sqrt of the beam attack. Elsewhere I found that 50% of the damage is done until the shield completely is gone. So I don't know which method gives the correct damage. I also was wondering if the same method is used for the calculation of the damage of missile and kinetic.