Jump to content

Lag with 100 parts


Recommended Posts

It is very frustrating (read: frustrating) to just even play KSP, because it starts to lag anywhere a craft with 100+ parts.

Is KSP unoptimized or the mods to blame?

A few words of mostly unsolicited and almost off-topic advice: Despite how frustrating this is, you should probably not poke around too much in the internal workings of the game. For one thing, you’re not really supposed to (unless you work for Squad); for another, you stand a good chance of making things worse. Upgrading your hardware might help, or might not; it’s unclear exactly what helps and what doesn’t, since on my gaming computer I can launch a craft with 400 parts and lock up the game completely, while on my mostly-factory-hardware MacBook Pro it takes close to 1150 parts to get the same result, with the same graphics and physics settings. (Although, to be fair, the gaming computer lags a lot less until the 300-part mark.) I think adding more parallel processors makes things worse, not better, but I couldn’t begin to tell you why.

In conclusion, I stand in solidarity with your frustration.

And the answer to your question is “yes.†Good day to you.

Link to comment
Share on other sites

How fast is your system? How much memory?

I don't really notice the lag until I get over maybe 500 parts. My most recent creation has 1,544 parts, and I get about an 11:1 time reduction. It takes 11 seconds for 1 second to pass.

I have a pretty fast system though. My i7 4790 3.6 ghz is rated as the 5th fasted processor for single core processing, the last time I looked at PassMark. The fasted was the i7 4790K 4.0 ghz. The bulk of KSP apparently runs in a single core.

I also have 32 GB, though I don't see an improvement over the 8 GB I upgraded from. I suspect since KSP uses almost 4 GB of RAM, you need at least 6 GB, and better yet 8 GB. It's only 1600 mhz memory. I wonder if I can put faster memory in? If my motherboard supports it? I should have checked that before buying the 32 GB...

None of my slowing down is from graphics processing. My GPU barely breaks a sweat, it's the GeForce GT 720. I use 15+% (12.5% +2.55%) of my CPU capacity for the game with 8 logical cores, and if I turn hyperthreading off, I use 28% (25% + 3%) of my CPU capacity. I hear various things, I'm told by some I shouldn't have any improvements with hyperthreading off, I hear by others maybe a 3% max improvement. It at least feels faster, maybe it's my imagination.

Link to comment
Share on other sites

Faster ram, more ram, better video card (with one exception) or anything else won't make much of a difference in KSP. The bottleneck is the single core of the CPU it uses.

The one exception is shared ram video cards, these suck for gaming in general. You want a dedicated video card. (Hint: Most laptops do not have dedicated video cards)

Link to comment
Share on other sites

Faster ram, more ram, better video card (with one exception) or anything else won't make much of a difference in KSP. The bottleneck is the single core of the CPU it uses.

I think that is the major factor in the equation - if you want to improve performance, think CPU. You can often get better KSP performance if you disable CPU hyperthreading in the BIOS setup. KSP gains nothing from more CPU threads (at least not until the update), so it can help to dedicate a whole CPU core to perform the calculations, not just parts of it with hyperthreading.

Link to comment
Share on other sites

Apparently, a Phenom II and GTX 750 Ti isn't not going to do KSP any favors anytime soon. :P

While we're on topic, how would we improve performance? It seems like the biggest question anyone can ask before 1.1 befalls on us.

You cannot really, if you are talking about game performance, though if you want to save RAM you can use Active Texture Management (horrible!), OpenGL (better), or switch to the Linux64 client which has unlimited RAM (best!).

I have a i5-4690k and aside from the garbage collection I roll with ~5.6 GB of mods without any noticeable slowdown.

Link to comment
Share on other sites

I remember a time when people only started complaining about lag after reaching about 500-1000 parts or more...

The new versions are horrible that way in that they slow down much more at a lower part limits.

- - - Updated - - -

Apparently, a Phenom II and GTX 750 Ti isn't not going to do KSP any favors anytime soon. :P

While we're on topic, how would we improve performance? It seems like the biggest question anyone can ask before 1.1 befalls on us.

The 750ti is not a bottleneck at all unless you run it at 4k or something like that.

It is really all in the cpu as long as you have a mid range GPU. But still with older versions I had no issues pulling off decent frame rates even with 500+ parts on my old phenom 2 945.

Link to comment
Share on other sites

It is very frustrating (read: frustrating) to just even play KSP, because it starts to lag anywhere a craft with 100+ parts.

Is KSP unoptimized or the mods to blame?

Your definition of lag may be vastly different from someone else's. My definition is any hesitancy whatsoever in interface commands. That said, I have lag with 60 part ships in the VAB. I hit a key and nothing happens for a half second.

I have 32GB RAM and six core processor. You be the judge where the problem lies.

Link to comment
Share on other sites

Your definition of lag may be vastly different from someone else's. My definition is any hesitancy whatsoever in interface commands. That said, I have lag with 60 part ships in the VAB. I hit a key and nothing happens for a half second.

I have 32GB RAM and six core processor. You be the judge where the problem lies.

As far as KSP is concerned you have 4GB of ram and a 1 core processor. I'm anxious to hear how many parts a computer like that can handle in 1.1 though.

Edited by Alshain
Link to comment
Share on other sites

If anyone is interested, I downloaded Passmark and tested my system with hyperthreading on and off.

XxMDmSK.png

Look at the increase in floating point math and physics which the game likely uses intensely. An overall increase of 6.89% but 11.71% and 14.75% in these two areas.

Edited by Wild Cobra
Link to comment
Share on other sites

