KerbonautInTraining

[IDEA] Splitting vessels in 1.1 to utilize multiple CPU threads

Recommended Posts

In 1.1 each vessel will have 1 CPU thread to play with. In most cases, this won't load your CPU very heavily.

I'm gonna cut to the case here, what if you could have multiple vessels rigidly connected, but not considered a single merged vessel according to the physics engine?

I'm proposing a type of decoupler or docking port. This could be used for:

1. Dividing space stations

2. Dividing large interplanetary ships (i.e. propulsion stage and lander)

3. (My fav) Dividing payloads from their launch vehicles.

Problems/solutions:

P: Any time the ships are on rails they will drift apart.

S: Don't allow time warp until the part re-connects all vessels. (This could be done in the background)

P: Resource/crew transfer will be impossible 

S: Allow the vessels to be connected temporarily through the part's right click menu, although framerates will plummet.

I have no idea how this would be coded, I do know it's possible to some extent through KAS's pipes, perhaps a variant of that could be used? Discuss!

(I'm writing this on my phone, later today I'll probably update this with more info)

Edited by KerbonautInTraining

Share this post


Link to post
Share on other sites
44 minutes ago, KerbonautInTraining said:

I have no idea how this would be coded, I do know it's possible to some extent through KAS's pipes, perhaps a variant of that could be used? Discuss!

The KAS winches allow vessels to be physically connected but not docked. Maybe that code helps.

Share this post


Link to post
Share on other sites
2 hours ago, KerbonautInTraining said:

rigidly connected

I suspect this part would kill it. To make them rigidly connected, you need to have the motion of one vessel exert forces on the other vessel, which means they can no longer be processed completely in parallel; one core would need to tell the other that it needs to do some extra processing and possibly wait for it to finish, at least partially serializing the physics pass. And if you're rotating or thrusting, those forces will happen continuously. Which is pretty much exactly what happens between parts on a single vessel today, so the performance ought to be similar.

Now, mini-fleets would make sense. Rather than a huge docked spaghetti noodle contraption, put five separate specialized ships within 200m of one another and have them all burn for Jool. The load on rails is already minimal, and when you come out of time warp, you get to take advantage of multiple cores. I could see that working very well.

(Disclaimer: Of course, 100% of the above is speculation till 1.1 ships.)

Share this post


Link to post
Share on other sites
37 minutes ago, HebaruSan said:

I suspect this part would kill it. To make them rigidly connected, you need to have the motion of one vessel exert forces on the other vessel, which means they can no longer be processed completely in parallel; one core would need to tell the other that it needs to do some extra processing and possibly wait for it to finish, at least partially serializing the physics pass. And if you're rotating or thrusting, those forces will happen continuously. Which is pretty much exactly what happens between parts on a single vessel today, so the performance ought to be similar.

But as of now, you could easily connect 2 vessels through, say, a lattice of trusses and they'd still be 2 separate vessels. One would have to figure out how to connect the vessels reliably, thinking about it I'm pretty sure a type of docking port would work best. (I.e. it uses some sort of über magnet to hold them together)

I'm almost certain they would stay in separate threads, seeing as merging 2 vessels into one thread upon contact would be pretty clunky. 

Edited by KerbonautInTraining

Share this post


Link to post
Share on other sites
10 minutes ago, KerbonautInTraining said:

But as of now, you could easily connect 2 vessels through, say, a lattice of trusses and they'd still be 2 separate vessels. One would have to figure out how to connect the vessels reliably, thinking about it I'm pretty sure a type of docking port would work best. (I.e. it uses some sort of über magnet to hold them together)

True, but in current versions we're already accepting that all physics processing is serialized. There is currently zero difference between two smaller vessels and one big vessel made up of the same parts as those two. The question was how the two-vessel case will work in 1.1 if we try to rigidly connect them and whether it will be faster.

10 minutes ago, KerbonautInTraining said:

I'm almost certain they would stay in separate threads, seeing as merging 2 vessels into one thread upon contact would be pretty clunky. 

They don't have to be merged to see an equivalent performance degradation. All that's needed is for there to be a dependency where the two threads are signalling and reacting to each other due to interaction between the vessels.

Share this post


Link to post
Share on other sites

Well, I think what I'll do is wait until 1.1.

I'll run a test with 2 large vessels docked, undocked, and undocked while touching, then compare performance throughout.

If the results show equally high performance between undocked and undocked while touching then I'll revive the thread. If not, I'll let it dissolve into nothing

Share this post


Link to post
Share on other sites
3 hours ago, KerbonautInTraining said:

Well, I think what I'll do is wait until 1.1.

I'll run a test with 2 large vessels docked, undocked, and undocked while touching, then compare performance throughout.

If the results show equally high performance between undocked and undocked while touching then I'll revive the thread. If not, I'll let it dissolve into nothing

Oh, I'd be interested in the results regardless of how they turn out. Please do share your findings!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now