Jump to content
  • 0

What causes lag? How to deal with it?


king of nowhere
 Share

Question

I have quite some experience building large ships, and of course they are a bane for the pc. they take minutes to load, they lag heavily, sometimes they crash the game altogether.

but not all are equal. My biggest ship by part count, the Dream Big, was close to 1300 parts. It did indeed take minutes to load it into physics range, with the time increasing every time the ship was loaded anew - forcing to close and restart the game after a while, as this became unmanageable. but it could be used.

Another one, named Bolt, was upwards to 1000 parts before it started shedding drop tanks. And it was lagging, but not too bad. while it's hard to make a comparison, I'd say it was less laggy than the Dream Big was after dropping 300 parts in non-reusable landers.

And now I have a new ship (still no official name), and while it's still at 1000 parts, it's performing much worse than anything else. It takes many, many minutes to load it the first time. Loading it the second time can take upwards to half an hour. I generally restart the game every single time i have to load it. I now spent the last three hours and a half just trying to launch it to orbit (notice: I already did successfully launch it to orbit two days ago, but I had to scrap it because problems. some parts were duplicated and clipped on top of each other). Trying to save time, I stuck some of the shuttles that I'd normally dock in orbit after launching the main ship. The ship, including launcher, is now 1200 parts, and it consistently crashed shortly before booster separation (which only happened twice, in three hourse, because it's really slow).

 

So, lag is not caused strictly by part count; i'd like to know if someone figured out what is causing it exactly, maybe I can try to minimize it in some way.

 

By the way, mods are also involved, and may be partly responsible. All ships use kerbalism, and they have multiple active processes. Would stopping those processes help?

The last ship also has nuclear reactors from near future electrics, can that be part of the problem?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

IVAs need some processing too, so a craft with lots of crew modules will probably run slower than the same craft with those crew modules swapped out for fuel tanks. Parts with a lot of detail on their surfaces and more complex collision meshes will also be more computationally expensive, and I've found the NFE reactors fit this category (and I'd imagine the Kerbalism greenhouses count for this too). Craft structure (long and thin, lots of connections using attachment nodes versus short and fat, lots of radial attachment) could also have an effect as it would change the way that parts relate to each other which would then change how the interactions are calculated; I'm not sure which option would be better though so that might be worth investigating.

Link to comment
Share on other sites

  • 0

At the scale you’re building at, the guidelines for space station design are probably the best things to search for. The two big rules I remember are:

1) Minimize the number of lights

2) Minimize the number of open docking ports

Link to comment
Share on other sites

  • 0

You could try the welding mod if you're making ships that big.

 

1000 parts is fairly high and I'd recommend making your ships smaller and more manageable.  I used to build gigantic ships but my game would crash a lot and it eventually burnt me out. Since switching to smaller design, my game doesn't crash and I have a much better experience.

My hope for KSP2 is that the new physics model will be able to handle these types of ships much easier and allow for some truly gigantic construction. It's worth noting that most YouTuber who build big ships end up speeding up their videos so it appears smooth. Even with a great computer there's still limits to this game.

 

Link to comment
Share on other sites

  • 0
40 minutes ago, reducing said:

You could try the welding mod if you're making ships that big.

 

1000 parts is fairly high and I'd recommend making your ships smaller and more manageable.

 

blasphemy! burn the heretic!

seriously, though, my ships are the bare minimum for the specifications I ask for their performance - namely, that they can conduct missions lasting decades, performing a large variety of tasks, while providing life support to large crews, and accounting for multiple parts failure.

which is also the reason the welding mod would not work for my case. i already try to keep a low part count. fuel tanks are less than 10% of my total parts. a lot of my parts come from the need of redundancy, ensuring that when something breaks, i have spares. melding them would defeat the purpose.

Link to comment
Share on other sites

  • 0
Just now, king of nowhere said:

namely, that they can conduct missions lasting decades, performing a large variety of tasks, while providing life support to large crews, and accounting for multiple parts failure.

I have part failure mods, life support, etc and my ships never get close to 1000 parts. You're complaining about taking hours to load a single ship and I'm telling you that 1000 parts is probably the reason. Even a 1000 part ship in stock would have difficulty loading on a good computer, add in multiple mods and you are asking for trouble. I'm not sure how Kerbalism part failure works but if you need more than 2 of anything then maybe you should adjust the settings so its easier on your system. In Baris you basically get to the point where stuff doesn't fail as often and you can repair it with the kits the mod comes with so you stop needing a ton of redundancy.

When the game loads how many MM patches does it say?

Link to comment
Share on other sites

  • 0
14 minutes ago, reducing said:

I have part failure mods, life support, etc and my ships never get close to 1000 parts. You're complaining about taking hours to load a single ship and I'm telling you that 1000 parts is probably the reason. Even a 1000 part ship in stock would have difficulty loading on a good computer, add in multiple mods and you are asking for trouble. I'm not sure how Kerbalism part failure works but if you need more than 2 of anything then maybe you should adjust the settings so its easier on your system. In Baris you basically get to the point where stuff doesn't fail as often and you can repair it with the kits the mod comes with so you stop needing a ton of redundancy.

