As part of refactoring unit, I discovered there is no possibility of merging missile with missile_generic without refactoring the collision code. However, when I started looking at that code, I discovered it's mostly an unclear patch on top of more patches.
I played the current version of master and started colliding into things and the code we have now is no good. Once I collide with something, unless I die, I am stuck within the other unit and can't disengage on my own.
My proposal
@BenjamenMeyer , I think you may want to put this to a vote. I try not to introduce new bugs into the game when refactoring, though it seems that it is very hard not to, given the current state of the code.
We should also discuss this further within the issue.
@royfalk I will be quite willing to test the collision code, just point me to a branch on your tree.
From my point of view, having something that we can fix is much better than something that is un-fixable.
With a bunch of testing I am sure that we'll iron out all the bugs on the proposed change and that will make for a clear winner.
@royfalk let's clean it up. We should only have a clear path into the collision code and it should be easily traceable. We should also have easy tracking of assets. If a missile can't be managed through a clear hierarchy then something is wrong and we need to fix it at the fundamental level; even if it temporarily introduces more bugs it'll be cleaner and easier to work with in the long run.
Assigning this to 0.7.x for now. If it's too much we can move it to 0.9.x.
A not so brief discussion of what I've learned:
Proposed damage model

Where:

Discussion
I don't have the physics background some of the original contributors do, but have some. So some rambling thoughts on this...
Keep in mind, in Physics:
Damage is the application of the final resulting force on a given object. Relativistic speeds don't really change this basic calculation at all.
Damage = ((theta * (v1 * m1)) + (theta * (v2 * m2))) * Object Damage Factor = theta * (v1 * m1 + v2 * m2) * Object Damage Factor
where v1 and m1 are one object, and v2 and m2 are the other object; theta tries to account for the angle of intersection to increase/decrease the force appropriately, and Object Damage Factor is a weapons based figure for the power of the weapon (e.g a basic laser might be 0.01 while a dumb fire missile would be 1; this value can be assigned to each weapon). While we're working a 3D space, it can be probably be calculated based on a simpler 2D plane based on the line of travel of each object. In the simplest terms.
Object Damage Factor could be scaled for application in different realism settings.
I'm not sure which method is better to pursue...
I've seen comments in the code that indicate that damage from collisions between NPCs is being capped at 50%, since the NPCs bang into each other so often. The comments further say that once the AI is improved to the point that this stops happening, then a more realistic damage calculation can be applied.
Per #325 we will do what we can now to improve things with a long term goal of fixing it full in 0.9.x
_I've seen comments in the code that indicate that damage from collisions between NPCs is being capped at 50%, since the NPCs bang into each other so often. The comments further say that once the AI is improved to the point that this stops happening, then a more realistic damage calculation can be applied._
I wouldn't worry too much about that. The actual code has disabled damage from NPC - NPC collisions already. By already I mean the previous devs disabled this, not me.