Installation Guide

Prerequisite .NET 4.6

GameRules needs now Unity Editor to run with .NET 4.6 as required by MongoDB driver for cloud database. To setup it in Unity Editor, go to menu Edit > Project Settings > Player, and then choose:

  • Scripting Runtime Version = Experimental (.NET 4.6 Equivalent)

Once modified, restart Unity Editor.

Unity Team Setting

If you intend to use Unity Team collaboration feature, then you have to exclude internal sqlite database files.

To do that, edit <Your project folder>/.collabignore file and append following lines:

# Game Rules rule repository database
# ===================================

Cloud Database Setup

If you want to use Game Rules across different developers in your team, you have to setup a shared rule repository. Game Rules can connect to MongoDB, a no-sql database, which is available for free on the cloud as a database-as-a-service from mLab.

Sign-up at

Go to and click on Sign-up to create an account, or login if you already have one.


Database creation

Once logged-in, click on MongoDB Deployments > Create new button.


Choose Sandbox as plan type, then click on continue.


Choose AWS region of your choice, then click on continue.


Setup the database name of your choice, then click on continue.


Then click on Submit Order to confirm the database creation.


After few seconds, it is ready.


Database user and url

Once the database is created, you need to create a database user used by Unity Editor to connect to it. This database user can be reused by all developers of your team.

Click on the link to open the database, and then go the Users tab, and click on Add database user.


Specify user and password, then click on create.


Once done, note the url to connect, where <dbuser> and <dbpassword> have been replaced by previously created user:

  • mongodb://

Application Wizard

GameRules can be downloaded through Unity Asset Store. A folder GameRules under Assets is created which contains all libraries. Once installed, you have to open the GameRules Studio window through menu Window > GameRules Studio. You will see this screen the first time it runs:


  • Application Name: Setup the name of your game. It will then automatically create a root class with this name without spaces in Game Rules.
  • Rule Repository
    • Database type: choose MongoDB if you have multiple developers in your team. Otherwise, choose Sqlite to use internal database.
    • Database URL: when using MongoDB, you need to specify the url to connect to the database. In your previous example, it is
      • mongodb://

Click on Test Connection to check if your setup is correct. You should see following message:


Click on Connect to existing application if there is already an application in setup in the rule repository. Typically, use this option when on-boarding additional developers to your team.

Click on Create application to create a your new application.


Once clicked, it can take few minutes to create the rule repository. You should see:


and in the console:


Once it’s done, you can see a new folder GameRulesWorkspace with following structure:

  • GameRulesWorkspace
    • Editor
      • gamerules.sqlite
      • gamerulescache.sqlite
    • Scripts
      • generated scripts during product build

and content in rule repository.



Scripts folder is created only after first product build.


The file gamerules.sqlite is used as internal database to store rule repository parameters, recents and favorites. It also contains rules when SQLite is used as rule repository.

  • Assets / GameRulesWorkspace / Editor / gamerules.sqlite

The file gamerulescache.sqlite is used as rule repository cache to improve performances to limit interactions with the cloud database. A system pulse is automatically checking in Unity Editor every 30 seconds any update from the rule repository to refresh cache.

  • Assets / GameRulesWorkspace / Editor / gamerulescache.sqlite


To reset the cache, just re-save your Application rule in home tab.

These sqlite files, as they are under Editor folder, will not be part of your final game build and executables. However, as one may contain all rules, it is recommended to backup this file regularly.

Also, as the database file is outside GameRules folder, you can import any new version of GameRules asset without loosing your work.


To see the rule repository setup, click on Game Rules icon on the left top bar > Rule repository.


You can also use this menu to switch rule repository:



If you change these settings, it will not recreate a new application, it will only connect to an existing application rule repository. It is advised once changed to restart Unity.