Jump to content

Discussion: Optimization


Recommended Posts

3 minutes ago, TheDestroyer111 said:

It is true for, depending on sources, 50 to 100 percent of KSP players. And I played many games, none of which were so crashy.

Ok, so since you are pulling statistics out of thin air now, I think you have lost all credibility here.  Seriously.  Have you asked all the KSP players in the world?  How do you know it's 50 to 100%?  Please do show me your sources.

Edited by Alshain
Link to comment
Share on other sites

2 minutes ago, soulsource said:

Planets are already always "on rails", meaning their current position is a very simple formula that just depends on time, with no physics involved at all. I doubt that it would be a big performance change to replace that by bone animation.

There are still some physics involved.  Mainly gravitational physics.  If you send a craft flying near a planet or moon with both of them on rails in the tracking station it's trajectory will be altered.

1 minute ago, TheDestroyer111 said:

Yeah, looks we both pull statistics out of thin air... I'll look through the forum.

I've offered no statistics at all.  Do you know what a statistic is?

Link to comment
Share on other sites

Out of thin air or not at all, that is :D 

Now my statistics are no longer from thin air. Go to the technical support (unmodded) section of the forum, and in the "Popular questions from the past month" you can see this thread: http://forum.kerbalspaceprogram.com/index.php?/topic/143446-and-another-crashing-thread/

In this thread, 3 people (Martian Music, cubinator, StarStreak2109) clearly state something about whether their game crashes or does not crash. All of them say that their game constantly randomly crashes.

I'll look for more and edit this post!

http://forum.kerbalspaceprogram.com/index.php?/topic/143948-crash-on-launch/ the latest crashing thread. One person states something on their crashes, and they do crash.

 

Edited by TheDestroyer111
Link to comment
Share on other sites

55 minutes ago, TheDestroyer111 said:

Out of thin air or not at all, that is :D 

Now my statistics are no longer from thin air. Go to the technical support (unmodded) section of the forum, and in the "Popular questions from the past month" you can see this thread: http://forum.kerbalspaceprogram.com/index.php?/topic/143446-and-another-crashing-thread/

In this thread, 3 people (Martian Music, cubinator, StarStreak2109) clearly state something about whether their game crashes or does not crash. All of them say that their game constantly randomly crashes.

I'll look for more and edit this post!

http://forum.kerbalspaceprogram.com/index.php?/topic/143948-crash-on-launch/ the latest crashing thread. One person states something on their crashes, and they do crash.

 

Well that's 4.  That means to reach the low end of your statistic (50%), there are 8 total KSP players in the world.  You shouldn't waste your time.  Even if every member with a registered forum account has posted about crashes, you still can't assure that is 50% of all users.

The point here is that games sometimes crash, and it sucks and it should be fixed,  but KSP is far from alone in that.  Your claim was no other games you know of crash.  If that is true then you either haven't played a lot of games or you have just been incredibly lucky beyond belief.  The more likely scenario is that you are exaggerating.

Edited by Alshain
Link to comment
Share on other sites

20 hours ago, Alshain said:

There are still some physics involved.  Mainly gravitational physics.  If you send a craft flying near a planet or moon with both of them on rails in the tracking station it's trajectory will be altered.

Not really. It's just a distance check, and if the craft is close enough, the craft's trajectory is analytically calculated with respect to the body. While this is, in scientific terms, physics, from a code view it's just geometry.

Link to comment
Share on other sites

So much great discussion!  (and a few tangents- try not to get personal here guys!)  I love it when you guys actually discuss the topic at hand, particularly when it comes to programming!  It reminds me what a smart and diverse player-base we have!

 

To contribute a little- I've noticed KSP has awfully high baseline CPU usage too- even when I'm just sitting in the space center with no crafts or debris anywhere on Tracking Station and no ability to track asteroids unlocked...

I would think SQUAD could at least do something about this- no game should require large amounts of CPU when it's essentially sitting, doing nothing...

Some dynamic loading might be nice too- honestly, I think the decision to load all parts at start makes zero sense to stick with at this point...

 

Regards, 

Northstar

