0
$\begingroup$

I'm making a game that can fuse few guns to create an equal gun and I need to compute the fused properties.
First off I thought this was easy - I just took the inverse of the sum of the inverses of the times between shots and took the mean of the damages:
Lets say we have 2 guns:

Gun 1: Damage: 10, Time between shots: 2 seconds
Gun 2: Damage: 20, Time between shots: 3 seconds
Combined: Damage: 15, Time between shots: 1.2 seconds

And it works, Gun 1 has damage per second of 5, Gun 2 has damage per second of 6.66 and the combined gun has damage per second of 12.5 =/= 11.66.
How do I find this? I need to find the damage for n number of guns, not just 2.

In addition, this is not the only gun type I have... I also have a chain lightning gun which shoots and then its shot jumps from target to target (with a max of targets) and the damage reduces by a set number every jump.
So the gun:

Damage: 1000, Targets: 4, Reduction: 0.5, Time between shots: 5 seconds

Will shoot the target for 1000, jump to another for 500, and more for 250 and 125 resulting in 1875 damage or 375 damage per second.
How can I find the properties of few merged chain lightning guns that can have different properties? I know its something exponential, and exact solution might not be feasible, an approximation a script can perform will be good enough.
I have not found a tag for this, so please tag it who knows the right tag.

1 Answers 1

1

For the first question, you can find the firing rate as you are. Then if you sum the damage per second of the original guns, divide by the new firing rate to get the damage per shot. So in your example, the original guns total $\frac{35}{3}$ per second, so the new gun should do $1.2\frac{35}{3}=14$ per shot to give the same damage per second.

For the second, you need to specify how you add different characteristics. For example, if one can shoot 4 targets and a second 6, should the merged gun be able to shoot 4, 5, 6, or 10? If you merge one with a reduction of 0.5 with a reduction of 0.6, what do you want? It sounds like you want to keep the total damage/second constant, but there are many ways to do this. If make a second example with one that does 1500 damage on the first shot, 3 shots, 20% reduction, 10 seconds between shots, this does $1500+1200+960=3660$ per $10$ seconds or 366/second. Then if the merged unit has 4 shots at 35% reduction and 7.5 seconds interval, you can just say the shots are $a, .65a, .65^2a, .65^3a$ for a total of $\frac{2.347a}{7.5}$ per second. If this should be $375+366=741, a=2368.$