FinalPatch - Getting Started

For Unity Hot Update

Final Patch - Getting Started

1. Host CDN

CDN storage resource is used for hot updates, skipping this step if a CDN is already available. You can start a local HttpService for testing.(We assume that the CDN is under the same directory with Assets)


mkdir CDN
cd CDN
python -m SimpleHTTPServer


You can use Assets/BBGo/FinalPatch/Demo/Server/hfs.exe to start a file server on windows.

After the installation is complete, use the browser to open http://localhost:8000. If you can access it, it means it has been successful.

2. Build

Open the FinalPatch Manager in Unity: Tools/BBGo/Final Patch Manager, Switch to Build tab, there are 2 versions by default: demo_osx and demo_win, select the correct platform and click the Build button (mouse hover the button to display the name). FinalPatch will copy the assets to the CDN/AssetBundles directory automatically once build fnished (the copy function is in DefaultBuildCallback.cs, you can implement your own function, and then set it in the Advanced tab).

3. Deploy

Click New Deploy Data in Deploy tab and select the CDN directory to create a new deploy data. These files should now be in the CDN directory: cnd_files

Then click Add Channel, fill in the name demo, the url http://localhost:8000/AssetBundles, and select build which you preapred in last step(demo_osx or demo_win), set version to 1 finally. Click Save.

4. Setting up client

Open Assets/BBGo/FinalPatch/Demo/DemoScene. Click Tools/BBGo/Add Final Patch Client to check if the Deployment Data URL and Deployment Channel are correct in the Inspector. If you follow the steps set before, then fill the Deploy Data URL with http://localhost:8000/DeployData and Channel Name with demo.

5. Testing

Enter play mode, check the console output, if there is an error, please check if the previous steps are correct. If the console displays the following log, it indicates that the patch has been successfully completed: patch_success

If there is no error, you can click the button on the screen to test. Note: If there is no response of patching, try to restart HTTP server.

6. Release new patch

The currently assets are located in the Assets/BBGo/FinalPatch/Demo/Bundles directory (which can be set in the Advanced tab). All assets located in this directory will be built. Now make some modifications to assets then switch to the Build tab and click build button again to make a new version. If the build is successful, the version number should be 2. After building, open the CDN directory and check if there is a folder with version number 2. Open the Deploy tab, expand the demo channel, click Edit, set the Version to 2, and click Save. At this point, the building and deployment of the new version was completed. Restarting the client to see if the upgrade has been completed.

7. After Testing

After the test is finished, it is best to delete the Demo directory (mainly delete FinalPatchData and FinalPatchEditorData), and then restart the FinalPatchManager window, so that FinalPatch will regenerate the file in the outermost Resource directory to store the data.