Time it takes to save?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Time it takes to save?

Post by SealDev »

1. How long does it take to save?

2. Should I make a longer fade on quit, to give it time to finish saving or will it save no matter what?

3. Or does the system save successfully no matter what since I'm already using "Auto Save Load" with "Save on Quit" turned on? No matter how big the database size?

4. Is it necessary to mark anything other than "Save on Quit"? Because if it always works successfully on quit and there is no danger of save loss, it might not be worth getting the framerate hiccups on "Pause" and "Lose Focus"

5. What about OnDataApplied? In the menu I wear a hat based on a lua variable. But as database size grows, will it take longer and longer for a variable to be retrieved?
Attachments
Auto Save Load.png
Auto Save Load.png (11.15 KiB) Viewed 633 times
User avatar
Tony Li
Posts: 21962
Joined: Thu Jul 18, 2013 1:27 pm

Re: Time it takes to save?

Post by Tony Li »

SealDev wrote: Sun Aug 07, 2022 2:36 am1. How long does it take to save?
It depends on what there is to save. In games with huge amounts of dialogue and quests, for example, like Disco Elysium, you might want to tick the DialogueSystemSaver's Raw checkbox. This performs a faster save of DS variables and quests, especially if you're using SimStatus, but makes much bigger save files. In general, unless your game is really huge, you should use the default settings, The other part of saving is writing to storage. SavedGameDataStorer has an option to save asynchronously, but it requires some scripting. Again, in general, it's best to use the defaults, especially if you're using AutoSaveLoad because when quitting you don't have multiple frames to store the data.
SealDev wrote: Sun Aug 07, 2022 2:36 am2. Should I make a longer fade on quit, to give it time to finish saving or will it save no matter what?
It won't make a difference.
SealDev wrote: Sun Aug 07, 2022 2:36 am3. Or does the system save successfully no matter what since I'm already using "Auto Save Load" with "Save on Quit" turned on? No matter how big the database size?
If you're using AutoSaveLoad, it will run on the main thread, so it will wait until it's done saving.
SealDev wrote: Sun Aug 07, 2022 2:36 am4. Is it necessary to mark anything other than "Save on Quit"? Because if it always works successfully on quit and there is no danger of save loss, it might not be worth getting the framerate hiccups on "Pause" and "Lose Focus"
It depends on your platform. On mobile, for example, when you minimize an app it will send a Pause or Lose Focus message. The player may not resume the app before rebooting their device, so in this case you must save on pause or lose focus. On PC and consoles however, it's acceptable to not save if the player alt-tabs out of the game.
SealDev wrote: Sun Aug 07, 2022 2:36 am5. What about OnDataApplied? In the menu I wear a hat based on a lua variable. But as database size grows, will it take longer and longer for a variable to be retrieved?
Not in a noticeable degree. Variables are stored in a Dictionary, which uses a hash table. So it's basically O(1) (same order of magnitude lookup time regardless of dictionary size), not O(n) (where time would grow linearly with the number of variables, which would be bad).
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Re: Time it takes to save?

Post by SealDev »

What about right clicking "Close window" on pc? Does the application not shut down until it's done saving thanks to auto save load? That would be really cool!
User avatar
Tony Li
Posts: 21962
Joined: Thu Jul 18, 2013 1:27 pm

Re: Time it takes to save?

Post by Tony Li »

Hi,

Yes, that's correct, it will hold until the save is done. If you kill the process in the Task Manager, however, it won't save.
CarynBaron
Posts: 1
Joined: Mon Sep 19, 2022 12:31 pm

Re: Time it takes to save?

Post by CarynBaron »

Thanks for sharing :)
Spoiler
Thanks for sharing :).I am a writer and I write very good content and blogs. But I wanted to earn good money through my profession and for this, I want to do a job in any good company but before doing the job the most important thing is to have the best cv. But I wanted to get myself written by a professional CV Veritas. Then someone suggested me the site, see this url. On this site, your CV is upgraded according to your demand.
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Re: Time it takes to save?

Post by SealDev »

1. Just out of curiosity what would happen if a game had 5000 variables? While lookup time might not get slower, would something else be affected?

2. What about 5000 dialogues with an average of 10 nodes each? Or 10000? (with a custom Sequence)

Was just wondering what would happen as I scale, if I chose to stay committed to a single project for years, or even a decade, and the same database grew gigantic?
User avatar
Tony Li
Posts: 21962
Joined: Thu Jul 18, 2013 1:27 pm

Re: Time it takes to save?

Post by Tony Li »

More data of any type of course means more time to process, and that includes Dialogue System data. But games like Disco Elysium and Tortured Hearts have lots of dialogue and use a single dialogue database. If you end up needing to make a game, say, 10x bigger than Disco Elysium, you could use multiple databases and load them in and out. The Dialogue System was designed for that. For example, if the player travels to different planets in a sci-fi game, each planet could have its own database that's only loaded when the player is on that planet.
Post Reply