Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95a is out! (03/26/21); Blog post: Skill Changes, Part 2 (07/15/21)

Author Topic: Constant Save Corruption [Mods]  (Read 5113 times)

Blaze

  • Commander
  • ***
  • Posts: 219
    • View Profile
Constant Save Corruption [Mods]
« on: November 15, 2014, 09:40:08 AM »

I've only been able to play any given save for about 4-6 hours total before I can't load it anymore.

I'm pretty sure it's due to running out of memory (Due to Starsector+ and addons). To help compensate, I've reduced the maximum number of economic fleets, but it still doesn't help too much. I'm using an ancient laptop with only 4gb memory (The game is set to 1024, so I *think* I can safely up it to 2048, but I want to try other ways of reducing usage first.).

Is there any way I can further reduce save file size? I haven't been able to find the maximum number of patrol fleets/detachments, which are pretty huge and probably take up tons of memory. Will using unzipped saves perhaps help in some manner?
« Last Edit: November 15, 2014, 10:30:12 AM by Alex »
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2789
  • Your Friendly Forum Friend
    • View Profile
Re: Constant Save Corruption
« Reply #1 on: November 15, 2014, 09:46:44 AM »

Have you tried exiting the game, restarting and then trying your saves?
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

Blaze

  • Commander
  • ***
  • Posts: 219
    • View Profile
Re: Constant Save Corruption
« Reply #2 on: November 15, 2014, 09:50:18 AM »

Yep.

Console says Java heap error, out of memory. I'm fairly certain it wouldn't do much.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19106
    • View Profile
Re: Constant Save Corruption
« Reply #3 on: November 15, 2014, 10:30:04 AM »

Hi - take a look at this thread:
http://fractalsoftworks.com/forum/index.php?topic=8690.0

It's basically the same issue, but with information on how to resolve it.


In the next (0.65.2a) release, the game will use roughly 2x less memory for saving/loading, which should help with this. Still, with enough mods enabled, there are going to be problems - that's not something that can be fully resolved, only the ceiling raised.

(Also: edited thread title to say [Mods], b/c the initial title freaked me out :))
Logged

Blaze

  • Commander
  • ***
  • Posts: 219
    • View Profile
Re: Constant Save Corruption [Mods]
« Reply #4 on: November 15, 2014, 11:39:49 AM »

Bah, the batch file doesn't recognize the mods and attempting to edit vmparams to use 2048m or 2g instead of 1024m causes the exe to not work at all.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19106
    • View Profile
Re: Constant Save Corruption [Mods]
« Reply #5 on: November 15, 2014, 12:00:34 PM »

... attempting to edit vmparams to use 2048m or 2g instead of 1024m causes the exe to not work at all.

Hmm. Two possible causes here: 1) not having replaced the game's Java with 64-bit, using the instructions in the other thread or 2) a typo in vmparams :)
Logged

TimeDiver

  • Commander
  • ***
  • Posts: 186
    • View Profile
Re: Constant Save Corruption [Mods]
« Reply #6 on: November 15, 2014, 12:40:36 PM »

Bah, the batch file doesn't recognize the mods and attempting to edit vmparams to use 2048m or 2g instead of 1024m causes the exe to not work at all.

If you, like me are stuck with 32-bit Java due to having a 32-bit operating system installed (yeah, we're a dying breed)...

I've found that the highest memory allocation that allows some, but not all (modded) saves that won't load with the default parameters as of 0.65.1a, is either 1408m or 1472m.

Anything higher than that either crashes Starsector during the initial asset loading/script compilation phase, or the loader itself refuses to, well... even load up at all.

For example, any saves that have Starsector+, the Knights Templar, and its prerequisites of Lazy/ShaderLib(s) installed with the default config settings for said mods, have a increasingly higher tendency to fail to load over time (especially as additional 'integrated' mods are added to the mix) even with said 1408m/1472m memory allocations.

Also, for the Knights Templar mod in particular: its crusade(s) event spawns a shitton of fleets for both that faction when said event kicks off, as well as those of vanilla SS and SS+'s 'integrated' factions, such as Shadowyards, Mayorate, Citadel, Interstellar Imperium, and so on.

Opening up the KT mod's own settings.json and decreasing the 'crusadeScale' value to say, 0.5 or less, or alternatively (or even both), increasing the 'crusadeAverageFrequency' to a much larger value, can possibly serve as a stopgap measure until 0.65.2a shows up. Or just not enable the Knights Templar for campaigns.

Although it should be noted that my version of Windows 7 has had the following parameter set via the command prompt (to allow more than 2 GB to be allocated to any single program):

bcdedit /set IncreaseUserVa 3072
« Last Edit: November 15, 2014, 04:05:39 PM by TimeDiver »
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3314
  • Toss a coin to your Modder, O' valley of plenty
    • View Profile
Re: Constant Save Corruption [Mods]
« Reply #7 on: November 15, 2014, 12:45:54 PM »

Also, you may have only 0.65a and not updated to 0.65.1a. That caused the mods not to be recognized with the .bat
Logged
 

Lord Sputnik

  • Commander
  • ***
  • Posts: 101
  • "One Of Ours, Sir!" = Best ship name ever...
    • View Profile
    • Email
Re: Constant Save Corruption [Mods]
« Reply #8 on: November 15, 2014, 03:30:23 PM »

My saves are getting corrupted every single time I quit the game.  Even saves that worked just fine and were not touched get corrupted.  I've double-checked this and it will even happen if I save right after starting a new game.  I've had to restart a few good games I've had going but it shouldn't be doing this every single time I quit. This is the log file.

Spoiler
Code
719180 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 4
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 5
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 6
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Error loading
719181 [Thread-5] ERROR com.fs.starfarer.campaign.save.CampaignGameManager  - com.fs.starfarer.util.H cannot be cast to java.util.zip.ZipInputStream
java.lang.ClassCastException: com.fs.starfarer.util.H cannot be cast to java.util.zip.ZipInputStream
at com.fs.starfarer.campaign.save.CampaignGameManager.o00000(Unknown Source)
at com.fs.starfarer.title.B.dialogDismissed(Unknown Source)
at com.fs.starfarer.ui.oO0O.dismiss(Unknown Source)
at com.fs.starfarer.ui.impl.J.dismiss(Unknown Source)
at com.fs.starfarer.campaign.save.LoadGameDialog.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.thisnew.super(Unknown Source)
at com.fs.starfarer.ui.null.processInput(Unknown Source)
at com.fs.starfarer.ui.O0Oo.o00000(Unknown Source)
at com.fs.starfarer.B.void.class$super(Unknown Source)
at com.fs.A.oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Ò00000(Unknown Source)
at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.super(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 11
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 12
719182 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 13
719182 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 14
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading progress: 0.97507495
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Releasing context
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Released context
719186 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 15
719186 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 16
719212 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 17
719212 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 18
719213 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 19
719213 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 20
[close]
Logged
ZeroGman

Self-proclaimed lord of Eos, lord of Magec, and lord of the dance.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 19106
    • View Profile
Re: Constant Save Corruption [Mods]
« Reply #9 on: November 15, 2014, 03:32:05 PM »

My saves are getting corrupted every single time I quit the game.  Even saves that worked just fine and were not touched get corrupted.  I've double-checked this and it will even happen if I save right after starting a new game.  I've had to restart a few good games I've had going but it shouldn't be doing this every single time I quit. This is the log file.

Spoiler
Code
719180 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 4
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 5
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 6
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Error loading
719181 [Thread-5] ERROR com.fs.starfarer.campaign.save.CampaignGameManager  - com.fs.starfarer.util.H cannot be cast to java.util.zip.ZipInputStream
java.lang.ClassCastException: com.fs.starfarer.util.H cannot be cast to java.util.zip.ZipInputStream
at com.fs.starfarer.campaign.save.CampaignGameManager.o00000(Unknown Source)
at com.fs.starfarer.title.B.dialogDismissed(Unknown Source)
at com.fs.starfarer.ui.oO0O.dismiss(Unknown Source)
at com.fs.starfarer.ui.impl.J.dismiss(Unknown Source)
at com.fs.starfarer.campaign.save.LoadGameDialog.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.thisnew.super(Unknown Source)
at com.fs.starfarer.ui.null.processInput(Unknown Source)
at com.fs.starfarer.ui.O0Oo.o00000(Unknown Source)
at com.fs.starfarer.B.void.class$super(Unknown Source)
at com.fs.A.oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Ò00000(Unknown Source)
at com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.super(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 11
719181 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 12
719182 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 13
719182 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 14
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading progress: 0.97507495
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Releasing context
719186 [Thread-17] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Released context
719186 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 15
719186 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 16
719212 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 17
719212 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 18
719213 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 19
719213 [Thread-5] INFO  com.fs.starfarer.campaign.save.CampaignGameManager  - Loading stage 20
[close]

Looks like you've disabled save file compression. There's a bug where that doesn't work, it's fixed for  0.65.2a. For now, just turn save compression back on.
Logged

Lord Sputnik

  • Commander
  • ***
  • Posts: 101
  • "One Of Ours, Sir!" = Best ship name ever...
    • View Profile
    • Email
Re: Constant Save Corruption [Mods]
« Reply #10 on: November 15, 2014, 03:41:26 PM »

Ah thanks, yeah, I forgot I copied over some settings from 0.63.  For some reason the installer doesn't overwrite it so moving my 0.65 and 0.63 to separate folders and doing a fresh install works now!
Logged
ZeroGman

Self-proclaimed lord of Eos, lord of Magec, and lord of the dance.

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Constant Save Corruption [Mods]
« Reply #11 on: November 15, 2014, 04:41:47 PM »


Although it should be noted that my version of Windows 7 has had the following parameter set via the command prompt (to allow more than 2 GB to be allocated to any single program):

bcdedit /set IncreaseUserVa 3072

Ah...I should know about that one, good catch on that one. I had heard about windows reserving the upper 2GB, for user virtual memory, didn't know it was editable. Could be useful for some.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 3351
    • View Profile
    • Bitbucket profile
    • Email
Re: Constant Save Corruption [Mods]
« Reply #12 on: November 15, 2014, 06:54:15 PM »

Couple of quick notes on issues with raising -Xmx:

1) See my thread here

2) The Java heap space requires a contiguous block of memory, so if Starsector won't start after raising the value, try things like closing browser windows to free up RAM.
Logged