Jump to content

Can someone tell me why I am wrong? (single threaded physx?)


Cannibal

Recommended Posts

Orbitus: That was the purpose of having a dynamic integration/separation system. Each part is only individually simulated when it needs to be. In those cases, the vessel would not be consolidated because it was not in an inertial reference frame.

To be clear, I meant that as a "I wonder if the devs could do this at some point down the road" and not a "KSP, Y U NO PHYSICS!?"

Link to comment
Share on other sites

I am starting to get genuine tired of games running on one core.

sins of a solar empire, great game. Would still have played it, except the one core limitation kills it. And with every exp. Pack they release for it, the more it crawls to a hold.

And as things are now, KSP will suffer the same fate. As it gets more and more complex, it will run slower and hit the 2Gb limit faster.

Link to comment
Share on other sites

Depends on where they add the complexity. New SAS system was rewritten, so it's very well possible it takes only as much processing power as the old one. New parts added won't need more memory if you stick to your old part counts, and upcoming R&D will most likely not require exceedingly large calculations on the part of the processor, compared to simulating the physics of a ship.

But actually, when you read the 'what not to suggest'/'already suggested' in the development section, you'll find:

Optimization:

Blue being devs think its a good idea, but reserve the right to change their minds.

Also:

•Using another game engine* or physics engine

•Change part loading

•Multithreading / Multicore functionality

* means its not going to be in-game. The star is at game engine, which clearly indicates a new physics engine has not been entirely eliminated as a possibility.

Link to comment
Share on other sites

Looking at KSP with process explorer, it does indeed seem to run on 20-something threads. Although it's not a very significant increase in performance compared to what a single-thread program would be. Only one of the threads uses a core fully, while a few others combined use around a third of another core. The highest I got my CPU usage to go with a 600-part craft was 17% with 8 logical cores on an i7. Below is a screenshot showing the CPU usage of each thread. As you can see, only one of the threads does any real work while the rest run some minor tasks. This is most likely caused by Unity disliking multi-threading as mentioned above.

kspthreads.png?psid=1

Edit: Rendering doesn't seem to be a bottleneck at least on my system. The same test that screenshot is from had GPU usage rise no higher than 33%. This is not so surprising, seeing how KSP doesn't have many fancy graphical effects.

This is exactly what I was told: It's already multithreaded, but each thread represents one entire 'Thing' the engine is doing (Sound, Physics, etc), and these subsystems can't be divided among cores. The problem being that the Physics thread uses more CPU Time than everything else put together, so even with it monopolizing a core while everything else is running on another one, it's STILL the bottleneck.

As for why ships are multiple parts and not consolidated...can't have the joints break and bend if you're treating the joint as being unbreakable.

That said I saw a thing in the mod forums the other day, somebody's welding (I forgot the name) or something like that, which is basically just that: Commonly used assemblies of stock parts consolidated into a single part.

Edited by Tiron
Link to comment
Share on other sites

One question I had, and maybe I'm just the dumb, but why can't KSP compress a ship into a single physics object?

Because a single, rigid, physical body behaves much different than a combination of them. Let's start with the obvious one: avionics. If you take a close look at some of KSPs airplanes, then you see that the wings are actually flexing, which has a quite significant impact on how this things flies.

Of course, you could say: well, then let's only compress parts when entering space. But every joint is able to stretch and wiggle a little, and this might spin or tilt your ship.

The more important question is: why would you do that, anyway? Because it enables you to build bigger ships, right?

It's not a bug, it's a feature: you are not supposed to bring vehicles into orbit that are structurally unsound. It is part of the game to find a design that is not only rigid enough to not explode when launching, but which is controllable and reliable.

Like it or not: the physics engine is currently the only thing that enforces rules in KSP somehow. Since you are neither tied by resources or part count, at least you are bound by rudimentary laws of nature.

Link to comment
Share on other sites

"Because a single, rigid, physical body behaves much different than a combination of them. Let's start with the obvious one: avionics. If you take a close look at some of KSPs airplanes, then you see that the wings are actually flexing, which has a quite significant impact on how this things flies.

Of course, you could say: well, then let's only compress parts when entering space. But every joint is able to stretch and wiggle a little, and this might spin or tilt your ship.

The more important question is: why would you do that, anyway? Because it enables you to build bigger ships, right?

It's not a bug, it's a feature: you are not supposed to bring vehicles into orbit that are structurally unsound. It is part of the game to find a design that is not only rigid enough to not explode when launching, but which is controllable and reliable.

Like it or not: the physics engine is currently the only thing that enforces rules in KSP somehow. Since you are neither tied by resources or part count, at least you are bound by rudimentary laws of nature." (quotes still don't work for me :| )

I wasn't speaking of eliminating structural considerations, but reducing the number of parts that KSP has to think about at any one moment to reduce lag. It won't work for planes, or other aerodynamically active vessels most likely, but for things like space stations, and other vessels that are not under any sort of acceleration, like I mentioned, it's a non-issue. If I'm trying to dock one station module to another, is there any need for the static module to be simulated when I'm still 500m away? There are no forces to act on it whatsoever.

"As for why ships are multiple parts and not consolidated...can't have the joints break and bend if you're treating the joint as being unbreakable."

I didn't say that the joint would be unbreakable. My suggestion was to establish thresholds of total vessel acceleration under which various parts will be approaching their breaking points. As this would likely be quite complex to accomplish, I mentioned the easier option of only consolidating vehicles that are not under acceleration or aerodynamic forces.

Link to comment
Share on other sites

I didn't say that the joint would be unbreakable. My suggestion was to establish thresholds of total vessel acceleration under which various parts will be approaching their breaking points. As this would likely be quite complex to accomplish, I mentioned the easier option of only consolidating vehicles that are not under acceleration or aerodynamic forces.