It's the game fella couple with any hardware inadequacies your system may have.

I have the fastest CPU for single core performance that you can buy and I see game effecting lag around 500-600 parts.

In version 0.90 I would get this at around 800-900 parts.

We have high hope for Unity 5 however and I know Squad are working hard to improve game performance.

And we must be aware that simply saying 'lag' means nothing. It is subjective.

- - - Updated - - -

As far as KSP is concerned you have 4GB of ram and a 1 core processor. I'm anxious to hear how many parts a computer like that can handle in 1.1 though.

1.1 will not use more than one core per craft. You will see a boost with more than one craft on screen. this will help surface bases a lot.

Link to comment
Share on other sites

1.1 will not use more than one core per craft. You will see a boost with more than one craft on screen. this will help surface bases a lot.

You do understand the craft is not the only thing in the game using the CPU, right? Even if it is one core per craft, that craft can potentially be using an entire core all by itself while right now it can't.

Link to comment
Share on other sites

1.1 will not use more than one core per craft. You will see a boost with more than one craft on screen. this will help surface bases a lot.

Maybe. We haven't seen the implementation yet, and it's possible the thermal might be spun off to another thread, for example.

You do understand the craft is not the only thing in the game using the CPU, right? Even if it is one core per craft, that craft can potentially be using an entire core all by itself while right now it can't.

Unity is already multithreaded. The physics thread will happily eat an entire core for a single craft while the other (much lighter) tasks are pushed to another core.

Link to comment
Share on other sites

I don't start to notice lag from parts until around 150 on my very heavily modded install, however reentry effects completely kill the framerate for me, unless I have them turned down to minimal.

Specs: Elementary OS 0.3 (Based on ubuntu 14.04), GTX 760, i7-2600, and 12 gigs of ram.

Is this normal?

Link to comment
Share on other sites

I have a 4790k (4ghz, 4.4 turbo) with some very fast memory, a good video card, and an SSD. I get lag (yellow mission clock) at anywhere between 300 and 1000 parts, depending upon what those parts are. Aero parts, solar panels, and especially struts cause a lot more lag than simple rocket parts. Strut placement can change performance greatly, as it impacts which parts the physics calculations must take into account (a web of struts links everything to everything and will crater performance even on my very good computer).

I am also a programmer who works on optimization of programs which process large data sets, so I have some insight as to what the possible bottlenecks actually are. I see a lot of complaints that games are not optimized well simply because they do not use all of the cores on the processor, but this is almost always due to a lack of understanding on the part of the user as to how a modern computer works and what the limitations are. The extra cores are there in case they are needed, they are not full processors. The only reason you have 4 cores is that it takes very little die space to do that compared to extra cache memory, but the vast majority of the time they are expected to be idle, even if your processor is maxed out.

The thing about the multiple cores your processor has is that they all share cache and memory, and very few programs are actually limited by the number of calculations your CPU can do. It is *far* more common for a task to be limited by either the amount of data which can be transferred from memory, or the latency of those requests (which can sometimes be hidden by clever programming tricks.) Multithreading a program which is limited by memory almost always gives you worse performance, and removes the ability to use certain very important optimizations (those threads compete for the same resources, and knowing what a thread is up to in relation to other threads requires very expensive synchronization commands.)

I actually produce a program which has a multithreaded version which is not something we just distribute. You can get it by contacting support, but they have been instructed to ask if the computer it will run on is multi-processor, or multi-core. It works well if you truly have multiple processors, but running the multithread version on a single processor which has multiple cores results in much worse performance as the threads compete for cache space and memory transfer (8x - 50x slower.)

You may think it should not be worse regardless when the task is split across two threads, but a cache miss leads to an extra transfer from memory. If you have two similar tasks competing for cache space and memory access, the extra cache misses make extra memory requests, which delay all other memory requests. This leads to a far worse than linear performance degradation.

In my case, very intense complaints by a specific important client who was annoyed that it did not use "all of their processor" led to a version of the program which maxes out all cores. It does this by querying the processor for how many cores it has, and starting up enough threads to fill it. The trick is that only one thread processes relevant information, the rest add 1 to a register in an infinite loop (which took a little effort, as the compiler really wanted to optimize it out). This results in about a 5% speedup overall, as it prevents other programs from running well (I also set the priority pretty high, so it stops almost anything else from getting CPU time). Be careful of what you wish for.

KSP may or may not benefit from multithreading, but the assumption that is it poor optimization is not necessarily correct.

Edited by cerberusti
Link to comment
Share on other sites

In my case, very intense complaints by a specific important client who was annoyed that it did not use "all of their processor" led to a version of the program which maxes out all cores. It does this by querying the processor for how many cores it has, and starting up enough threads to fill it. The trick is that only one thread processes relevant information, the rest add 1 to a register in an infinite loop (which took a little effort, as the compiler really wanted to optimize it out). This results in about a 5% speedup overall, as it prevents other programs from running well (I also set the priority pretty high, so it stops almost anything else from getting CPU time). Be careful of what you wish for.

Wow. That would be some epic trolling if Squad just added some busywork loops to peg the other cores ("Look, your CPU is running at 100% now!!!1").

Link to comment
Share on other sites

and very few programs are actually limited by the number of calculations your CPU can do

This may be true for the type of programs you write but it is not generally true and definitely isn't in the case of something like KSP. There are numerous complex calculations done by KSP on each frame which are definitely not memory bandwidth limited and could fairly easily be multithreaded with significant increase in performance on multi core cpus.

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