shadowmage45 / KerbalFoundries2

KerbalFoundries - Continued
19 stars 8 forks source link

Game Hitches When KF Wheels Leave Ground #42

Open doubleuudude opened 5 years ago

doubleuudude commented 5 years ago

If I use any of the KF wheel or track gear on a vessel it will behave fine while on the ground at Kerbin but if I take them in the air or cheat them into orbit my game starts to "hitch". It runs for a few seconds then completely freezes for about a second. Suspecting it might be my craft, which was heavily clipped, I attempted this with a Mk1 cockpit and a pair of several different wheels and tracks. They all exhibited this behavior with just the Mk1 cockpit. This includes almost all of the tracks and every single wheel. I didn't find one that didn't cause this problem. The fixed gear was ok. I'm very eager to resolve this so I'm happy to do any additional testing or troubleshooting you'd like. I tailed the log when this was happening and didn't see any messages that gave me any ideas. The attached log file was taken from several different tests with all different wheels. Hopefully it helps. If I need to do a completely clean install I'll cry but I'll do it. I just discovered this mod and I love the tracks. KSP.log

P.S. I had another cleaner install which I tried the newest pre-release in and it's doing the same thing. KSP.log

doubleuudude commented 5 years ago

I've done some more troubleshooting and I think this is a GC issue but I'm not sure why only parts from this mod are affected. I have a test craft with 116 parts which includes 4 of the RF RBI tracks. If I launch this vessel with those tracks about 15 seconds after liftoff the GC starts running every 2 seconds. If I remove just those parts and relaunch, GC is every 30 seconds. I've made a post in the MemGraph forum about this as well with my MG screenshots: https://forum.kerbalspaceprogram.com/index.php?/topic/175924-15-memgraph-updated-with-stutter-reduction/&do=findComment&comment=3561077

doubleuudude commented 5 years ago

MemGraph has resolved this issue for the most part. GC is still much slower and causes a significant freeze when it runs when I have these wheels attached but at least it runs much less frequently now.

shadowmage45 commented 5 years ago

I would not put the onus for solving this problem purely in the hands of MemGraph. It is great for what it is, but it is not a silver bullet for all issues GC-Related. More of a bandaid for this issue than a proper fix :)

Apologies for not responding sooner -- I've had a few other reports of GC issues, and have yet been able to verify them. Your inclusion of knowledge that it is happening more often when the wheels leave the ground gives some important information as to where to look in the code and what could be causing the problems.

Hopefully I'll get some time to investigate a bit further in the upcoming days for one of the next releases.

linuxgurugamer commented 5 years ago

I’ll just add that I have observed this in my game as well. Never thought it was KF though. I can run tests if that would help

shadowmage45 commented 5 years ago

Thanks for the confirmation and offer.

Unfortunately I think it is merely going to come down to me spending some major time doing playtesting and debugging -- no real other way around it.

The one thing that might help is if someone could provide me with a save file that could be used to easily replicate the problem (using stock/kf parts only. I've never noticed this issue during my internal testing, but I generally design very simple craft, and do very simple/standard tests (which do involve some leaving of the ground during jumps/etc, but nothing more than a moment or two).

marc-ledent commented 5 years ago

I encountered the same issue, when the launcher reaches around 300m or so, but since I use quite a lot of mods, I cannot certify that wheels are the culprit. I'll make a test this evening with a cleaned up version.

marc-ledent commented 5 years ago

Here is the ship that causes the problem. It causes a little hitch every second a few seconds after take off. My processor is an AMD FX-8320 at 3.5 GHz (not brand new ;-) ) The GC is an ASUS R9 270X And it's W7

Reproduced on KSP 1.7.2. The problem is more visible when some mods are added. VAB.zip

daliu87 commented 5 years ago

I think I have the same issue, on KSP 1.7.3.

Everything is fine on Kerbin ground, but once the rocket gets in the air, everything lags and FPS goes to 1.

Memgraph shows the memory usage spikes, from 15MB to over 200MB, which triggers the GC every second.

This seems to happen for most tracks and wheels, like KF Small Track.

ksp_foundries_mem