That's the problem. They're ALWAYS under acceleration. Any change in direction OR speed is an acceleration. Including the fact that you orbit things instead of flying in a straight line: Gravity tries to accelerate you down towards the body, but your speed is so high that it can't do so fast enough.

Not to mention if you're turning the craft at all. Using SAS to hold an orientation? That's a (very minor) acceleration. Turning round to face the other way? Acceleration.

In fact the only time you're NOT undergoing any accelerations at all is when you're On-Rails. The focused craft only goes on-rails during time acceleration. Other craft are on-rails constantly unless within about 2.4km of your ship (assuming you haven't modified the simulation distance.)

And they call it going 'on rails' because all physics simulation is suspended and the path of the craft is strictly dictated, as if it were a train running on rails. Nothing affects an on-rails craft at all, they just keep going in their predefined orbit, exactly as it's defined.

So they kinda already do that...

Link to comment
Share on other sites

Just to play devil's advocate one giant departure between this game and the the way real things work is the inability to attach at more than one point!

Fuel tanks for example should have no problem attaching laterally and vertically to other fuel tanks without needing rolls of space duct tape.

I still haven't seen a solid answer on whether this limitation is due to the unity engine forcing the game to use a tree data structure, or just the unfortunate use of a tree structure rather than an adjacency matrix or something.

Link to comment
Share on other sites

I've been watching this among many other threads, trying to get my KSP running best as possible. So one thing I did that seems to make a fairly higher level of stability was to go into my graphics card settings and assign the PhysX to the hardware of the card instead of software/auto select. I wouldn't say it's bulletproof but combined with removing parts not needed and tweaking the in game settings so far things have been very playable...more than 4hrs and many launches without crash. BTW the vid card is a PNY 550ti 1gig. just my 3 cents(darn inflation) :)

Link to comment
Share on other sites

Minor benefits? Allow me to provide a data point. I have a 2.53Ghz quad core proc with a PhysX card. I can fly stuff like:

CBmWFoW.png

Don't have that file anymore but I can assure you the part count included a comma.

#EDIT: I might be misunderstanding the previous point. If I didn't have a dedicated PhysX card, I'd buy one. I'm more inclined to credit my large part counts to the PhysX card than I am the processor or Windows 8.

Link to comment
Share on other sites

I've been watching this among many other threads, trying to get my KSP running best as possible. So one thing I did that seems to make a fairly higher level of stability was to go into my graphics card settings and assign the PhysX to the hardware of the card instead of software/auto select. I wouldn't say it's bulletproof but combined with removing parts not needed and tweaking the in game settings so far things have been very playable...more than 4hrs and many launches without crash. BTW the vid card is a PNY 550ti 1gig. just my 3 cents(darn inflation) :)

That will not do a thing, you can't force a version of physx made to run cpu only, to run on your gpu, That isn't how that works.

Link to comment
Share on other sites

You can with Nvidia, actually. My own system has this option, if it wishes to use the actual hardware or simulate PhysX on a processor core instead. If you'd like I can provide screenshots when I get home tonight.

No, actually you can't, again, that isn't how that setting works.

While that setting can be used to force your gpu to be used in versions of physx that support gpu physx, which is redundant as it will do so already, the version of physx that the unity engine uses can't be gpu accelerated.

It's done on the cpu no matter what you set that setting to.

Link to comment
Share on other sites

The question, if I'm recalling correctly, wasn't whether or not Unity supported it, but rather if it were possible to toggle PhysX between dedicated processor or relegated to a processor core. It is my assertion that it can. I go no further than that.

Link to comment
Share on other sites

The question, if I'm recalling correctly, wasn't whether or not Unity supported it, but rather if it were possible to toggle PhysX between dedicated processor or relegated to a processor core. It is my assertion that it can. I go no further than that.

Factually though, you can't.

The necessary code does not exist for this to happen, it will run cpu only.

Link to comment
Share on other sites

Minor benefits? Allow me to provide a data point. I have a 2.53Ghz quad core proc with a PhysX card. I can fly stuff like:

[snip]

Don't have that file anymore but I can assure you the part count included a comma.

#EDIT: I might be misunderstanding the previous point. If I didn't have a dedicated PhysX card, I'd buy one. I'm more inclined to credit my large part counts to the PhysX card than I am the processor or Windows 8.

I was told that the PhysX card doesn't work for the same reason as the GPU, but something is up. I've got a more powerful CPU than you but I can't get more than 1 FPS with a vessel of more than 200 parts.

Would you be willing to test if it really is the PhysX card, like try to play KSP after removing it?

Link to comment
Share on other sites

I was told that the PhysX card doesn't work for the same reason as the GPU, but something is up. I've got a more powerful CPU than you but I can't get more than 1 FPS with a vessel of more than 200 parts.

Would you be willing to test if it really is the PhysX card, like try to play KSP after removing it?

What cpu do you have?

Link to comment
Share on other sites

Well I discovered that my 4.4ghz OC CPU with a 770gtx that runs pretty much every game without hitting 55'C gets it arse kicked when I hit the eve atmosphere in a spaceplane. 65'C on all 4 cores. Damn they need to multi-core this game quickly. It only had 40 parts on it.

Link to comment
Share on other sites

that's 2.53GHz per core, and the physics core can only run on one core, therefore it is the bottleneck that makes quantity of cores irrelevant.

Knowing the speed his cpu is running at doesn't tell us what cpu he has, or how powerful it is in relation to yours.

I forgot to mention this earlier but you should be able to run 200 part ships, maybe not a lot more than that, but certainly at more than 1 fps.

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