7234 发表于 2026-9-7 01:36:29

保存报错

### 游戏信息

游戏版本:                0.98a-RC8

### 系统信息

操作系统:Microsoft Windows 11 专业版

版本:10.0.26200 暂缺 Build 26200

总可用内存:`15.64G`


游戏Java版本:`17.0.10`

游戏Java路径:F:\GAME\Starsector\jre

工具运行Java版本:`17.0.10`

工具运行Java路径:f:\game\starsector\jre


虚拟机参数:java.exe -noverify -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShowCodeDetailsInExceptionMessages -XX:+ExtensiveErrorReports -XX:+ShowMessageBoxOnError -XX:+PrintCommandLineFlags -XX:+TieredCompilation -XX:-UseCondCardMark -Xlog:async -XX:+UseFastStosb -XX:+AlwaysCompileLoopMethods -XX:TieredStopAtLevel=4 -XX:TrimNativeHeapInterval=60000 -XX:UseAVX=3 -XX:AVX3Threshold=0 -XX:UseSSE=4 -XX:+UseSSE42Intrinsics -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UseFMA -XX:+UseBMI1Instructions -XX:+UseBMI2Instructions -XX:+UseCLMUL -XX:+UseFastUnorderedTimeStamps -XX:+UseUnalignedLoadStores -XX:+UseXMMForArrayCopy -XX:+UseXMMForObjInit -XX:+UseXmmI2D -XX:+UseXmmI2F -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=compact -XX:ShenandoahAllocationThreshold=85 -XX:ShenandoahGuaranteedGCInterval=0 -XX:+ZeroTLAB -XX:+SegmentedCodeCache -XX:+AlwaysAtomicAccesses -XX:+UseStringDeduplication -XX:-DontCompileHugeMethods -XX:Tier0Delay=1 -XX:+UseFPUForSpilling -XX:+EnableVectorAggressiveReboxing -XX:+EnableVectorReboxing -XX:+EnableVectorSupport -XX:-AlignVector -XX:TieredOldPercentage=10000 -XX:Tier0ProfilingStartPercentage=2000 -XX:IncreaseFirstTierCompileThresholdAt=99 -XX:InterpreterProfilePercentage=99 -XX:+UseVectorCmov -XX:+UseVectorStubs -XX:ReferencesPerThread=0 -XX:MaxGCPauseMillis=10 -XX:-EnableThreadSMRStatistics -XX:+UseUnalignedAccesses -XX:PerMethodRecompilationCutoff=100000 -XX:ProfileMaturityPercentage=100 -XX:NmethodSweepActivity=1 -XX:ThreadPriorityPolicy=1 -XX:ReservedCodeCacheSize=256m -XX:+PrintCodeCache -XX:-UseDynamicNumberOfCompilerThreads -XX:CompilerDirectivesFile=./compiler_directives.txt -Djava.library.path=native\\windows -XX:-BytecodeVerificationLocal -XX:-BytecodeVerificationRemote -Djava.util.Arrays.useLegacyMergeSort=true --enable-preview --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.Buffer.UNSAFE=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.lang.ref=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.desktop/java.awt.Rectangle=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED -Xmx2048m -Xms2048m -Xss4m -Dcom.fs.starfarer.settings.paths.saves=..\\saves -Dcom.fs.starfarer.settings.paths.screenshots=..\\screenshots -Dcom.fs.starfarer.settings.paths.mods=..\\mods -Dcom.fs.starfarer.settings.paths.logs=. -classpath janino.jar;commons-compiler.jar;commons-compiler-jdk.jar;starfarer.api.jar;starfarer_obf.jar;jogg-0.0.7.jar;jorbis-0.0.15.jar;json.jar;lwjgl.jar;jinput.jar;log4j-1.2.9.jar;lwjgl_util.jar;fs.sound_obf.jar;fs.common_obf.jar;xstream-1.4.10.jar;txw2-3.0.2.jar;jaxb-api-2.4.0-b180830.0359.jar;webp-imageio-0.1.6.jar com.fs.starfarer.StarfarerLauncher

堆栈初始大小(`-Xms`):`2048m`

堆栈最大大小(`-Xmx`):`2048m`


### Mod信息

|Mod名称                                 |Mod版本      |已启用|
|-|-|-|
|LazyLib                               |3.0.0      |是|
|zz GraphicsLib                        |1.12.1   |是|
|MagicLib                              |1.5.6      |是|
|178's Misc Flags                      |1.1      |是|
|A New Level of Confidence             |40 3.3 Fast|是|
|BoxUtil                               |1.5.5      |是|
|LunaLib                               |2.0.5      |是|
|Particle Engine                     |0.9.2      |是|
|Portrait Changer 头像修改器                |1.0.7      |是|
|Ship Mastery System 舰船精通系统            |2.0.8      |是|
|SimpleIndustryOptionProvider 简单的工业设施选项|1.0.4      |是|
|SpeedUp                               |1.2.2      |是|
|UNGP Ship Mastery Inherit             |3.1.0      |是|
|兽耳助手!                                 |0.761      |是|
|势力争霸                       |0.12.1e    |是|
|千年战争头像包                               |1.0      |是|
|彻底扫描星系                              |1.2.3.1    |是|
|控制台                                 |4.0.8      |是|
|最终航行                                  |0.0.2-ver1 |是|
|武器装配筛选器                |3.1.3      |是|
|殖民地内部贸易补偿                           |1.0.0      |是|
|狐狐船包!                                 |1.4.701    |是|
|蓝海渔业                   |1.3.1      |是|
|重生                              |2.5.0      |是|
|中文输入修复                              |2.0.0      |否|
|喵喵骑士团                                 |0.3.91   |否|

(以上内容由 远行星号 报错信息收集工具 自动生成,生成工具版本 `1.1.4`).


平衡天尊 发表于 2026-9-8 09:35:08


[游戏日志] 5446478 INFO com.fs.starfarer.campaign.save.CampaignGameManager - 保存阶段2 5446478 INFO com.fs.starfarer.campaign.save.CampaignGameManager - 保存阶段3 5447853 INFO com.fs.starfarer.campaign.save.CampaignGameManager - 保存游戏时出错 5447853 ERROR com.fs.starfarer.campaign.save.CampaignGameManager - Failed calling method ---- Debugging information ---- message : Failed calling method cause-exception : java.lang.NullPointerException cause-message : null method : com.fs.starfarer.campaign.fleet.FleetMember.writeReplace() ------------------------------- com.thoughtworks.xstream.converters.ConversionException: Failed calling method ---- Debugging information ---- message : Failed calling method cause-exception : java.lang.NullPointerException cause-message : null method : com.fs.starfarer.campaign.fleet.FleetMember.writeReplace() ------------------------------- at com.thoughtworks.xstream.core.util.SerializationMembers.callWriteReplace(SerializationMembers.java:110) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:78) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66) at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:274) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:213) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:144) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:274) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:213) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:144) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66) at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:274) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:213) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:144) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:274) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:213) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:144) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66) at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:274) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:213) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:144) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:274) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:213) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:144) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:274) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:213) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:144) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:274) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:213) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:144) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66) at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:274) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:213) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:144) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:274) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:213) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:144) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshallField(AbstractReflectionConverter.java:274) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.writeField(AbstractReflectionConverter.java:250) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$2.<init>(AbstractReflectionConverter.java:213) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doMarshal(AbstractReflectionConverter.java:144) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.marshal(AbstractReflectionConverter.java:90) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82) at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37) at com.thoughtworks.xstream.XStream.marshal(XStream.java:1319) at com.thoughtworks.xstream.XStream.marshal(XStream.java:1308) at com.thoughtworks.xstream.XStream.toXML(XStream.java:1296) at com.fs.starfarer.campaign.save.CampaignGameManager.o00000(Unknown Source) at com.fs.starfarer.campaign.save.CampaignGameManager.o00000(Unknown Source) at com.fs.starfarer.campaign.CampaignState.cmdSave(Unknown Source) at com.fs.starfarer.campaign.save.O0OO.dialogDismissed(Unknown Source) at com.fs.starfarer.ui.oo0O.dismiss(Unknown Source) at com.fs.starfarer.ui.impl.o0OO.dismiss(Unknown Source) at com.fs.starfarer.campaign.save.O0oO.dismiss(Unknown Source) at com.fs.starfarer.campaign.save.O0oO.actionPerformed(Unknown Source) at com.fs.starfarer.ui.n.buttonPressed(Unknown Source) at com.fs.starfarer.ui.int.new(Unknown Source) at com.fs.starfarer.ui.int.processInput(Unknown Source) at com.fs.starfarer.ui.W.o00000(Unknown Source) at com.fs.starfarer.BaseGameState.traverse(Unknown Source) at com.fs.state.AppDriver.begin(Unknown Source) at com.fs.starfarer.combat.CombatMain.main(Unknown Source) at com.fs.starfarer.StarfarerLauncher.o00000(Unknown Source) at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)
16532字符
这是网友保存报错,是什么原因啊

已完成工作 用时1分41秒
结论
这不是存档文件损坏,也不是磁盘/内存问题。是存档数据里有"脏船"——某艘舰船的 ShipVariant(舰船配置)或 HullSpec(舰体规格)在内存里已经是 null,写盘时序列化钩子崩了。
关键三行:

暗色

复制
cause-exception : java.lang.NullPointerException
method          : com.fs.starfarer.campaign.fleet.FleetMember.writeReplace()
调用位置      : XStream.toXML ← CampaignGameManager ← cmdSave
writeReplace() 是 Java 序列化钩子,FleetMember 存盘时要靠它把舰船对象转成"只记 variant id"的轻量代理。这一步要读 variant/hull 数据,读到 null 就抛 NPE,XStream 包成 ConversionException,整个保存中止。
堆栈里 CollectionConverter → 多层 ReflectionConverter 的嵌套,说明出错对象在一个舰队的成员列表里(战役 → 星区 → 舰队 → 成员),所以是某支舰队里的一艘船坏了,不是全局问题。
谁把数据搞脏的
绝大概率是 MOD。典型路径:MOD 用代码 createFleet / addFleetMember 生成舰船时,用了自己拼的 variant,但没注册进 Global.getSettings() 的 variant 库;或者玩家中途升级/降级过某个加船的 MOD,导致内存里引用了已经消失的 variant id。原版无 MOD 情况下这个错很罕见。
搜索时看到官方论坛一个 MOD 发布帖(Star Lords)的页面摘要里出现了逐字相同的堆栈,说明是 MOD 场景下的已知类型问题。不过论坛正文被安全验证拦住了,我没能打开核实上下文,这条只算线索不算定论。
给网友的处置建议
先说个好消息:Starsector 保存是先写临时文件再替换,保存失败时旧存档通常完好,还能正常读档,进度没丢。
按代价从低到高试:
回退到 .bak:存档目录里带 .bak 后缀的是上一次成功存档,改名替换即可回退。代价是丢一段进度。
揪出脏船:读档后回想崩溃前最后接触的是什么——刚打捞/购买的船、刚交战或收编的敌方舰队、刚访问的空间站。把那艘船卖掉或拆解(不是转移到别的舰队,转移只是搬家,脏数据还在),再试存档。这是成本最低的定向修复。
开 debug 模式扫全图:启动参数加 -debug_mode,用控制台跑 runcode,遍历 Global.getSector() 所有舰队的成员,打印出 getVariant() == null 或 getHullSpec() == null 的那艘船和它所在舰队,精准定位。要的话我可以把这段脚本写出来给你转给他。
更新/卸载可疑 MOD:去 MOD 帖确认有没有同类反馈,有新版就更新。注意别指望"禁用 MOD 后读档就能存"——脏数据已经写进内存了,禁用 MOD 反而可能让 variant 彻底找不到,情况更糟。
反馈给 MOD 作者:把这段 log 原样贴到对应 MOD 的论坛帖,作者一看 FleetMember.writeReplace 就知道是自己 spawn 舰队的代码漏了注册。
顺带提醒:这种情况重试存档没用,每次都会在同一个对象上崩,玩家其实被锁在当前进度上了,必须动手干预。
想让我把第 3 步那段定位脚本写出来吗?另外如果知道游戏版本号(0.96 / 0.97 / 0.98)和装了哪些 MOD,判断能更准。
Sources:
yet again, an failed calling method save...
Star Lords - Mount & Blade Campaign in Space v0.3.2
Modding troubleshooting - The Starsector Wiki
存档无法读取怎么办?【远行星号吧】





页: [1]
查看完整版本: 保存报错