Edited by Northstar1989
Link to comment
Share on other sites

Honesty, I don't know why KSP treats all the Lego blocks as separate physical entities. The whole stack of a rocket should be monolithic. In real life aeronautics there is little flex besides at the wings of planes so why simulate it here?

Link to comment
Share on other sites

10 hours ago, Northstar1989 said:

Some dynamic loading might be nice too- honestly, I think the decision to load all parts at start makes zero sense to stick with at this point...

It makes more sense than ever now that we're mostly out from under the 32-bit address space limit. I much prefer loading to be done all at the start rather than interrupting play periodically.

 

Link to comment
Share on other sites

On 2016-07-16 at 4:00 PM, Rocket In My Pocket said:

This is like watching Mike Tyson chew the ear off of a baby.

I almost feel bad for the little guy but...

He keeps putting his foot in his mouth.

dude that was one of THE biggest roasts i've seen during my time on the forums..... wow :cool:

Edited by SpaceplaneAddict
Link to comment
Share on other sites

I would say that it's good enough in its present form, since it runs acceptably on my not-good laptop despite its complexity. That said, I'd celebrate if it could run better.

I recall there was/is a mod that "welds" parts. If they're then treated as one part for physics, that can help cut the load right? I personally wouldn't want stock to weld my vessel into a single solid piece, since then it'd ruin half the fun of shoddy designs. Maybe between certain parts (capsule & heat shield, fuel tank & engine, etc) or something?

Another question, if part count = bad, what's the rationale for so many fuel tanks at each width, varying only in height, as opposed to something more procedural, as I also believe is possible in mods?

 I realise this is kinda specifically what the OP didn't want posted, but I'm curious too and this seemed the most relevant place to ask.

Edited by Megadeath
Link to comment
Share on other sites

2 hours ago, Megadeath said:

Another question, if part count = bad, what's the rationale for so many fuel tanks at each width, varying only in height, as opposed to something more procedural, as I also believe is possible in mods?

More parts in a craft are bad for performance, more variety of parts available in the editor is just more RAM use but similar performance.

That said, I think the stock game is meant to have "Lego-like" construction for simplicity and ease of access, which is why we haven't seen more procedurals.

Link to comment
Share on other sites

On 7/21/2016 at 1:18 AM, cfds said:

Honesty, I don't know why KSP treats all the Lego blocks as separate physical entities. The whole stack of a rocket should be monolithic. In real life aeronautics there is little flex besides at the wings of planes so why simulate it here?

 

5 hours ago, Megadeath said:

I would say that it's good enough in its present form, since it runs acceptably on my not-good laptop despite its complexity. That said, I'd celebrate if it could run better.

I recall there was/is a mod that "welds" parts. If they're then treated as one part for physics, that can help cut the load right? I personally wouldn't want stock to weld my vessel into a single solid piece, since then it'd ruin half the fun of shoddy designs. Maybe between certain parts (capsule & heat shield, fuel tank & engine, etc) or something?

Another question, if part count = bad, what's the rationale for so many fuel tanks at each width, varying only in height, as opposed to something more procedural, as I also believe is possible in mods?

 I realise this is kinda specifically what the OP didn't want posted, but I'm curious too and this seemed the most relevant place to ask.

One only has to look at the weaknesses of UbioZor Welding  to see why KSP treats the Lego parts as separate physical entities. Many parts perform specific functions and have specific modules, like landing gear, lights, and solar panels. Trying to weld 2 or more of these parts together causes problems. They will no longer work correctly or as intended. Control surfaces is another issue. How are you supposed to calculate aerodynamic forces and manipulate multiple control surfaces independently if they are all welded into one part? The welding mod does serve a purpose and if used correctly, can reap huge performance benefits. But, I'm pretty sure that it's just too complicated for a significantly large part of the KSP user base, and part welding will remain a feature supplied only by mods.

Like @anarkhon, I am also curious about the animated water below the surface. What is it's purpose and why does it exist? It seems to cause many problems.

 

Edited by Otis
Link to comment
Share on other sites

53 minutes ago, Otis said:

 

