![]() |
ColorShapeLinks AI
An AI competition for the IEEE Conference on Games 2021
|
A guide on how to test an AI thinker in Unity
A Unity project implementing this board game is included in the repository, and can be used as a visually friendly way to test the AI.

In order for Unity to find an AI thinker (i.e., a class implementing AbstractThinker), the class (or set of classes), should be placed under the UnityApp/Assets/Scripts folder. For organization purposes, it may be preferable to place the class (or set of classes) in a sub-folder under the the UnityApp/Assets/Scripts folder. For example, if the AI thinker class is called AwesomeAIThinker, then the AwesomeAIThinker.cs file (and additional files, if any), could be placed in UnityApp/Assets/Scripts/Awesome.
The MainScene scene contains the Unity frontend for ColorShapeLinks. The first time the project is opened in Unity, it is necessary to open the MainScene, which is available in the Assets/Scenes folder in the Project tab.

ColorShapeLinks matches and/or tournaments should be executed within the Unity editor, not as standalone builds. These can be configured by manipulating the SessionConfiguration game object. Select this object in the Hierarchy tab as follows:

After the SessionConfiguration is selected, matches and/or tournaments can be configured by:
SessionController script component.AIPlayer component.The following image shows the components of the SessionConfiguration game object, namely the SessionController script and several AIPlayer components. As can be observed, each AIPlayer serves as a proxy for an AI thinker instance.

Fields of the SessionController script are divided in three sections:
Tournaments occur automatically if there are more than two AI scripts active in the SessionConfiguration game object. Otherwise a single match is played, as discussed in the next section.
An instance of the AIPlayer component represents one AI thinker. Zero or more instances of this component can be added to the SessionConfiguration game object. Instances of this component have the following configurable fields:
AbstractThinker).Setup() method.The number of active AIPlayer component instances attached to the SessionConfiguration game object determines what type of session will run:
During and after the tournament session, all match results as well as current standings / classifications, are presented.
To start a match or tournament with the active AIPlayer instances, press the "Play" button: