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 MongoDB Atlas Cloud.

Sign-up at

Go to and click on Try Free to create an account, or login if you already have one.


Database creation

Once logged-in, you will have to create a new cluster. Choose the provider and region where free tier is available, then click on Create Cluster.


Once your first cluster is created, a Connect to Atlas wizard is available at the bottom right. Click on Create your first database user and then on SECURITY > Database Access.



Click on +ADD NEW USER. Choose a user and password. These credentials will be used by GameRules to connect to the database. Select atlas admin* role. Click on Add User to create it.


Click on Whitelist your IP address, and then on SECURITY > Network Access.



Click on +ADD IP ADDRESS. Either choose your internet IP address or allow access from anywhere. Then click on Confirm.


Last step is to connect to your cluster.



Choose Connect your application, and then select C# driver and version 2.5 or later. The connection string will be used to connect GameRules to the MongoDB rule repository.



(Optional) Create another Database

By default, MongoDB creates a Test database inside the cluster. If you want to have multiple databases for different projects or environments, you can create additional databases inside the cluster.

To do so, go to your main cluster page Atlas > Clusters, and click on Collections, and then Add my own data.


Specify your database name and put anything you want for collection name, then click on create.


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+srv://<dbuser>:<password>

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 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.