ZDoom save file structure

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
taneth111

ZDoom save file structure

Post by taneth111 »

Hello ZDoom forum-ers/Developers. For a while I've been writing a launcher for ZDoom and I was about to add the ability to load save files into this launcher. However, part of this involves getting the save name from the save file, which I haven't been able to find yet. so would anyone know where and how the save name is stored?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZDoom save file structure

Post by Graf Zahl »

The savegame uses PNG as a container format.

Have a look at G_DoLoadGame in g_game.cpp. The 2 function calls there that may interest you are M_VerifyPNG (initializes the container so you can get access to the data) and M_GetPNGText. There's several text chunks containing information about the savegame's content.

You can even get the save picture if you load the entire savegame with a PNG graphics loader.
User avatar
edward850
Posts: 5890
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: ZDoom save file structure

Post by edward850 »

Which is a rather interesting way of doing it. You can see the save image in both the zdoom forums if uploaded, and Linux Ubuntu using Gnome can also view the image in its file browser.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: ZDoom save file structure

Post by randi »

...which was exactly the point behind using PNG as the primary format for savegames.
Post Reply

Return to “General”