Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: GarageGothic on Wed 22/03/2006 18:32:38

Title: Suggestion: DynamicSprite -> Savegame screenshot
Post by: GarageGothic on Wed 22/03/2006 18:32:38
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?
Title: Re: Suggestion: DynamicSprite -> Savegame screenshot
Post by: Pumaman on Wed 22/03/2006 20:58:57
Is the save game size really a problem? How large were your save games getting?
Title: Re: Suggestion: DynamicSprite -> Savegame screenshot
Post by: GarageGothic on Thu 23/03/2006 13:13:36
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?
Title: Re: Suggestion: DynamicSprite -> Savegame screenshot
Post by: Pumaman on Thu 23/03/2006 23:01:52
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.
Title: Re: Suggestion: DynamicSprite -> Savegame screenshot
Post by: GarageGothic on Fri 24/03/2006 10:58:32
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.
Title: Re: Suggestion: DynamicSprite -> Savegame screenshot
Post by: SSH on Fri 24/03/2006 13:08:01
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