[HOWTO] How To: Tips to Reduce Dialogue Database Size/Memory
Posted: Wed Dec 14, 2022 8:08 am
Generally speaking, since dialogue databases are text, size is rarely a concern. (A single texture in your project is quite often larger than a database for even a moderately large game.) However, if you want to trim down the dialogue database's disk footprint and memory use anyway, here are some tips:
If you've ticked the Dialogue Manager's Other Settings > Include SimStatus but you don't need to track SimStatus, untick it. SimStatus takes memory for each dialogue entry. Note: If you've set Display Settings > Input Settings > Em Tag For Old Responses, this automatically uses SimStatus since it needs to track each dialogue entry.
You can also remove unneeded fields from your dialogue database, which can substantially reduce its size. Open the dialogue database in the Dialogue Editor. On the Templates tab, select Menu > Update Template From Assets. Then examine each foldout and remove the fields you don't use, selecting "Remove All" instead of "Template Only" when prompted. Selecting Menu > Remove Empty Fields might also help. Make a backup before doing this, in case you accidentally delete fields that you actually needed.
If your database contains translations for language localization (e.g., English, German, Spanish, etc.), you can make a copy of the database for each language and remove all other languages from each database. To switch languages at runtime, use DialogueManager.RemoveDatabase() to remove the current database from memory and DialogueManager.AddDatabase() to add the database for the new language into memory. However, this may be an extreme step that you don't need to take. I recommend trying the steps above first, and then if it's still using too much memory investigate what's using the memory. The database may very well not be a concern in the first place.
If you've ticked the Dialogue Manager's Other Settings > Include SimStatus but you don't need to track SimStatus, untick it. SimStatus takes memory for each dialogue entry. Note: If you've set Display Settings > Input Settings > Em Tag For Old Responses, this automatically uses SimStatus since it needs to track each dialogue entry.
You can also remove unneeded fields from your dialogue database, which can substantially reduce its size. Open the dialogue database in the Dialogue Editor. On the Templates tab, select Menu > Update Template From Assets. Then examine each foldout and remove the fields you don't use, selecting "Remove All" instead of "Template Only" when prompted. Selecting Menu > Remove Empty Fields might also help. Make a backup before doing this, in case you accidentally delete fields that you actually needed.
If your database contains translations for language localization (e.g., English, German, Spanish, etc.), you can make a copy of the database for each language and remove all other languages from each database. To switch languages at runtime, use DialogueManager.RemoveDatabase() to remove the current database from memory and DialogueManager.AddDatabase() to add the database for the new language into memory. However, this may be an extreme step that you don't need to take. I recommend trying the steps above first, and then if it's still using too much memory investigate what's using the memory. The database may very well not be a concern in the first place.