[4.8.0] Save Failed

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
22alpha22
Posts: 306
Joined: Fri Feb 21, 2014 5:04 pm
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

[4.8.0] Save Failed

Post by 22alpha22 »

I've just come across an issue that I've never encountered before while testing out a map I'm working on for my project. Whenever I try to save, it fails and a message is logged to the console with the following:
Save failed
Attempt to save pointer to unhandled type NativeStruct<F3DFloor>
I assume by the message that a 3D Floor(s) is causing the issue but I can't seem to figure out where or why. The map plays correctly, at least I haven't found any issues so I'm stumped. It may be that my mod is interacting with 3D floors in a bad way but I don't see how.
I'm attaching a link to my entire project because I don't know what is causing this bug and not being able to save is definitely an unplayable state.

Link Removed

Simpy warp to LEVEL01 and try to save and it will fail and log the above message.
Last edited by 22alpha22 on Sun Nov 13, 2022 7:08 pm, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [4.8.0] Save Failed

Post by Graf Zahl »

You cannot use persistent pointers to F3DFloor. And you shouldn't. The entire data structure holding them can change and let your pointer point to invalid data if you hold on to it.
User avatar
22alpha22
Posts: 306
Joined: Fri Feb 21, 2014 5:04 pm
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

Re: [4.8.0] Save Failed

Post by 22alpha22 »

I found all the classes that used persistent pointers to 3DFloors and reworked them to only use the pointer temporarily, now I am able to save the game, so that was definitely the issue.

I certainly never would have guessed that using a persistent F3DFloor pointer would cause such problems, I thought it was generally good practice to cache frequently accessed variables whenever possible to improve performance. Well it seems there are exceptions.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [4.8.0] Save Failed

Post by Graf Zahl »

Of course there are exceptions. The thing with 3D floors is that they get re-sorted if one moves. This means creation of an entirely new array.
TBH, this is something I never wanted to see exported but people deemed it essential for implementing some stuff.

Return to “Closed Bugs [GZDoom]”