Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Planet Search Overhaul (07/13/24)

Author Topic: What I had to do to make this game run with a huge mod list  (Read 5127 times)

React52

  • Ensign
  • *
  • Posts: 17
    • View Profile

Heyo just returning to the game after..oh god 3 years? I did mod the game back then, but didn't run into this many problems. So if you're suffering from the aforementioned issues, this is for you. I'm only making this as someone who uses mods, not creates them. The included issues are Permgen Crashes/Eventual FPS slow down

Let's go over the things I had to set to make this game work properly with a ridiculous amount of mods. Let's talk about vmparams, It's been noted in multiple places to change the XMS for memory.

So people recommend changing it to 8 gigs or -Xms8000m -Xmx8000m, personally I'm crazy and have it set to 14000 because I have 16 gb's of ram. It's not recommended doing this because it may cause instability, but I haven't experienced this.

Eventually you'll run into a crash with an error called Permgen, or something like that. So now you need another command. This is from another thread

It's definitely correlation - music stuff is on another thread so it's just sprinkled in the log wherever.

You could try adding this to your vmparams:
-XX:PermSize=512m -XX:MaxPermSize=512m

That may resolve the issue, unless it's somehow caused by a leak, in which case it might only delay it instead, or even simply cause it to manifest differently.

You need -XX:PermSize=512 naturally I put XX:PermSize=4000m -XX:MaxPermSize=4000m probably not recommended, but it works for me, but try 512m first. Be careful putting this in your vmparams, if you mess up the - the entire game will fail to start. So this is what mine looks like

Xms14000m -Xmx14000m -Xss2048k -XX:PermSize=4000m -XX:MaxPermSize=4000m -etc etc

..Please don't actually copy that, unless you really want to. I don't know if such high values will cause issues, it's been fine for me and I just wanted the game to keep running..forever. Or at-least until I'm too tired, which, worked.

This isn't over either..there's more. Eventually you may run into the game slowing down after..a big fleet war. The FPS will get shredded, so we need another solution. Thankfully someone can help us with that.

Quote
Mini-guide: Switching to Java 8 to prevent the post-battle slowdown
Not officially supported, may cause unrelated issues, do at your own risk and please report back if you do notice it causing problems.

Symptoms
- After some time playing and immediately after a battle, the game FPS will plummet (eg from 60 to 15-25) and usually only go back to normal after a game restart.
- Saving/loading takes 5x longer than usual.
- Using at least one mod (that adds new sprites? incl. GraphicsLib).

Fix (slow down and read this part carefully)
1. Go to your starsector install and rename the jre folder to jre7.
2. Download either of the following (both are the same JRE 8 v271) (Mac/Linux users look below for download link):
    - (72 MB .zip) https://drive.google.com/file/d/1CGRtnv5hIGCtcdlvZXFO0F58VXqYUo6x/view?usp=sharing
    - (48 MB .7z) https://drive.google.com/file/d/155Lk0ml9AUGp5NwtTZGpdu7e7Ehdyeth/view?usp=sharing
3. Extract that into your game folder so you have a folder named jre. You'll now have both jre (with java 8 ) and jre7.
4. Make sure that your starsector/starsector-core/data/config/settings.json allowAnyJavaVersion is set to true. Then launch the game as normal.


Potential issues
- Game+launcher is zoomed in/off-center.
    Fix: Right-click Starsector, Properties, Compatibility, Change high DPI settings, tick checkbox for "Override...Scaling performed by Application"
    Thanks to Normal Dude for the fix.

* Mac/Linux JRE 8 downloads:
Linux: https://drive.google.com/file/d/1TRHjle6-MOpn1zJhtSA9yvwXIQip_F_n/view?usp=sharing
MacOS: https://drive.google.com/file/d/1PW9v_CL719buKHe69GaN9fCXcPIqDOIi/view?usp=sharing


I have no idea who this quote comes from..but that did fix the eventual FPS drops that I had. And now I can finally run star sector with a crazy ton of mods, with no crashes and as long as I want. Enjoy huge fleet battles without my FPS being tanked soon after. I wanted to make a thread like this, because these fixes were on multiple threads, and never in one place. Sure the memory tweaks are public knowledge, but the rest of this..a bit hard to find so it will be easier if they're in one place. This java 8 edition fix fixed all of that though, saving is fluid every time, no fps drops, just able to enjoy the game.

Apparently these fixes can cause unforeseen consequences, but I am using them and have had 0 issues..so idk? use at your own discretion? 

Also as a note, I have an I7-7700k with an RTX 2070 Super so I can run with a ridiculous amount of mods. Only really do this if you know your pc can handle it.

