Any up-to-date optimization setups?

3 replies [Last post]
Zachk

My issue is stuttering/freezing/frame dips, when I definitely should not be having them. I was using a combination of [this guide](https://forums.spiralknights.com/en/node/62691) and [this guide](https://forums.spiralknights.com/en/node/12849?page=2#comment-203839), but it seems like a lot of the stuff seems 'out of date' (like how much ram to allocate).

I've already downloaded Java 7, since version 6 can't run G1 mode.

Here's what my extra text file looks like :

-server
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:+DisableExplicitGC
-XX:MaxGCPauseMillis=50
-XX:GCPauseIntervalMillis=1000
-XX:+DisableExplicitGC
-Xnoclassgc
-Xms6G
-Xmx6G

Someone else mentioned launching it via server would make it run better. Ran it in G1 mode, chose to disabled GC. Disabled classes, lowers load times in sacrifice for ram. I saw someone with '-Xms6G' and '-Xmx6G', not sure if it even works or what.

Also, should the text file have a .txt at the end, regardless of seeing the extension or not? So it would be extra.txt.txt?

Thank you very much for all the help!

Flowchart's picture
Flowchart

if you're using 64 bit java then -server is automatic, don't need to add it.

-xms6G and -xmx6G sets minimum and maximum ram to 6g, but the game doesn't seem to use that much, maybe a bit under 2G with 64-bit and +DisableExplicitGC, so probably don't need to bother with setting a minimum as setting it too high will keep the game from starting if you use 32 bit Java. 6G seems good for max though.

it's just extra.txt, not extra.txt.txt.

Otherwise what you have now is fine. Java 8 should run a little better than 7 due to improved gc, although the game won't run with anything past that.

Some others you can play around with are
-XX:ParallelGCThreads=### (set to number of cores you have - 2, to keep one for the game and one for music or whatever else you are running, also works with G1)
-XX:+UseStringDeduplication (small ram decrease)
-XX:MaxGCPauseMillis=20 (50 might be too high depending on fps you are getting)
-XX:+ExplicitGCInvokesConcurrent as an alternative to -XX:+DisableExplicitGC (this lets the gc decide itself whether to run instead of forcing it the way the game does by default or always ignoring it with the disable option). Despite what the other post said, it works with G1 as well. Not a huge difference.

Zachk
So my OS is 64-bit, I seem to

So my OS is 64-bit, I seem to be running the 64-bit version of Java; as it doesn't say *32 at the end of the process. My CPU is an i5-3570K 3.40GHz with 4 cores, so I also have quad core; and I have 16 GB of RAM, while on Windows 10. My GPU is a NVDIA GeForce GTX 1060 (6GB edition).

Everything works accordingly up until a lot of mobs pop up, then it seems to still stall or get low fps in some occasions; and it definitely feels artificial, given I'd dip from constant 60 fps to freezing or just 4 fps.

So I removed -server, and I replaced Java with version 8.

As for '-XX:ParallelGCThreads=###', should I just put in 2 since I have 4 threads? I want the game to use all of my threads, so wouldn't it be 4?

I added String deduplication...

With '-XX:MaxGCPauseMillis=20', what do you mean 50 might be too high 'depending on the fps [I'm] getting'?

Also with '-XX:+ExplicitGCInvokesConcurrent', I don't really mind it utilizing more RAM for faster load times since I have so much anyways.. Is there any other benefit than that?

Thank you very much for your help! I'm just looking to find things to make the game not only run better, but also utilize my hardware 'better'.

edit: Version 'jre1.8.0_281' crashes my game whenever I use it, what version of 8 are you talking about?

edit 2: Other commands were crashing my game.

'-XX:ParallelGCThreads=### ' seems to work fine, for the most part. Still wondering if I should increase 2 to 4.

'-XX:+UseStringDeduplication' seems to give me the error 'Error: Could not create the Java Virtual Machine.' 'Error: A fatal exception has occurred. Program will exit.'

'-XX:MaxGCPauseMillis=20' seems to work without crashing me, but I'm tentative on how to utilize it properly

Removing '-XX:+DisableExplicitGC' and adding '-XX:+ExplicitGCInvokesConcurrent' seems to not crash me either, but what should I do?

In fact, should I use G1 in the first place; or use the other setting instead?

Blaze-Bomb
Pretty recent guide & launcher

This [https://steamcommunity.com/sharedfiles/filedetails/?id=1847575647] thread was last updated 22 Dec, 2020.

This launcher [https://github.com/lucas-allegri/KnightLauncher/releases] from the thread is still going today, and makes this whole thing easier. They also have a discord server [https://discord.gg/RAf499a] where you're more likely to get answers for your questions.

Hope this helps!