Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue with Sigma Dimensions #81

Closed
ghost opened this issue Jun 11, 2019 · 68 comments
Closed

Performance issue with Sigma Dimensions #81

ghost opened this issue Jun 11, 2019 · 68 comments

Comments

@ghost
Copy link

ghost commented Jun 11, 2019

The thing is, I've encountered a issue with performance, but unlike #72, it seems to be related to the resize, the larger I rescale to, the laggier. I'm using 4X resize on planet pack JNSQ, and I can only get 50 fps with a 40 part vessel on 640km sized minmus. The weirder thing is that I can get smooth 60 fps on a 6400km sized kerbin with 100 parts, which doesn't make any sense?
This bug seems to be present on 1.7.0 and 1.7.1, and regardless of what shader I'm using.
Sorry if I sound rude or something, for some reason I'm fairly bad at expressing politeness when using English. I absolutely love this mod and it has become one of my essential mods that I can't get rid of.

@Sigma88
Copy link
Owner

Sigma88 commented Jun 11, 2019

The reason why it is worse to have a 640km minmus than a 6400km kerbin is because most likely the game tries to load only a certain portion of the planet, since stock minmus is smaller the default is probably to load a big % of the planet (because it is so small anyways)

however, when you increase the size of minmus that big % keeps getting loaded all at once, which might be the cause of your FPS drop

I'm not really sure how to fix this, first of all I need to figure out which is the feature in question and then try to find a reasonable way to approach the solution

maybe @StollD knows which is the parameter in question

@Sigma88
Copy link
Owner

Sigma88 commented Jun 11, 2019

Just to be on the safe side, could you send me the files listed here:
https://forum.kerbalspaceprogram.com/index.php?/topic/181547-171-5-backports-kopernicus-kittopiatech/&page=27&tab=comments#comment-2793409

Thanks

@ghost
Copy link
Author

ghost commented Jun 12, 2019

I don't know how did I came to the conclusion that scale has a influence, probably because vsync was on and I got 60 FPS for a while in 1.1X resize. I moved almost all my mod away, disabled vsync, and get 110-130 FPS without Sigma dimensions, and 60-70 with it.
Log stuff.zip
I also forgot to emphasize that I'm using planet pack JNSQ which compeletly overhauls all the planets, and is also a native 2.7X sized pack (So by scaling 4X the size will be 10.8X, aka real world size), so Kerbin and Minmus has different ground features than stock.

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

Did you try doing the test on just stock ksp to make sure it's not a jnsq issue?

If you try I would suggest trying both 4x and 10x since the final size of jnsq is 10x stock

also, could you try with your current setup (JNSQ + SD) but without any changes to the base SD

so the planets would be the same as without SD

@ghost
Copy link
Author

ghost commented Jun 12, 2019

UH oh, looks like a problem with JNSQ... Nope, see the posts below
10X stock resize:
screenshot3
Stock with only Kopernicus and its dependencies
screenshot4

@ghost
Copy link
Author

ghost commented Jun 12, 2019

HMMMMMM...
Default parameter doesn't slow down the game with JNSQ at first, but after save and loading the game FPS drops for some reason
screenshot5

@ghost
Copy link
Author

ghost commented Jun 12, 2019

OOF
After literally only pressing F5 then F9, FPS drops down to 75
screenshot6

@ghost
Copy link
Author

ghost commented Jun 12, 2019

Seems save and load lags game with only Kopernicus and default parameter SD installed too, but not that obvious
Before:
screenshot7
After:
screenshot8

@ghost
Copy link
Author

ghost commented Jun 12, 2019

I think I can confirm this issue happens is related to SD, and only happens when a vessel is reloaded, since I smashed F5 and F9 a lot with a non SD install, with both JNSQ installed and not installed, but I can't notice any performance difference before and after loading a save in flight.

@ghost
Copy link
Author

ghost commented Jun 12, 2019

"I don't know how did I came to the conclusion that scale has a influence, probably because vsync was on and I got 60 FPS for a while in 1.1X resize. I moved almost all my mod away, disabled vsync, and get 110-130 FPS without Sigma dimensions, and 60-70 with it."
Regarding this, I think I didn't noticed performance issue only happens after loading a save in flight, so I came to the conclusion that it it related to planet size. Now I think it's actually an Sigma Dimension glitch.

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

I'm not really sure what the issue is,

from your screenshot there doesn't seem to be any difference between stock and 10x

image

on a 10x rescaled system (top) the framerate goes up and down between ~60 and ~190 while on stock it goes up and down between ~70 and ~170

am I missing something?

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

