BahamutoD / BDArmory

Gun turrets and other weapon systems for KSP
38 stars 112 forks source link

Bullet heat is applied to the wrong part (may be a KSP issue) #39

Closed allmhuran closed 8 years ago

allmhuran commented 8 years ago

This is easier to show than tell. First, here's a short video comparing how laser heat is applied compared to how bullet heat is applied. I thought this was something to do with physicsless parts.

youtu.be/0BnRV0s6S_4 Redacted, this is the overkill code.

But here's an image of bullet impacts against a normal physics part. You can see that even in this case, the parent part is much hotter than the part the bullets are actually hitting: By the way, this is after just one hit, so I think bullets might be a little OP... and the huge temperature delta might be breaking the KSP thermal physics simulation.

http://i.imgur.com/jRg4l98.png

More info in this thread on the KSP forum: http://forum.kerbalspaceprogram.com/index.php?/topic/121017-thermal-mechanics-and-physicssignificance/#comment-2478054

allmhuran commented 8 years ago

OK, this dfference between lasers and bullets is coming from the "overkill" heat damage code. The test is not valid because I had to turn on the KSP debug "ignore max temperature" setting, otherwise the bullet instantly destroys whatever it touches. But this means the overkill code is calculating a huge amount of heat to be sent to connected parts.

However, this does mean I'm still at a loss regarding why, for example, IR servos are being blown up when bullets hit, eg, mech legs without destroying the leg. Although this might be the physics significance issue talked about in the KSP forum thread.

Since that looks like a KSP problem I am going to close this issue.

allmhuran commented 8 years ago

While I do believe this is probably the KSP issue confirmed by NathanKell, there's still something I don't quite understand.

Talking about normal KSP for moment: if you mouse over a physicsless part on a launched craft, the physicsless part does not get highlighted, its parent does. This may be a clue regarding the raycasting "hitting" the parent.

But if the raycast is hitting the parent transform, then how does BD Armory know where to correctly render the impact effect?

Also, as I mentioned earlier, BDA lasers correctly apply heat to the physicsless parts (not the parent).

This picture describes my confusion