Suggestion: DynamicSprite -> Savegame screenshot

Started by GarageGothic, Wed 22/03/2006 18:32:38

Previous topic - Next topic

GarageGothic

I'm using a lot of DynamicSprites for effects in my game. For that reason I've had to write commands to delete all these before saving, so they won't be bloating the savegames. However, since the 'savegame with screenshot' function grabs the screenshot at the moment of saving, any DynamicSprite that I've deleted before saving won't show up on it. In some cases this even means the player character missing from the screenshot.

So what I propose is a slight expansion of the save function:
SaveGameSlot (int slot, string description, optional int screenshotslot)

For the screenshotslot, you could then specify a DynamicSprite.Graphic, that you grabbed before deleting the other dynamic sprites. However, and this is the small hitch in the idea, the DynamicSprite for the screenshot would also have to be deleted at the moment of saving, but after being stored as a graphic within the savegame. So the SaveGameSlot function would have to handle the deletion of this single DynamicSprite itself. Would that even be possible?

Pumaman

Is the save game size really a problem? How large were your save games getting?

GarageGothic

So you're suggesting that I don't delete dynamic sprites when saving? That would surely make coding a lot easier, but I considered it a bit sloppy. You're right that it would be the easiest solution though, and I wouldn't feel as bad about using it if it's suggested by Pumaman himself :).

My current savegames are 3 MB when using dynamic shadows for one character, without any other effects going on, so I was afraid what would happen in more intensive situations. But perhaps it's because the RawSaveScreen() buffer is also stored within the savegame?

Pumaman

Well, if you delete them before saving then you need to recreate them after loading, presumably, or get involved in various nasty bits of scripting.

The idea of the save/restore features is that you don't need to worry about them -- restoring is all automatic and will place the game in the same state as it was before you saved.

If you have hundreds of large dynamic sprites that are causing your save games to be 100 MB each, I'd agree that it was worth trying to improve the situation, but if the files are only around 3 MB, personally I wouldn't worry about it.

GarageGothic

Thanks for the reply, CJ! And you're totally right, my current attempts at freeing/assigning DynamicSprites on save/load IS quite the mess, so I'd be happy to get rid of those functions - with 50 savegames it's not going beyond 200MB anyway, and most people have that much free space on their HDs.

SSH

I also think you needent bother but you COULD do this:

Grab screenshot as Dynamic sprite
Turn off all GUIs
Draw dynamic sprite onto background with RawDraw
Delete all dynamic sprites
Save
12

SMF spam blocked by CleanTalk