Downloads

Free downloads for BGDatabase package.

# Name Type Version Description Download
1 2D example Example 1.0-12/12/2018 2D variant of our 3D game prototype link
2 Inventory example Example 1.0-12/12/2018 Inventory system, built with BGDatabase link
3 Excel file monitor for Editor Editor tool 1.0-22/07/2019 Editor monitor for excel file link
4 Export/import to excel file for Runtime (PC/Mac/Linux only) Runtime extension 1.1-22/02/2020 Export/import data to excel file at runtime link
5 Save/Load actions for Playmaker/Bolt Runtime extension 1.0-05/08/2019 Save/Load actions for Playmaker/Bolt Playmaker | Bolt v1 | Bolt v2
6 Addressables system plugin Runtime extension 1.1-20/09/2019 Support for Unity's Addressables system. It requires BGDatabase version > 1.4 link
7 Addressables Quick start Example 1.1-20/09/2019 Example project to help you to start using Unity's Addressables system with BGDatabase. It requires BGDatabase version > 1.4 link

1. 2D example

2D variant of our 3D game prototype, shipped with the package (level=beginner).

Video tutorial for this 2D example is available here

Setup:
  1. Create an empty project
  2. Import BGDatabase asset
  3. Import downloaded example project
  4. Run example scene (under Game/Scene)

2. Inventory system

Inventory system, built with BGDatabase (level=advanced). Approximate DB schema

Setup:
  1. Create an empty project
  2. Import BGDatabase asset
  3. Import downloaded example project
  4. Run example scene (under Game/Scene)
Features:
  1. Character creating with class and attributes
  2. Inventory
  3. Pick up items from containers
  4. Equip items
  5. Trading with traders
  6. Saving and loading

3. Excel file monitor for Editor

Features:
  1. Monitor and auto import Excel file in Unity Editor
Setup:
  1. Import BGDatabase package and create your own database as described here
  2. Import BansheeGzExcelEditor package
  3. Export required data to Excel file as described here
  4. Open up Window->BansheeGzExcelTools window
  5. Set "File" parameter to excel file path
  6. Turn "On" parameter on.
  7. Open exported excel file, change some data and save the file (Ctrl+s)
  8. Data will be imported to BGDatabase.

4. Export/import to excel file for Runtime (PC/Mac/Linux only)

Features:
  1. Import/export database data from/to Excel file at runtime (in builds)
  2. Monitor excel file and auto-import the data if file changes
Setup:
  1. Import BGDatabase package and create your own database as described here
  2. Move (not copy!) Assets\BansheeGz\BGDatabase\Editor\Libs\NPOI folder to Assets\Libs (or to any other folder, which is not under Editor folder)
  3. Import BansheeGzExcelRuntime package
  4. Add Assets\BansheeGzExcelRuntime\BGExcelImportGo.cs to your scene
  5. Export required data to Excel as described here
  6. Run your scene
  7. Click to "Excel>>" button to access settings
  8. Set "File" parameter to previously exported excel file location
  9. Optionally set "monitoring" to true to auto monitor the file
  10. Optionally set "importOnStart" to run import on scene load
  11. Optionally press "Save Settings" to save the settings
  12. Open excel file, change the data and save the file (Ctrl+s)
  13. BGDatabase data should be updated. All binders in the scene will be executed after that.
  14. To export call BGExcelImportGo.Export method from your script. If you set "Export Meta only if sheet exists", export will ignore all tables which does not have corresponding sheet in target xls file
Example scene:

Example scene is available in Assets\BansheeGzExcelRuntime\Example\ folder. It works with default database, shipped with BGDatabase package. This example shows, how to update Player.gold field with excel at runtime.