Here is a recompiled version of SD with a couple of features disabled, let's see if this has any effect

SigmaDimensions.TEST_1.zip

I haven't tested this so it might not work properly 100%

of course don't use this on an important save, most likely hell will ensue

@ghost
Copy link
Author

ghost commented Jun 12, 2019

Whoops, I meant that game's performance only drops when reload a save on flight scene with sigma dimensions, previously I didn't notice that and performance issue wasn't there.

@ghost
Copy link
Author

ghost commented Jun 12, 2019

Oh, I think my English is just not that great. I meant see the posts below, not the screenshots

@ghost
Copy link
Author

ghost commented Jun 12, 2019

screenshot13
uh oh

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

I understand what you mean, however I don't see much drop in the screenshot that's why I am a bit confused.

the logs are clean so there are no errors apparently, I'm not really sure how to approach this and I can't really reproduce the issue since my potato pc never goes over 70 fps 🤣

uh oh

yes I assumed it was going to break, give me some time to make a better plugin

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

here
SigmaDimensions.TEST_2.zip

also:
locate and delete the file
GameData\Sigma\Dimensions\Configs\ReDimension\resizePQSMods.cfg

@ghost
Copy link
Author

ghost commented Jun 12, 2019

I still gets only ~75 fps rather than 130 on JNSQ's minmus surface(It has the most obvious performance drop from this glitch, so should I test with this condition rather than stock?), so I guess things aren't related to the parts that you removed?

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

is this even if you removed the cfg file I told you to?

@ghost
Copy link
Author

ghost commented Jun 12, 2019

Yes

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

and you don't get the error without SD

btw if you prefere I am also on kopernicus discord (channel "sigma-mods")

@ghost
Copy link
Author

ghost commented Jun 12, 2019

Yes...

@ghost
Copy link
Author

ghost commented Jun 12, 2019

I'll try remove SD and test again to 100% confirm this

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

thanks

@ghost
Copy link
Author

ghost commented Jun 12, 2019

BTW switching vessel/load a vessel from tracking station hits the performance too, just discovered

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

btw if you prefere I am also on kopernicus discord (channel "sigma-mods")

(I repeat this in case you missed it before)




could you try running the game with no plugin?

and this file still deleted
GameData\Sigma\Dimensions\Configs\ReDimension\resizePQSMods.cfg

@ghost
Copy link
Author

ghost commented Jun 12, 2019

I can confirm removing SD really removes the glitch, now it's time to test with only .cfg files
Actually I haven't used discord before... Maybe I'll look into that later?

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

Actually I haven't used discord before... Maybe I'll look into that later?

don't worry we can speak here, it's just a weird type of chat 🤣

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

I can confirm removing SD really removes the glitch, now it's time to test with only .cfg files

this is good

@ghost
Copy link
Author

ghost commented Jun 12, 2019

With only cfg files there's no fps drop

@ghost
Copy link
Author

ghost commented Jun 12, 2019

~75FPS
Actually I want to say sorry too, I need to go sleep soon or I wont be able to get up tomorrow. After about 10 hours I'll have some time again.
I'm okay with testing your mods though, since I have an extra screen connected to my laptop I can watch some videos while testing KSP. And SD is one of my must-have mods, I'm glad I can help with its development.

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

I'll keep posting zips here, when you need to go just stop replying and when you have time we take from where we left off

SigmaDimensions.TEST_6.zip

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

if TEST_6 still has issues here is TEST_7
SigmaDimensions.TEST_7.zip

@Sigma88
Copy link
Owner

Sigma88 commented Jun 12, 2019

and if 7 doesn't fix, here's 8
SigmaDimensions.TEST_8.zip

@ghost
Copy link
Author

ghost commented Jun 12, 2019

~130 FPS on 6!

@ghost
Copy link
Author

ghost commented Jun 12, 2019

To make sure the module removed on 6 is the cause of the glitch, I tested again and get ~70 on 5, 130 on 7 and 8

@Sigma88
Copy link
Owner

Sigma88 commented Jun 13, 2019

Yes I had a feeling 6 was the solution

@Sigma88
Copy link
Owner

Sigma88 commented Jun 13, 2019

This should be fairly easy to fix

@ghost
Copy link
Author

ghost commented Jun 13, 2019

Nice

@Sigma88
Copy link
Owner

Sigma88 commented Jun 13, 2019

here's another test version:
SigmaDimensions.TEST_9.zip

before to install this:

1- remove the old SigmaDimensions folder and re-install the mod properly
2- replace the SD dll with the test_9 dll
3- test if the bug has been fixed

