Build Settings

In order to split your game into two parts (main and downloadable), the system needs to create resource packages which you will be updating in the future. 

Go to tab "In-App Build Settings". 


Definitions


Definition - these are settings for a specific platform. 

The "Definition name" field: 

  • The name must not contain spaces.

  • The name should only contain latin letters and underscores.

  • According to the entered name, a folder with the corresponding name will be created on the server. 

image-1602417178499.png

If you use Google storage and you didn’t allow access to Google Drive, system will
open the browser and ask for access. Follow the instructions here: Google Drive.

The added definition will be selected as current in SGPatcher.

To Delete a definition click on ”Delete” button beside a definition.

Keep in mind that files on the server will not be deleted. You must delete them before deleting definitions in Unity Editor(Storage Explorer) or later using thirdparty clients. If you add a definition with the same name, it will be attached to existing files on the server.


Build Settings


image-1602424514707.png

You can see several fields:

  1. Compress Type. Asset Bundles compression level. The most optimal LZ4.
    • LZMA. LZMA-Compressed bundles give the smallest possible download size, but has relatively slow decompression resulting in higher apparent load times.
    • LZ4. LZ4 compression, which results in larger compressed file sizes, but does not require the entire bundle to be decompressed before use. LZ4 is a “chunk-based” algorithm, and therefore when objects are loaded from an LZ4-compressed bundle, only the corresponding chunks for that object are decompressed. This occurs on-the-fly, meaning there are no wait times for the entire bundle to be decompressed before use. 
    • Uncompressed. No compression at all. Uncompressed bundles are large, but are the fastest to access once downloaded.
  2. Build Target. Select the platform for which updates will be created.

 


Shared Resources


Shared resoureces are folders with resources that are shared by different scenes. You can drag folder assets into "Shared Resources" window from your project window.

image-1602424867905.gif


Scenes


This part of the window shows you the scenes from your project that will be included in your update. If no scenes are shown then you can use the Add button to add the current scene to the update, or you can drag scene assets into this window from your project window. You can also untick scenes in this list to exclude them from the update without removing it from the list. If a scene is never needed in the build you can remove it from the list of scenes by minus button.

Scenes that are ticked and added to the Scenes in Build list will be included in the build. The list of scenes will be used to control the order the scenes are loaded. You can adjust the order of the scenes by dragging them up or down.

Select shared resources which will be used in the scene. You can leave "None" if scene is not using shared resources.

image-1602425239068.gif

These scenes should not be included in Unity Build Settings!

image-1602427285321.gif


Packages


Packages allow you to download only those packages that are required. For example, the main package is all resources initially included. If you want some resources only to be included if a user buys something, create a package for that. Then during runtime load this new package using SGPatcherLoader(read Install Package).

All installed packages are written to the APPLICATION_DATA files, which is located in Application.persistentdatapath. All installed packages are updated when the game starts. New versions of packages are created automatically if any game resources associated with a specific package have been changed, for example, you have updated a scene that is included in the package.

To add a scene to the package, specify it using the selector in the Scenes list line:

image-1602447436317.gif

SGPatcher has an analog of Unity Resources we named this system SGResources. By default, all resources located in folders named SGResources are included in the Main package. If you need to select resources that should be included into another package, you need to add the folder to the SGResources list and select the required package:

image-1602464465524.gif