One only has to look at the weaknesses of UbioZor Welding  to see why KSP treats the Lego parts as separate physical entities. Many parts perform specific functions and have specific modules, like landing gear, lights, and solar panels. Trying to weld 2 or more of these parts together causes problems. They will no longer work correctly or as intended. Control surfaces is another issue. How are you supposed to calculate aerodynamic forces and manipulate multiple control surfaces independently if they are all welded into one part? The welding mod does serve a purpose and if used correctly, can reap huge performance benefits. But, I'm pretty sure that it's just too complicated for a significantly large part of the KSP user base, and part welding will remain a feature supplied only by mods.

Like @anarkhon, I am also curious about the animated water below the surface. What is it's purpose and why does it exist? It seems to cause many problems.

 

Those are not limitations of UbioZor welding, but limitations in the stock PartModules.  The stock modules absolutely could support multiple solar panels, antennas, etc, -if- the stock PartModules were re-written to support them.  I've proved as much through my mod, which has quite a few more 'integrated' parts (using custom PartModules written to support them).  The reason why KSP parts are like legos is NOT the reason Ubiozor has limitations; it is in fact the other way around.

 

Heck, they don'it even need any changes to the PartModules;  they can still reside on the GameObjects of each Part, but instead of each Part having its own RigidBody and being jointed together, just parent all the parts under a single 'Root' GameObject with a single Rigidbody.  Unity will automatically use the colliders from all of the Parts; so the collision fidelity would be retained.  You can still get callbacks regarding which part collided and explode only that part.  The only thing that this method doesn't offer you is noodle rockets (e.g. RUD)/structural failure (which could be simulated in other ways).  Removal of joints also presents an excellent opportunity to increase aerodynamic fidelity through a voxelization system (no wobbling / noodle-rockets means the voxelization will be more accurate).


So, basically, at some point, someone made a choice between having 'structural stability' simulated through joints, or having all parts under a single RigidBody.  They decided it was more 'fun' to have floppy jointed rockets, and so -that- is why we have the current jointed-parts system and the terrible performance from overloading the CPU that it brings.  (Okay so that is all theory and I can only speculate on to the 'why' they did something, but it seems likely to me that the decision must have been made at some point between jointed or single-rigidbody setups, and that someone likely chose 'jointed' for the RUD 'fun' factor and ignored the performance implications).

Link to comment
Share on other sites

@Shadowmage Ok, I'll go with that. I don't know enough about Unity or KSP to argue otherwise. I simply know from my own experience playing the game. I am still curious about the control surfaces though. Just how would one construct a plane from a selection of parts and it still remain possible for SAS to maintain heading by manipulating indivdual control surfaces?

Link to comment
Share on other sites

8 hours ago, Nerfclasher said:

@Claw could physics run on the gpu if possible and if not What would it take to make it possible

Not to speak for Claw, but Unity does not support PhysX running on the GPU (nor would it be of much benefit for the type of physics a KSP craft represents).

Link to comment
Share on other sites

On 25-7-2016 at 5:15 PM, Shadowmage said:

Those are not limitations of UbioZor welding, but limitations in the stock PartModules.  The stock modules absolutely could support multiple solar panels, antennas, etc, -if- the stock PartModules were re-written to support them.  I've proved as much through my mod, which has quite a few more 'integrated' parts (using custom PartModules written to support them).  The reason why KSP parts are like legos is NOT the reason Ubiozor has limitations; it is in fact the other way around.

I hope this will change in the future, my mods need extra parts and/or less than elegant workarounds because of this since I script stock modules only. Actually there are lots of stock modules you can cram inside a single part. A thing which doesn't work is a part using ModuleEnginesFX together with a resource, KSP will register it's presence but the module won't utilize it. Would you like to take a look at it, @NathanKell?

Link to comment
Share on other sites

On 25-7-2016 at 5:46 PM, Otis said:

@Shadowmage Ok, I'll go with that. I don't know enough about Unity or KSP to argue otherwise. I simply know from my own experience playing the game. I am still curious about the control surfaces though. Just how would one construct a plane from a selection of parts and it still remain possible for SAS to maintain heading by manipulating indivdual control surfaces?

Maybe you could rephrase your question? KSP knows the center of lift, mass & drag, knows the location of all control surfaces, gives them specific ID's and uses a very simplistic AI routine to drive them. Or: the user has chosen very specific settings for a(ll) controle surface(s) and the AI won't take control. A mix is possible though.

Link to comment
Share on other sites

55 minutes ago, Azimech said:

Maybe you could rephrase your question? KSP knows the center of lift, mass & drag, knows the location of all control surfaces, gives them specific ID's and uses a very simplistic AI routine to drive them. Or: the user has chosen very specific settings for a(ll) controle surface(s) and the AI won't take control. A mix is possible though.

Yes the question needs rephrasing. How would it be possible to make a plane from a given selection of parts, then weld all those parts into 1 part, and still be able to manipulate the control surfaces?

Are you saying that it is possible to combine all the control surfaces into one part, and still be able to control or manipulate individual surfaces? Like lock only certain surfaces for landing or takeoff or reentry, or lock just the gimbal on an engine. It just seems to me that there are some inherit limitations to part welding that the player would have to always keep in mind when building crafts. Adding part welding to the stock game as a feature used solely to improve performance seems like it would open a can of worms. Thus, my previous statement, it should be left as a mod that a player chooses to install, and is therefore responsible for figuring out the can of worms.

If there are things squad can do to make life easier for part welding, yes, by all means, do it. But the original question that got me into the discussion was why does ksp treat the parts as separate entities. In my mind, it is because it just isn't possible to make a craft from a selection of parts, combine all those parts into one part, and still expect to retain individual functionality of the individual parts. I hope I am proven wrong. I want better overall performance too.

Link to comment
Share on other sites

1 minute ago, Otis said:

Yes the question needs rephrasing. How would it be possible to make a plane from a given selection of parts, then weld all those parts into 1 part, and still be able to manipulate the control surfaces?

Are you saying that it is possible to combine all the control surfaces into one part, and still be able to control or manipulate individual surfaces? Like lock only certain surfaces for landing or takeoff or reentry, or lock just the gimbal on an engine. It just seems to me that there are some inherit limitations to part welding that the player would have to always keep in mind when building crafts. Adding part welding to the stock game as a feature used solely to improve performance seems like it would open a can of worms. Thus, my previous statement, it should be left as a mod that a player chooses to install, and is therefore responsible for figuring out the can of worms.

If there are things squad can do to make life easier for part welding, yes, by all means, do it. But the original question that got me into the discussion was why does ksp treat the parts as separate entities. In my mind, it is because it just isn't possible to make a craft from a selection of parts, combine all those parts into one part, and still expect to retain individual functionality of the individual parts. I hope I am proven wrong. I want better overall performance too.

Because the modules and code don't operate on 'Parts', they operate on 'Transforms' which are a component of the models used in the part.

If all 'Parts' were combined under a single Rigidbody (thus no joints), the individual Models would still exist, and thus there transforms would still exist.  In short, it would work exactly as it does now (aside from the modules being written to accommodate multiple transforms / written to work with multiples of the same modules).  Everything that works at a 'part' level could be easily reworked to work on a 'sub-model' level instead.

The only reason (that I can fathom) that KSP treats parts as separate entities (read GameObjects with their own Rigidbody) is so that it can simulate structural failure between the joints.  There is no technical limitation in Unity or PhysX to combining them all under one rigidbody/entity; the only limitations that exist is how the specific PartModules have been coded (which is entirely under SQUAD's control; they could rewrite them to work with welded/single-entity vessels).

 

On that note, it would be awesome if many of the stock part-modules were more friendly to part-welding.  Mostly they just need to support multiple same-named animations and transforms, which is downright trivial to implement into many of them.  Solar panels are the big one that could use this help; lights are perhaps another.  Landing legs/wheels of course are another, but that is a bit more complex because of their current wheel-system and Unity limitations (this is one spot where you need joints and rigidbodies due to some really stupid limitations put on wheels by Unity).

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...