Jump to content

Programming Q: Is it possible to count multiple parts of the same type as 1 part?


justmeman117

Recommended Posts

First thing's first, I am NOT a programmer. This is why I am asking a stupid question.

So I was checking out the space station sharing thread, when I read one guy built a torus that needed an over 400 part launcher. Anyway, that got me thinking about possible ways to better optimise the game.

Would it possible to count multiple parts of the same kind on one ship as only one part? For example, let's say your ship has 50 struts. Would it be possible to count all 50 struts as just ONE strut, thereby reducing the part count?

Correct me if I'm wrong, but isn't it mostly rendering the part that requires the most processing power? So, would it be possible to put one strut on your ship, then have all further struts simply copy its rendering? It would look sorta like "strut # 36 rendering: see strut # 1".

The idea would be that the game is TECHNICALLY only rendering one part, but you can get dozens of parts out of that.

If location is the problem, then perhaps you could just add some translation and rotation values, kinda like "strut # 36 = strut # 1 + xyz + x°y°z°"

Finally, if this IS possible, is it still possible to simulate the physics of each individual part in spite of the copied rendering? Or is it physics and not rendering that requires the most processing power in the first place?

Link to comment
Share on other sites

What you're suggesting is actually kind of accomplished by the part welding mod, which "welds" multiple parts together so that there are less fewer (thanks Javster :P) physics calculations done overall (since physics is where part limitations come in, not rendering).

Edited by magico13
less to fewer
Link to comment
Share on other sites

that's kinda cheaty though. If the craft wouldnt support itself without the mod, then you could use it to get around that.

What I'd like to see is a compromise between the 2. In which the entire craft is "welded", but becomes unwelded when the craft goes past a certain physics threshold, at which point, the craft starts to break apart or disintegrate.

For example, a plane is welded until it turns too hard, then the physics kicks in for individual parts.

- - - Updated - - -

although, what i do like about the welding mod is that it allows you to better make hollow structures.

Edited by justmeman117
Link to comment
Share on other sites

About that rendering question: that's exactly how it's done. Copies of the same parts don't duplicate all the resources, they just reference them. You still have to render them all, you can't just copy finished render, as you see those parts from different angles.

But, as others have said, rendering isn't the biggest problem in KSP, physics is.

Link to comment
Share on other sites

What I'd like to see is a compromise between the 2. In which the entire craft is "welded", but becomes unwelded when the craft goes past a certain physics threshold, at which point, the craft starts to break apart or disintegrate.

If I had designed KSP, it would have basically done something like that. One difference would be that stages would generally be one part, with their overall strength determined by a weighted (by mass of course, heh) average of all parts in that stage.

(There'd also be a lot more focus on configuring the internals of a given part, like pods and service modules and such. No gluing a stupid probe core on the outside etc)

Link to comment
Share on other sites

that's kinda cheaty though. If the craft wouldnt support itself without the mod, then you could use it to get around that.

What I'd like to see is a compromise between the 2. In which the entire craft is "welded", but becomes unwelded when the craft goes past a certain physics threshold, at which point, the craft starts to break apart or disintegrate.

For example, a plane is welded until it turns too hard, then the physics kicks in for individual parts.

- - - Updated - - -

although, what i do like about the welding mod is that it allows you to better make hollow structures.

You inspired me to try something like that now. I am now designing in my head how it will work: Stage by Stage(separated by decouplers or docking ports) it will divide the ship and take the individual stages and compress them to 1 parts-engines will be separate to not get any weird bugs. this will happen once you load a craft and will return the craft to it's original way after you unload it so it will be possible to work with outside of the mod (also better on disk management) this is the base idea but it would probably deal with some weird stuff like animations and pods

Link to comment
Share on other sites

Physics - all the parts act on all the other parts, or do they? Welding certainly helps but exactly how the welding works can give 'odd' results itself.

Rendering - is based on the number of polygons making-up the object or objects; how complex it is. Welding really doesn't do anything for that although there is some scope for hidden-face removel (eg; where fuel tanks connect end-to-end you can just forget the faces that can't be seen).

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...