Loading Dialogue Database from AssetBundles
Loading Dialogue Database from AssetBundles
Is it possible to update the Dialogue Database over the air without rebuilding the game? Like if a game is shipped with database v1.00, and I make minor changes to it and want to update it OTA with v1.01 (via an assetBundle DLC or a direct download). Basically the game should function fine with v1.00 but if a newer version is available it should automatically load the new one. Is it doable and if so what would be the best approach to take?
Re: Loading Dialogue Database from AssetBundles
Hi,
Yes, just get the dialogue database from your asset bundle and call DialogueManager.AddDatabase() to add it to the Dialogue System's memory. If you've already added an older version, you'll want to remove it first with DialogueManager.RemoveDatabase().
I suggest setting the Dialogue Manager's Initial Database to none. If Initial Database is assigned, the Dialogue System will add the database on start. Instead, when the game starts, find the dialogue database that you want to use, either in the main build or in an asset bundle, and pass it to DialogueManager.AddDatabase(). This way you don't have to worry about removing old databases.
As an alternative to asset bundles, you can send updated databases in Chat Mapper XML format. (The Dialogue System's Dialogue Editor can export this format.) Then your client can convert the XML to a dialogue database using ChatMapperToDialogueDatabase, and you can use DialogueManager.AddDatabase() to load it into the Dialogue System.
Since we're on the topic of asset bundles, sequencer commands can automatically find assets such as sounds and textures in asset bundles. Just call DialogueManager.RegisterAssetBundle() to let the Dialogue System know about the asset bundle. You can also use DialogueSystem.LoadAsset() for your own needs. It works like Resources.LoadAsset() but also finds assets in registered asset bundles.
Yes, just get the dialogue database from your asset bundle and call DialogueManager.AddDatabase() to add it to the Dialogue System's memory. If you've already added an older version, you'll want to remove it first with DialogueManager.RemoveDatabase().
I suggest setting the Dialogue Manager's Initial Database to none. If Initial Database is assigned, the Dialogue System will add the database on start. Instead, when the game starts, find the dialogue database that you want to use, either in the main build or in an asset bundle, and pass it to DialogueManager.AddDatabase(). This way you don't have to worry about removing old databases.
As an alternative to asset bundles, you can send updated databases in Chat Mapper XML format. (The Dialogue System's Dialogue Editor can export this format.) Then your client can convert the XML to a dialogue database using ChatMapperToDialogueDatabase, and you can use DialogueManager.AddDatabase() to load it into the Dialogue System.
Since we're on the topic of asset bundles, sequencer commands can automatically find assets such as sounds and textures in asset bundles. Just call DialogueManager.RegisterAssetBundle() to let the Dialogue System know about the asset bundle. You can also use DialogueSystem.LoadAsset() for your own needs. It works like Resources.LoadAsset() but also finds assets in registered asset bundles.