Jump to content

How to dodge FPS destroying lag


Recommended Posts

We all get it. We all have problems docking to our huge space stations because of it. Until Squad gets proper multi-threading support running, we all get FPS destroying lag at some point. I am building a massive interplanetary ship up at my space docks. Right now, All I have is the docks (with two small adapter pieces) and two of my heavy tugs. Next up to launch is my interplanetary tugs. I'm already seeing traces of lag like slight framerate losses. Its noticable, but not interfering as of yet. It's only gonna get worse the more I pile on up there. Is there any good way to at least buy me more time before I'm running at 2 FPS? After the assembly tugs, I have to put up the megatug that propels the craft and the fuel module(s) (going up dry so I gotta run at least a dozen tanker missions). Anyone know of some ways to reduce the onset of the lagging?

Link to comment
Share on other sites

Reduce all available settings:

Away from my home computer at the moment, so I don't know the exact setting title but, in the game's options you should find "Max Physics Delta-Time per Frame", drag this until it shows the largest number possible. This will reduce the number of times per second KSP calculates physics (if someone could follow up with the location in one of the game's settings text files, that might help this gent to further tune the physics down).

Install mods that involve fewer parts;

Quantum Struts or any mod with "heavy" struts can replace struts more than 10:1, if you build smart.

Lando's Part Generator 2.3 allows you to create custom parts. Going to need 4x orange gas cans? Make 1x item that does the same.

There's also a parts mod out there I can't for the life of me remember the name of that combines "often used" parts into single pieces (to save on drag/processing), that mixes like, a ROCK-64 tank and a large RCS fuel tank into one object, that sort of thing, hopefully someone will know what I am referring to.

Watch out for your running mods:

I am one of those guys with a fancy fancy computer, real purdy like, and once upon a time I was launching a probe-hauler into space (with five probes attached) and my system ground completely to a halt, not even 1 fps, for big sections of the launch process (14km-60km) and whenever I was near anything my system basically stopped functioning. The problem? All five of my probes had ISA map sat items on them, turning those off solved the problem instantly.

Strip down to the basics, get a few simplified parts mods, grab your quantum struts, get your mechjeb, and just run with as little as possible.

Link to comment
Share on other sites

Computer specs:

Intel i7 (8 core) processor

8 Gb (12 sticks) of RAM

17.3 inch display

0.5 Tb hard drive

Currently running KSP on default graphics at max res for windowed mode (before the frame disappears off the end of the screen).

I uninstalled KW Rocketry (but thinking of reinstalling it for it's large tanks, tanker flights). I can use it for heavy struts. I have quantum struts. I have very few parts mods I run regularly. I'm not actively running any instruments on stuff.

I'm trying to avoid cheaty things like fuel tanks that hold 5x more than they should. I'm doing the tanker stage the realistic way (orbital refueling).

EDIT: I found said setting and reduced it to calculating 2x every second over 10. I also reduced the texturing and rendering graphics.

Edited by Captain Sierra
Link to comment
Share on other sites

There in lies the problem. This project involves a lot of docking and orbital construction. That is why I am asking this question. I need to reduce the lag that I know will incur when I come in for the docking maneuver as part of assembly.

Launching I get great FPS. The only time the slightest bit of lag appears is when I am coming in on docking approach and the game starts physics calculations on the space docks and the tugs already docked there in preparation.

Link to comment
Share on other sites

I find that when I'm approaching another craft, KSP starts to trash my disk for a minute or two. My FPS stabilizes after that point.

Assuming that's what you're noticing (eg does it go away with time?) you could mitigate this by improving your disk performance. (defrag, faster disks, SSD etc).

Since I have the RAM, I'm going to try copying KSP into a ramdisk before launching, to see how it behaves.

Link to comment
Share on other sites

It does not improve with time. It remains persistent for the duration of the time physics is loaded on the ship. I am already getting an FPS of 15-20 and I only have 3 tugs up there. I have one more to launch, then a fuel/RCS stage before I even start bringing the big stuff up there. :facepalm:

So to answer you, it does not improve after time. It remains persistently poor for as long as I am within physics loading range of the docks.

EDIT: I have the CPU power to not get this, the problem comes from it being an 8 core processor. Each core by itself is not very powerful and without proper multi-threading support (which KSP does not have yet, though planned), My 'high performance' machine is no better than anyone elses because I can't utilize the full power of my CPU. That's what I think is going on here.

Edited by Captain Sierra
Link to comment
Share on other sites

I suggest getting a more powerful single core instead

In most cases, multi-core is better and since KSP is not the only game I play, I'm not about to go optimizing my hardware specifically for it (money is also a problem).

So far, space dock + 4 tugs = 5 FPS. NEW PLAN!!!

I'm going to completely get rid of the space dock and tugs, waste of hardware allocation. I'll just send up the megatug, fuel it, send up the fuel module, fuel it, then send the RCS module, fuel it, and then send the rest.

Link to comment
Share on other sites

I have found closing the MechJeb DeltaV window when I am not using it to help alot.

Also the game does not seem to max out any of my 4 Cores and when it starts to slow down badly my FPS drops and my GPUs utilization also goes down which is strange......

Link to comment
Share on other sites

Also increased the Turbo Boost on my I5 2500K this morning so that with 3-4 cores active it runs around 4.3Ghz and that took my 500 ton tanker from 8fps to 12. I also set CPU affinity from all to just 2 cores and set the priority to real time.

I was able to see 1 core almost fully utilized and the second was only partly used. I have a G15 keyboard with LCD so I can monitor CPU/RAM/GPU usage.

Link to comment
Share on other sites

... game does not seem to max out any of my 4 Cores

Unity is single-threaded.

my FPS drops and my GPUs utilization also goes down which is strange.

This means your GPU is not the bottleneck. Your CPU/RAM is ;)

Link to comment
Share on other sites

There is a large number of games still coming out that will hardly use 2 cores let alone 4 or 8.

Unity is not a new engine either, multithreading sounds so wonderful until you actually have to create the software and utilize it then its a pain.

Link to comment
Share on other sites

Wow, imagine that! Proper software engineering is hard... Proper architecture is mandatory if you're going to even consider multithreading, but the kind of understanding that is required to pull all that off correctly really does raise the bar. That kind of thing is what separates Good from merely Adequate.

Link to comment
Share on other sites

Most high performance processors are multi-cored. It's pretty much mandatory for any game that needs decent hardware to run to have proper multi-threading support. Which means either Squad needs to look at ways to run KSP multi-threaded, ditching unity if they must and going for a different engine (no idea how hard this would be but it can't be easy.

Link to comment
Share on other sites

I too would like to see multi core support. Nothing worse than having a decent rig but not being able to use it. I run into the same lag but not as low as 2-3fps, i'm probably a bit higher my specs are (I7, 16gb ddr3, 3gb gtx670, and game running off my ssd). I have actually stopped playing for the past few weeks as the lag drives me nuts.

Link to comment
Share on other sites

I have found closing the MechJeb DeltaV window when I am not using it to help alot.

.....

my FPS drops and my GPUs utilization also goes down which is strange......

This is very true. I've found that the default DeltaV window in Mechjeb causes about a 10-20% drop in FPS. If you use MechJeb and have FPS problems, closing this window can make a difference; not a huge difference, but 2 or 3 extra FPS can be fairly noticeable.

And the drop in GPU usage makes sense when you think about performance being CPU limited. The GPU doesn't have to work nearly as hard at 10 FPS than it does at 60 FPS, so usage drops.

Edit: And about Unity multithreading, I don't think the problem is with Unity's threading, it's the version of PhysX it uses. You can clearly see that KSP uses more than 1 thread by looking at it's CPU usage. But PhysX version 2 is single-threaded and has bad performance on the CPU. PhysX version 3 is supposedly much better, but I'm not sure if it's feasible for KSP to switch to that, or if it's something that would have to be supported by Unity first.

Edited by DMagic
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...