There is the ClearCommands mod which may help you if you have performance issues, but those performance issues may be tied to the version of java you're using. I tried ClearCommands while my fps was getting destroyed, didn't work, so the java issue is a completely separate issue from this. I've never had any performance issues in the game besides the java issue.

Using all these fixes worked for me, have resulted in no more crashes, can play game for long time, me happy. :) I don't know if there is a memory leak, and if eventually, this would lead your game to crash. I haven't ran into that, last night I played for hours, huge ship battles, everything you could possibly think of to crash, just smooth like butter after doing all of this. I can't guarantee that this will work for everyone, it depends on your hardware. You may still have performance issues if simply your pc can't handle the game with so many mods. If you have a beast pc, which It's 2022, I'd imagine a-lot of you do..probably, give it a go.







Logged
oh god..

Foxy

  • Commander
  • ***
  • Posts: 150
  • About me: I make simple mods ^__^
    • View Profile
Re: What I had to do to make this game run with a huge mod list
« Reply #1 on: April 21, 2022, 11:49:56 PM »

The JRE fix should also improve the Vanilla experience!
Personally I use as few mods as possible to mitigate any issues and mostly I focus on cosmetic rather than new game mechanics as those can pose possible conflicts.
Logged

Wispborne

  • Captain
  • ****
  • Posts: 436
  • Discord: wispborne
    • View Profile
Re: What I had to do to make this game run with a huge mod list
« Reply #2 on: April 22, 2022, 10:12:12 AM »

JRE 8 fixes the PermGen crash by itself, no need for a separate thing for that.

The two big changes every person who's starting to add mods should make is:
- Add more RAM via vmparams (this is safe assuming you don't assign it more RAM than your computer has free)
- Switching to JRE 8 (this is generally safe, most of the active users in the USC Discord are using it, but not guaranteed safe, otherwise Alex would make it the default)

There is also a mod/patch/thing on the USC Discord by Himeni in #mod_updates that promises further performance improvements (but as I have a relatively powerful laptop, I haven't used it).

One last note - the slowdown that's fixed by JRE 8 is not particularly dependent on your PC specs. You can have a $4000 PC and still drop to 30fps after a time in a modded game. JRE 8 is the fix for that.
Just making that super clear in case anyone came in with the preconception that their RTX 4090 TI should be immune.
« Last Edit: April 22, 2022, 10:15:46 AM by Wispborne »
Logged
Mod: Persean Chronicles | Mod Managers: SMOL & TriOS | Tool: VRAM Estimator | Tool: Forum+Discord Mod Database | If I'm inactive for 3 months, anyone can use any of my work for anything (except selling it or its derivatives).

grimcreaper

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: What I had to do to make this game run with a huge mod list
« Reply #3 on: April 28, 2022, 05:03:11 PM »

The only things i have done are increase ram in VMParams to 4.5gb and use JRE8.

I am currently using around 150 mods and dont have any issues at all and the game runs super smooth.
Logged

envenger

  • Lieutenant
  • **
  • Posts: 59
    • View Profile
Re: What I had to do to make this game run with a huge mod list
« Reply #4 on: May 01, 2022, 10:38:42 AM »

Why is the game not shipping with JRE8 by defualt? Or is that something that can't control?
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 550
  • Seals :^)
    • View Profile
Re: What I had to do to make this game run with a huge mod list
« Reply #5 on: May 01, 2022, 11:39:03 AM »

Why is the game not shipping with JRE8 by defualt? Or is that something that can't control?

iirc because last time alex tried it it resulted in a bunch of untraceable crashes, but since the vanilla game runs fine on 7 it's just stayed that way

Chairman Suryasari

  • Captain
  • ****
  • Posts: 378
  • The Deployer of John Lennon's.
    • View Profile
Re: What I had to do to make this game run with a huge mod list
« Reply #6 on: May 01, 2022, 06:36:14 PM »

And you need an older build of Java 8 for Starsector too, because the newer one is case sensitive iirc. On Linux, I spend quite some time to find any older archive of Java 8 but it's worth it. I understand why Alex hasn't moved the game to Java 8 yet, recompiling the game to run on newer Java 8 can be difficult and he probably focuses on finishing the content for 1.0 too.
Logged
"Kids under 13 shouldn't have access to the internet. if 10yo me were on tumblr and read about suicide and depression 5 hours a day, every day, god knows i would jump off a bridge if my parents ever yell at me."

-Some random Youtube comment on video about Sonic OC.

Dhunt05

  • Lieutenant
  • **
  • Posts: 54
    • View Profile
    • Twitch
Re: What I had to do to make this game run with a huge mod list
« Reply #7 on: May 03, 2022, 10:32:29 PM »

i run 240 mods. most of them ive also gone into and fully edited and what not to suite my needs. if you want to i stream SS often so ill pm you my twitch if you want to talk about it and get help :D
Logged