ferram4 / Ferram-Aerospace-Research

Aerodynamics model for Kerbal Space Program
Other
238 stars 131 forks source link

1.2.2 SPH Problems #157

Closed Maeyanie closed 7 years ago

Maeyanie commented 7 years ago

Using FAR ea259a, KSP 1.2.2, and MFI 1.2.3, on a heavily-modded install.

I put together some plane bits, clicked the "Show CoL" button, it flickered for a moment then vanished. FAR's UI didn't work either. Checking the log, there seems to be a number of different errors. It's attached.

This seems to be a mod-interaction issue, as I wasn't able to reproduce it with a minimal set. I'll see if I can narrow down exactly what caused it and update this thread.

output_log.zip

Maeyanie commented 7 years ago

Found it. Steps to reproduce: Add an F-5 cockpit from the MTA Stockalike mod. FAR fails to voxelize it, and everything breaks. Possibly other parts too, but that's the one I happened to find. Logfile from that attached, so you don't have to look through the huge one. output_log minimal.zip

ferram4 commented 7 years ago

I'm investigating, and there appears to be at least one bug in this that I've already fixed. However, I'm not exactly sure what the cause of everything going NaN is and while I might be able to fix it, usually that points to issues with the mesh itself in some way.

Maeyanie commented 7 years ago

Still seems to happen in ea8f428c07e8da68aaecbd54176779bee6eb8214. Though I did notice loading a craft which contains the broken part seems to work fine, it's just creating a vessel by adding a new one which breaks.

Edit: Yeah, seems to be something with those parts specifically. I tried another cockpit-intake combo from a different mod and it works fine.

NathanKell commented 7 years ago

self-poking so I remember

ferram4 commented 7 years ago

Found it! So the problem did come down to the embedded intake module, in a roundabout way. It's also related to the main axis determination system as well.

So in order to determine the main axis I use a lot of hints about vehicle shape, one of those being intake orientation, since those should be (largely) facing forward. But I can't just use the intake part orientation, because that's all over the place compared to the directional intake transform on the mesh. So I use the intake transform from the mesh.

But sometimes that's borked for a mod part due to insufficient testing, so I fall through instead and provide no contribution to the main axis from that part if that happens. But if that's the only part, there is no main axis data. It tries to work with a (0,0,0) vector for that and it breaks.

So I added a failsafe for that and now it works, thanks for the report!