The point of origin should probably match up (or at least be close) to the posZ of the damaged device to prevent the possibility of smoke coming from somewhere not even attached to the ship. See attached screenshots; one of them looks fine, the other… not so much.
Nah it's fine. THe fire just went out......side.
It just wanted some fresh space - air.
This is hard, unfortunately, because we don't know the posZ value at the time of impact, since we're hit testing against a 2D sprite.
If you can get the position of the device (including posZ) through objGetItemProperty and the game engine can determine where to render an effect at that position and posZ for a given rotation, shouldn’t it be possible to check which device is being damaged when the overlay is going to be applied, get the weapon’s position and posZ, reverse-engineer where it would be at a posZ of zero, and put the overlay at that spot with the posZ applied? (I’m asking because I tend to do that sort of thing on a fairly regular basis while playing in POV-Ray.)
EDIT: I may not have explained this well — it was early when I typed it up and I was still uncaffeinated — and things were a bit too hectic at the end of the stream to really explain it in any depth. I’m going to work out some sort of pseudo-code logic on it and see if that doesn’t maybe make a bit more sense.
Check if the shot damages a device.
If it does, get the device’s posZ.
Assume the shot’s hitPos is at that posZ.
Calculate where the hitPos would be if shifted from that posZ to a posZ of 0.
Create overlay at newly calculated position and with the damaged device’s posZ.
I might be overlooking something in that line of thought, but I think that should get the damage overlays to line up on the ship sprites a bit better.
@AssumedPseudonym: You're right, I'd forgotten that case. We won't be able to do it in all cases (such as the venting that happens on cargo compartments) but we should be able to do it for devices.
Unfortunately, overlays do not currently have a Z position, but that's something we should fix.
Fixed in 1.8 Beta 4. When a device is hit, we put the overlay at the proper Z position. Note, however, that when hitting a cargo compartment or engine, we still don't know the proper Z position, so we can't fix those cases.