OP does grand tours. “Just make the game less hard” isn’t really a good guiding philosophy for that.

Regarding part welding, it should still help in some cases. On landers with multiple engines, wouldn’t the loss of an engine mean you have to shut down the opposite engine to prevent asymmetric thrust? That’s two parts which can be welded together, since the failure of one means that both become unusable.

 

Link to comment
Share on other sites

  • 0
39 minutes ago, AlpacaMall said:

OP does grand tours. “Just make the game less hard” isn’t really a good guiding philosophy for that.

OP might be doing grand tours but their computer clearly isn't . After looking at their Dream Big concept you could probably get rid of 75% of the stuff on that ship and it would still function the same.

Link to comment
Share on other sites

  • 0
1 hour ago, reducing said:

You're complaining about taking hours to load a single ship and I'm telling you that 1000 parts is probably the reason.

I have dealt with 1k parts before, and i keep doing it. I accept lag. I am trying to find ways to minimize it anyway.

 

1 hour ago, reducing said:

if you need more than 2 of anything then maybe you should adjust the settings

9 minutes ago, reducing said:

OP might be doing grand tours but their computer clearly isn't . After looking at their Dream Big concept you could probably get rid of 75% of the stuff on that ship and it would still function the same.

Do you have something meaningful to contribute, or are you just here to randomly disparage my chosen game style and my work?

Link to comment
Share on other sites

  • 0

The long loading times are due to a memory leak that was introduced in the game in 1.2

The memory increases most times there is a scene change.

The increase seems dependant on the size of the game save.

Bug #25218: 1.2.2 to 1.9.1 Memory leak is proportional to the size of the game save - Kerbal Space Program - Squad Bugtracker

The above link is to a bug report I did. I created a specific group of tasks to do and tested it in multiple versions. The bug report doesnt show the testing I did for versions between 1.2.2 and 1.9.1 but it was consistently the same increase. 

The graphs you see in the bug report show what the memory is doing related to the size of the game save (note the memory that KSP starts out was varying for some reason)

And the most important part which comes back to answering your question. As the memory increases the load times get longer and longer and longer

 

Lag...you mean the game performing badly due to large crafts?

2000 parts will slow down my i9 9900K

Link to comment
Share on other sites

  • 0
18 minutes ago, Anth12 said:

The long loading times are due to a memory leak that was introduced in the game in 1.2

The memory increases most times there is a scene change.

The increase seems dependant on the size of the game save.

Bug #25218: 1.2.2 to 1.9.1 Memory leak is proportional to the size of the game save - Kerbal Space Program - Squad Bugtracker

The above link is to a bug report I did. I created a specific group of tasks to do and tested it in multiple versions. The bug report doesnt show the testing I did for versions between 1.2.2 and 1.9.1 but it was consistently the same increase.

this is something i already noticed. And I already discovered this general lag can be reduced by periodically restarting the game.

but there are other factors.

just now, i got the best example: i have my new mothership, 850 parts, plus 200-odd more parts of launcher. big, lags a lot, especially during launch when there is the atmosphere to calculate.

But! As I am trying different designs, I see that small changes can have HUGE impact on lag. even though the part number is almost the same.

yes, that guy who made the megaton ship mentioned fuel crossfeed. that's one mechanism. again, not the only one.

i was bunching up 48 clydesdales to lift my ship. the lag was heavy, but manageable - say, 2-3 frames per second. i could fly that. but even with autostruts, the boosters were too fragile, and they kept detaching at the slightest disturbance. so I had to test a new way. but that launcher worked, so i wanted to set up a similar one. so i did: same everything, same main engines (12 mammoths), same boosters, bunched up in similar ways. but to stabilize them, i stuck them all with trusses between them.

that one was unplayable. instead of 3 frames per second, i got 3 seconds per frame. and all i did was adding 48 trusses to a ship with 1100 parts.

at this point i got tired, i wanted to use boosters for cheap (i have unlimited money and my ships cost in the tens of millions, but i like to pretend i have budget concerns) but i decided to use only mammoths instead. so, to each of the 12 mammoths originally used, i strapped 2 more mammoths. with relative fuel tanks. now i added engines, and i added fuel tanks, with extra crossfeed to slow down. yet this iteration is the best performing of all. lag is clearly visible, but i cannot count individual frames anymore.

three times the same ship, extremely similar, very close part count. three small differences. three completely different levels of lag.

it is clear this is not been caused by part number, or save size. it is also not caused by fuel crossfeed. so, there are mechanisms that make a huge difference in lag, that are neither part count nor fuel crossfeed. and i am trying to figure out which ones they are.

 

 

then again, most players don't have the capacity to build and fly those kind of ships. among those that do, most of them have no interest in doing it. among them, an exceedingly tiny minority have the patience to deal with the level of lag that those ships entail. it may well be that i'm among the foremost world experts in the "which specific megaship designs will make ksp lag worse" topic.

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
Answer this question...

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

 Share

×
×
  • Create New...