Example scene setup:
  1. Create empty project
  2. Import BGDatabase package
  3. Move (not copy!) Assets\BansheeGz\BGDatabase\Editor\Libs\NPOI folder to Assets\Libs (or to any other folder, which is not under Editor folder). Select all dlls under Assets\Libs\NPOI, and in the inspector toggle "Standalone" on and click "Apply"
  4. Import BansheeGzExcelRuntime package
  5. Open Assets\BansheeGzExcelRuntime\Example\BGDatabaseExcelRuntimeExample.unity scene
  6. Run the scene
  7. Click on "Excel>>" button, and set "File" parameter to full testData.xls file path. (file is located here: Assets\BansheeGzExcelRuntime\Example\testData.xls, but the parameter should be set to full path, for example: c:\MyProject\Assets\BansheeGzExcelRuntime\Example\testData.xls
  8. Click on "Save Settings" button
  9. Now open testData.xls file in Excel/OpenOffice/LibreOffice, change Player.gold value, and Save the file (Ctrl+s)
  10. Value in the database and text on the screen will be changed

Some people experience "Encoding 1252 data could not be found" error while running export/import at runtime. The solution: copy all "internationalization" dlls (I18N, I18N.West.dll etc. ) to your project as described here

5. Save/Load actions for Playmaker/Bolt

Custom actions for Playmaker and Bolt to support SaveLoad addon. Actions allow you to save/load game to/from file(s), located in the Unity's persistent folder.

Available actions/units:
  1. SaveGame: save a game to a file.
  2. LoadGame: load a game from a file.
  3. ListSaves: load all file names to string array (without path and extension)
  4. DeleteSave: delete saved file.
Additional information:
  1. All files have ".sav" extension.
  2. SaveGame/LoadGame/DeleteSave have optional fileName parameter (default is "game"). fileName parameter format is a file name without path and extension.
  3. All actions have "debug" parameter- if it's turned on, information about files is printed to Unity console.

6. Support for Unity's addressables system

Setup:
  1. Use Unity version > 2018.2
  2. Install Unity's addressables package via package manager
  3. Install latest BGDatabase
  4. Download and install latest BGDatabase.Addressables package
  5. If you installed our beta package with experimental addressables support, which was bundled with our asset, please, delete the following folders: Assets\BansheeGz\BGDatabase\Pins and Assets\BansheeGz\BGDatabase\Editor\Pins
  6. Create your own database as described here
  7. Create a table with Unity assets fields and set loader=Addressables or loader=AddressablesByGuid via gear icon
Loaders type:
  1. Addressable: asset address is stored as database value in human readable form. Cons: you can not change address after value was assigned to database again
  2. AddressableByGuid: asset Guid is stored as database value. Cons: Guid is just a set of bytes, it's not readable
How to read values:
  1. Usual method, by reading field value. Assets preloading is required for this method, please see below for more details
  2. Instead of reading field value the usual way, you can retrieve asset address from database and use this address directly with Addressables system. No preloading is required in this case. Each unity asset field is implementing BGStorable<string> interface, which can be used to read asset address (method BGStorable.GetStoredValue(entity.Index)). Preload script below has an example of retrieving this address.

We recommend method #2, cause it does not involve running additional code(preloading) and it's as robust as Addressables system is.

This example project has examples for both techniques

Preloading:

If you access unity field with addressables loader like you normally do (How to read values, method # 1, mentioned above), you need to preload required values, otherwise values will not be resolved successfully (null will be returned). You have full control over which values you want to preload: you can use database values or Addressables system to decide which values to preload.
Preloader script is included into the package(Assets\BGDatabaseAddressables\ScriptsNoDll\BGAddressablesPreloader.cs). It preloads all values from all rows/fields, but you can modify it to preload only required part of the database. Completed() method is invoked after all assets are preloaded.

Tesing if Addressables system setup properly:

Some people experience issues while setting Addressables up. In this case, use this script to test if Addressables works correctly.

  1. Create empty scene
  2. Attach the script to any GameObject
  3. Assign it's Address parameter to some valid address from your Addressables system
  4. Run the scene and make sure asset was loaded successfully (no exceptions in the console)

7. Addressables Quick start Example project

Example project to help you to start using Addressables with BGDatabase quickly. AddressablesQuickStart is main folder for this project

Setup:
  1. Download the project, unzip it and open it with Unity > 2019.2.4. Ignore console errors.
  2. Import BGDatabase package
  3. Run preloader.unity scene to test preloading assets technique. More info about this technique.
  4. Run scene.unity scene to test reading assets by addresses technique (without preloading). More info about this technique.
Scripts description:
  1. PreloaderUsingAddressables.cs (preloader.unity scene) : preload assets using Addressables system label
  2. PreloaderUsingDatabaseValues.cs (preloader.unity scene) : preload assets using addresses, stored in the database
  3. Spawner.cs (scene.unity scene) : spawn both preloaded assets and assets, retrieved with raw address.