[Bug] Can't save on 1st frame - NullPointerEx in PhalanxGun

Started by Captain Ford, April 04, 2017, 09:53:34 AM

Previous topic - Next topic

Captain Ford

I like to start off my games by setting up construction for omnis and getting everything set up ahead of time, then save the game during the first frame. On exchange map #423 FOXX Lair 8 I was unable to save. No in-game error message or crash - the save just didn't show up in the menu and I was able to continue playing as normal. (It also turns out that if I advance one frame, I can save normally, this is only a problem right on map load). After trying to save a bunch of times (including using quicksave once) I looked up the log and save game locations. The save folder was empty, and the log contained 18 copies of the following error:

NullReferenceException: Object reference not set to an instance of an object
  at PhalanxGun.WriteData () [0x00000] in <filename unknown>:0
  at SaveGameManager.SaveUnits (NBT.Tags.TagCompound baseTag) [0x00000] in <filename unknown>:0
  at SaveGameManager.SaveMission (System.String fileName, Boolean includeGUID) [0x00000] in <filename unknown>:0
  at SaveLoadMenuManager.SaveGameEntryClicked (Boolean forceSave) [0x00000] in <filename unknown>:0
  at UnityEngine.Events.InvokableCall`1[System.Boolean].Invoke (System.Object[] args) [0x00000] in <filename unknown>:0
  at UnityEngine.Events.CachedInvokableCall`1[System.Boolean].Invoke (System.Object[] args) [0x00000] in <filename unknown>:0
  at UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
  at UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
  at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <filename unknown>:0
  at UnityEngine.UI.Button.Press () [0x00000] in <filename unknown>:0
  at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <filename unknown>:0
  at UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <filename unknown>:0
  at UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) [0x00000] in <filename unknown>:0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMousePress(MouseButtonEventData)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent(Int32)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent()
UnityEngine.EventSystems.StandaloneInputModule:Process()
UnityEngine.EventSystems.EventSystem:Update()

(Filename:  Line: -1)


As well as one instance of the following error between the first 6 and last 12 of the other error:

NullReferenceException: Object reference not set to an instance of an object
  at PhalanxGun.WriteData () [0x00000] in <filename unknown>:0
  at SaveGameManager.SaveUnits (NBT.Tags.TagCompound baseTag) [0x00000] in <filename unknown>:0
  at SaveGameManager.SaveMission (System.String fileName, Boolean includeGUID) [0x00000] in <filename unknown>:0
  at InputManager.HandleInput () [0x00000] in <filename unknown>:0
  at GameSpace.GameUpdate () [0x00000] in <filename unknown>:0
  at GameSpace.Update () [0x00000] in <filename unknown>:0

(Filename:  Line: -1)


Finally, and most importantly, after advancing one frame using the 'n' key I was able to save just fine. I also tested if I can load up a save game from this map and save it immediately, and that also works fine. It's only a problem with frame 0 on the initial map.

It seems obvious that something loads up with a value that the save system doesn't expect to be null, that is then corrected on the first update. I'm not sure what the PhalanxGun is, but since there are no ships on screen initially, I'd guess it was the fixed cannons? I've been able to save on the first frame on many other maps, including ones with fixed guns, so something must be different about this particular map.

I also closed and reopened Particle Fleet, did the same tests and got the same results.

Attached:

  • output_log-0.txt - the log file as it was immediately after the first time I checked it
  • output_log-1.txt - the log file after doing some other tests, which includes a successful save on frame +1
  • output_log-2.txt - the log file from my second session of testing
  • 423.pf1 - I can't attach a save game, obviously, but what I can do is attach my copy of the exchange map, in case it somehow differs from the original

FOXX

Hi Captain Ford,

Thank you for mentioning this.
I have tested your save file in the editor and in the finalized map and i can't save also at the start.
Then i checked my original files and the same problem occurs. [can't save in editor and as finalized map]
So i'm thinking of this issue i had recently ->
Can't save in editor

The big difference between these issues is that in my thread i was working on a map when this happened and the issue with The FOXX Lair 8 map is that this happened AFTER i finalized the map.
At first i thought something with Scripts but this thought can be erased because in FOXX Lair 8 there are no Scripts.
Also the line -> at PhalanxGun.WriteData () [0x00000] in <filename unknown>:0       interests me because of the PhalanxGun.
No Scripts, No custum images or anything so i can't place the PhalanxGun?!?

That is the info i have for you. I don't know what 'triggers' this issue.
Hopefully we can solve this or get to the issue so that we can avoid this in future maps.

The FPAF
For My Maps and Ships!
Including  CUSTOM MODULE MAPS & SHIPS

Karsten75

Virgil is out of town on some pressing family matters. This issue will have to wait until such time as he is able to look at it.

I have also moved the other thread referencing a similar issue here to the Support forum so hopefully the two can be looked at at the same time.

In the meantime, please be patient and use whatever workarounds are available.

FOXX

Quote from: Karsten75 on April 04, 2017, 04:37:58 PM
.....  please be patient and use whatever workarounds are available.
With the can't save in editor issue i redid some things and it's ok now.

Sorry to Captain Ford this has occured. I didn't know this was an issue with FOXX Lair 8.
All my other maps should work with your starting setup.



The FPAF
For My Maps and Ships!
Including  CUSTOM MODULE MAPS & SHIPS

knucracker

I've added to my todo list and will still take a look at those exceptions...