ColorShapeLinks AI
An AI competition for the IEEE Conference on Games 2021
|
Quick start guide
/
with backslashes \
when referencing local paths.
The development framework must be downloaded with the following command (requires Git ≥ 2.13 and Git LFS, other approaches will not work):
The complete AI implementation guide is available here.
At least one class is required for implementing an AI thinker. This class must extend AbstractThinker and implement the Think() method. This method accepts the game board and a cancellation token, returning a FutureMove. Simply put, the method accepts the game board, the AI decides the best move to perform, and returns that move, which will eventually be executed by the match engine.
The Think() method is called in a separate thread. As such, it should not try to access shared data. The main thread may ask the AI to stop thinking, for example if the thinking time limit has expired. Thus, while thinking, the AI should frequently test if a cancellation request was made to the cancellation token. If so, it should return immediately with no move performed, as exemplified in the following code:
The thinker can freely modify the game board, since this is a copy and not the original game board being used in the main thread. More specifically, the thinker can try moves with the DoMove() method, and cancel them with the UndoMove() method. The board keeps track of the move history, so the thinker can perform any sequence of moves, and roll them back afterwards.
The CheckWinner() method is useful to determine if there is a winner. If there is one, the solution is placed in the method's optional parameter.
For building heuristics, the public read-only variable winCorridors will probably be useful. This variable is a collection containing all corridors (sequences of positions) where promising or winning piece sequences may exist.
The complete console testing guide is available here.
ConsoleApp/ColorShapeLinks/TextBased/App
.cd
into the ConsoleApp/ColorShapeLinks/TextBased/App
folder.dotnet run -- info
to check if the AI thinker is found by the ColorShapeLinks console app.dotnet run -- help
lists the high-level command line options available.MyAI.MyThinker
, the AI thinker, playing as the first player (White), can be tested against a random AI (playing as Red), with a play limit of one second, with dotnet run -- match -W MyAI.MyThinker -R ColorShapeLinks.Common.AI.Examples.RandomAIThinker -t 1000
.dotnet run -- help match
presents all the sub-options for the match
option.competition.txt
with the following contents: dotnet run -- session -g competition.txt
.dotnet run -- help session
presents all the sub-options for the session
option.The complete Unity testing guide is available here.
UnityApp/Assets/Scripts
.UnityApp
project in Unity.Open the MainScene scene in the Assets/Scenes
folder.
In the Hierarchy tab, select the SessionConfiguration game object.
In the Inspector tab there will be several AI Player components already attached to the game object. These are simple dummy players for testing purposes. Either:
Press the "Play" button.