@ghost
Copy link
Author

ghost commented Jun 14, 2019

Weird. Instead of 75 or 130 fps I get ~100 this time. Definitely an improvement though.

@Sigma88
Copy link
Owner

Sigma88 commented Jun 14, 2019

I was worried this could happen, there might be 2 problems. we need to figure out which is the second part that is causing the fps drop.

here is a new dll to test
SigmaDimensions.TEST_10.zip

alternatively, this could be an issue related to terrain scatter (see this kopernicus issue)
so please try also to load the game with SD TEST_9 and disabling terrain scatter in the settings

@ghost
Copy link
Author

ghost commented Jun 14, 2019

Maybe not related to that issue, since my terrain scatter is already disabled, and got same performance problem before switching to 1.7.1.
Test 10 improves the game performance a bit more, but I still seems to have ~10 fps lower than without SD.
That's acceptable though, I think I can land a 200 part vessel on minmus now...

@Sigma88
Copy link
Owner

Sigma88 commented Jun 14, 2019

could you try this version?
SigmaDimensions.TEST_11.zip

@ghost
Copy link
Author

ghost commented Jun 14, 2019

Whoops, was writing my assignment and didn't notice your comment until now. Guess I'll give it a test tomorrow (about 8 hours later)...

@Sigma88
Copy link
Owner

Sigma88 commented Jun 14, 2019

Don't worry, I may be able to upload a couple of more tests by then

@ghost
Copy link
Author

ghost commented Jun 15, 2019

11 seems to have no improvent for me

@Sigma88
Copy link
Owner

Sigma88 commented Jun 15, 2019

do you mean improvement over the current release or over TEST_10 ?

it should not improve on 10,

TEST_10 had 2 features disabled

TEST_11 has 1 feature disabled and 1 feature fixed

if you are getting the same FPS with TEST_10 as you get with TEST_11 that's a good thing

@ghost
Copy link
Author

ghost commented Jun 15, 2019

Yep, almost the same FPS.👍

@Sigma88
Copy link
Owner

Sigma88 commented Jun 15, 2019

Ok, this is a good sign then!

@Sigma88
Copy link
Owner

Sigma88 commented Jun 15, 2019

here, this should be a version of the current SD that have the fps drop fixed
SigmaDimensions.TEST_12.zip

while I was fixing this I found some bugs that are present in this version but are also in the latest release.
since Test_12 fixes this issue you can just use this and I will try fixing the other bugs before making a new release.

let me know if this version gives you any issues

thanks for helping fixing this issue!

@ghost
Copy link
Author

ghost commented Jun 16, 2019

Seems this bug is fixed for me!

@Sigma88
Copy link
Owner

Sigma88 commented Jun 17, 2019

I'm going to release this in a few days.
I will leave it here in case someone wants to test it first

The only changes from the latest release are the performance drop fix linked above and another fix for building altitude recalculation

SigmaDimensions.TEST_13.zip

@Sigma88
Copy link
Owner

Sigma88 commented Jun 23, 2019

fixed in the latest release

https://github.com/Sigma88/Sigma-Dimensions/releases/v0.10.4

@gazpachian
Copy link

gazpachian commented Aug 30, 2020

This bug persists for me (perhaps due to different issues) in KSP/Kopernicus version 1.8.1 with SD 0.10.7 under Linux. I ran the game fine at ~2x scale, stock system, with a decently sized mod list for a couple of months, then decided to restart at a larger scale (4.3x) and I get massive performance hits when close to the surface of the Mun or Minmus. Especially at Minmus it is evident the terrain is loaded at a much higher detail than necessary for quite some distance - distant hills are visibly smoother than they "should be".

Failed attempt at fixing the issue: MM patch to limit the max PQS detail seems to have no discernible effect on performance:

@Kopernicus:FOR[SigDim2]
{
    @Body:HAS[@PQS]
	{
		@PQS
		{
			%minLevel = 1
			%maxLevel = 4
		}
	}
}

With the issue also mentioned in relation to JNSQ by ArXen42 I assume the likely culprit is Kopernicus itself this time? Still I figure the issue is likely highly related to the original issue in SD, so perhaps you recall what you changed in SD to fix this originally and see if any related issues have popped up in the source for Kopernicus in later iterations?

@Sigma88
Copy link
Owner

Sigma88 commented Aug 31, 2020

yes I am supposed to change the min/max level but I haven't had too much free time lately and honestly ksp modding is not very high on my priority list at the moment

@gazpachian
Copy link

No worries, thanks for taking the time to reply and hope you're doing well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants