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

49.19 Could not properly save game. #4034

Closed
Daishi-5 opened this issue Apr 27, 2024 · 11 comments · Fixed by MegaMek/megamek#5426
Closed

49.19 Could not properly save game. #4034

Daishi-5 opened this issue Apr 27, 2024 · 11 comments · Fixed by MegaMek/megamek#5426
Labels

Comments

@Daishi-5
Copy link

Daishi-5 commented Apr 27, 2024

What version of MekHQ does your issue apply to?
49.19
What operating system are you using? Windows, Mac, or Linux?
Windows

What java version are you using? If unsure it will state your java version at the top of the mekhq.log file.
Java Vendor: Eclipse Adoptium
Java Version: 11.0.16.1

Cannot save game during a contract right after I landed on plant. I believe it may be after stratcon events are created. Autosaves worked up to the point I arrived on planet, and I have an autosave from the sunday before events were generated. When I go to save, it says "the program was unable to correctly save your game."

Tried to save the game, received the error. Reloaded from an autosave, tried to save again, this time the save worked. Advanced time until Monday when several stratcon fight events were generated. Tried to save again, same error. Repeated twice to verify exact same behavior every time.

Autosave-1-My Campaign-30710723.cpnx.gz
mekhq.log
customs.zip

@Thom293
Copy link
Contributor

Thom293 commented Apr 27, 2024

I thought this got fixed.

Is this from one of the 49.19 Nightlies, or the final release version?

@IllianiCBT
Copy link
Collaborator

23:08:34,673 INFO  [mekhq.gui.CampaignGUI] {AWT-EventQueue-0}
mekhq.gui.CampaignGUI.saveCampaign(CampaignGUI.java:1309) - Saving campaign...

23:08:36,098 ERROR [mekhq.gui.CampaignGUI] {AWT-EventQueue-0}
mekhq.gui.CampaignGUI.saveCampaign(CampaignGUI.java:1353) - 
java.lang.NullPointerException
	at java.base/java.io.PrintWriter.write(Unknown Source)
	at megamek.common.EntityListFile.writeEntityList(EntityListFile.java:1002)
	at mekhq.campaign.mission.BotForce.writeToXML(BotForce.java:372)
	at mekhq.campaign.mission.Scenario.writeToXMLBegin(Scenario.java:854)
	at mekhq.campaign.mission.Scenario.writeToXML(Scenario.java:819)
	at mekhq.campaign.mission.Mission.writeToXMLBegin(Mission.java:220)
	at mekhq.campaign.mission.Contract.writeToXMLBegin(Contract.java:661)
	at mekhq.campaign.mission.AtBContract.writeToXMLBegin(AtBContract.java:770)
	at mekhq.campaign.mission.Mission.writeToXML(Mission.java:202)
	at mekhq.campaign.Campaign.writeToXML(Campaign.java:4158)
	at mekhq.gui.CampaignGUI.saveCampaign(CampaignGUI.java:1344)
	at mekhq.gui.CampaignGUI.saveCampaign(CampaignGUI.java:1317)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton.doClick(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
	at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
	at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

@Daishi-5
Copy link
Author

Daishi-5 commented Apr 27, 2024 via email

@IllianiCBT
Copy link
Collaborator

I'm able to replicate on 49.19-Dev, so it looks like something snuck through.

@IllianiCBT IllianiCBT added the Bug label Apr 27, 2024
@kuronekochomusuke
Copy link
Collaborator

java 17 error message
looks like the return value of C3iEntity.getC3UUIDAsString() is null

12:16:55,806 ERROR [mekhq.gui.CampaignGUI] {AWT-EventQueue-0}
mekhq.gui.CampaignGUI.saveCampaign(CampaignGUI.java:1366) -
java.lang.NullPointerException: Cannot invoke "String.length()" because "s" is null
at java.base/java.io.PrintWriter.write(PrintWriter.java:558)
at megamek.common.EntityListFile.writeEntityList(EntityListFile.java:1003)
at mekhq.campaign.mission.BotForce.writeToXML(BotForce.java:372)
at mekhq.campaign.mission.Scenario.writeToXMLBegin(Scenario.java:854)
at mekhq.campaign.mission.Scenario.writeToXML(Scenario.java:819)
at mekhq.campaign.mission.Mission.writeToXMLBegin(Mission.java:220)
at mekhq.campaign.mission.Contract.writeToXMLBegin(Contract.java:661)
at mekhq.campaign.mission.AtBContract.writeToXMLBegin(AtBContract.java:770)
at mekhq.campaign.mission.Mission.writeToXML(Mission.java:202)
at mekhq.campaign.Campaign.writeToXML(Campaign.java:4205)
at mekhq.gui.CampaignGUI.saveCampaign(CampaignGUI.java:1357)
at mekhq.gui.CampaignGUI.saveCampaign(CampaignGUI.java:1330)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374)
at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1028)
at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1072)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
at java.desktop/java.awt.Component.processEvent(Component.java:6391)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

@gsparks3
Copy link
Collaborator

Hmm, did C3i get missed when the other C3 issues were fixed?

@kuronekochomusuke
Copy link
Collaborator

the previous c3 checks were based on null game, this one is different.

@kuronekochomusuke
Copy link
Collaborator

kuronekochomusuke commented Apr 27, 2024

A work around for this may be to regenerate bot forces to get one without any c3master, c3i, or nc3 units. which may be hard to do with the contract against word of blake. Or just remove the scenarios until you get ones that save.

@Daishi-5
Copy link
Author

Daishi-5 commented Apr 27, 2024 via email

@Thom293
Copy link
Contributor

Thom293 commented Apr 27, 2024

Did some more testing, and I can save if I complete or delete the missions. So, the bug can be worked around a bit.

On Sat, Apr 27, 2024, 11:49 AM kuronekochomusuke @.> wrote: A work around for this may be to regenerate bot forces to get one without and c3master, c3i, or nc3 units. which may be hard to do with the contract against word of blake. Or just remove the scenarios until you get ones that save. — Reply to this email directly, view it on GitHub <#4034 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BICXTWG5PQYTORXLLQY5X2DY7PJJJAVCNFSM6AAAAABG3YOR4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRGA3TMMRSHA . You are receiving this because you authored the thread.Message ID: @.>

Maybe you already know, but if you right click on the scenario and hit edit, it will allow you to "regenerate bot forces" near the bottom. If you do that, it might re-roll the opfor so it doesnt have C3i and you can still play the scenario without having to delete it. If you regenerate it enough, should eventualy get one without C3i.

@Daishi-5
Copy link
Author

Daishi-5 commented Apr 27, 2024 via email

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

Successfully merging a pull request may close this issue.

5 participants