-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash with principia when dropping item #221
Comments
Principia co-author here: well "doing the wrong thing" is maybe an overstatement 😉. We believe that you create a vessel with no parts, and then add the part later (in another frame? after it is in the right state?). Is that possible? Do we have a way to tell that such a vessel was created by you? We need the parts to do our physics computations and we fail on a vessel-with-no-parts because we assume that our code broke some invariant. |
@pleroy Indeed, KIS do weird things in the game since there is no a good way to spawn an arbitrary part (no public interface is offered by the game core). So I had to re-invent the process, and there were some corners cut. You've mentioned the vessel without parts is the problem, are you referring the |
@ihsoft Other Principia co-author here, since @pleroy is away today. Specifically, we require the following invariant that seems not to hold in @warmist's save: @warmist's logs show that a vessel called Further, @warmist mentions dropping an item, and from the logs, seems to have successfully attached solar panels already, so the issue seems to be specifically with dropping. From digging through the KIS codebase I am guessing dropping an item ends up calling [1] This essentially means flying sufficiently high, and excluding weird edge cases; we intend to change the requirement of "sufficiently high" to "not touching the ground, including via other vessels" soon anyway). [2] Ideally we would like the parts to have been around since the [3] Removal and destruction of parts are logged on our side; previous logs are from a solar panel being added to the station three and a half seconds earlier and are thus unrelated. |
I just wanted to say that now reading it again it looks like i sound little bit like a jerk. Sorry, i'm a big fan of both mods and they are both great :) |
@pleroy @eggrobin I did some research on this matter and found out that the problem is not the I'm going to break the contract, and promote the part to physical before it's actually expected to become physical. I.e. you'll get it unpacked and fully physical in the |
@warmist No worries. You've reported the problem, and this is what was important. |
@ihsoft Interesting; for what it's worth, when an EVA Kerbal is spawned (this is one case where the game spawns a vessel and a part while flying), it appears to have a rigid body immediately, since we did not encounter this particular issue* with EVAs. Would it be enough to simply set * We encountered a different issue with unready EVA Kerbals, namely mockingbirdnest/Principia#1452, but that was because the game nudges them for a while, which as far as I can tell is not the case for KIS's single-part vessels. |
It could solve this particular issue, but it would also introduce an inconsistency: a packed part with a physical behavior. One of the differences between the packed and unpacked part is existence of the rigidbody. Since now I'm forcing the RB creation (by resetting the flag), I have to deal with the state as well. I'm still violating the contract since now the init module methods are called on a physical part, but at least there is no state inconsistency. As for the kerbal vessel as a reference, it's very different from a regular vessel. IIRC, the kerbals don't exist in the packed state. |
Is that really an inconsistency? Parts retain their rigid body (and their physical significance) while packed (for instance when timewarping), I think it only changes when a physically insignificant part gets decoupled (in which case that part is made significant). |
Time warping is different. When it starts the parts get packed, when time is back to x1, the parts get unpacked. Of course, the rigidbodies are not dropped since it would destroy all the joints as well. However, when the vessel is loaded (e.g. when it enters into the physical range), all the parts are packed and there are no rigidbodies. Some parts create RB in the |
I've reported this to principia and it seem you are doing the wrong thing (not them) (tm)
mockingbirdnest/Principia#1549
The text was updated successfully, but these errors were encountered: