Installation Guide Lux AI
Installation Guide
This guide will help you install the Lux AI DevKit and explain how to use it.
Please refer to this page to get Lux-AI challenge info : https://www.kaggle.com/competitions/lux-ai-2021/overview
And this page to get info on the Lux-AI engine : https://github.com/Lux-AI-Challenge/Lux-Design-2021
Install & Execute Your First AIBot
Install required software and update windows PATH environment variable.
- Visual Studio 2022 Community Edition (https://visualstudio.microsoft.com/vs/)
* Windows PATH environment variable must contain the MSbuild folder containing its main executable (msbuild.exe).
* Make sure to install v143 Platform Toolset
Ex.: C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
- CMake (https://cmake.org/) (3.27.2 have been tested. More recent versions should also work but haven't been tested yet)
* Windows PATH environment variable must contain the CMake folder containing its main executable (cmake.exe).
- Python (https://www.python.org/) (3.11.4 have been tested. More recent versions should also work but haven't been tested yet)
* Windows PATH environment variable must contain the Python folder containing its main executable (python.exe).
- 7-Zip (https://www.7-zip.org/download.html) (22.01 have been tested. More recent versions should also work but haven't been tested yet)
* Windows PATH environment variable must contain the 7-zip folder containing its main executable (7z.exe).
- Node.js + npm (https://nodejs.org/en/download/) (18.17.1 have been tested. More recent versions should also work but haven't been tested yet)
Check that your programs are installed properly
Open a Command Prompt and execute the following commands:
> cmake -version
> python --version
> msbuild -version
> 7z
> node - v
> npm - v
If properly installed, you should see outputs specifying version numbers for every softwareInstall Lux-AI C++ Dev Kit
Download the following file and unzip it in separate folders (download links will be provided in class):
Lux-AI-MyFirstAIBot-2023.X.XX.zip
*** It is highly recommended to avoid paths including spaces and special characters like accented letters (ex.: é)
And install the lux-ai engine running the following command :
> npm install -g @lux-ai/2021-challenge@latest
After the installation, you should be able to validate if it is properly installed by running :
> lux-ai-2021 --versionGenerate MyFirstAIBot Visual Studio solution
In the LuxAI-MyFirstAIBot folder, execute the rebuild_vis_sln_x64.bat command in a Command Prompt. This will generate the build-solution-x64 folder, where you can find the MyFirstAIBot.sln visual studio solution file.Open and manage the solution
Open the MyFirstAIBot.sln solution in Visual Studio. You'll see the 2 following projects : myfirstaibot and ALL_BUILD. Make sure your set myfirstaibot project as the startup project by right clicking the myfirstaibot solution and choosing the "Set as Startup Project" option.
To create your custom decision-making system, you should implement your own agent implementation. In the provided project, an empty class implementation is provided named agent.cpp.
The Agent framework will be explained in detail in class.Build Solution
Choose the proper Build Target (Release|Debug) and simply build the selected project (F7). This step should generate .exe file that will be used by the game launcher.Execute Solution
To launch a match, use the following command:
> lux-ai-2021 --seed=100 --statefulReplay path/to/botfileExe path/to/otherbotfileExe
*** See https://github.com/Lux-AI-Challenge/Lux-Design-2021 for more info about the engine CLI usage.Watch Game Replay
All info about the replay tool can be found here : https://github.com/Lux-AI-Challenge/Lux-Viewer-2021
Option 1 : Web
Upload your replay file here : https://2021vis.lux-ai.org/.
Option 2 : Local Server
To run the visualizer locally, first dowload and unzip dist.zip found here. it should create a folder called dist. Then install the serve package via :
> npm i -g serve
Then run from the dist parent directory :
> serve dist (blocking process)
or
> start \b serve dist (background process)
You'll be able to upload your replay using the link provided by the serve application (ex. :http://localhost:3000)
Managing MyFirstAIBot.sln solution
Add/remove files to the solution
To add/remove files to the solution, you need to edit the CMakeLists.txt file in the Lux-AI-MyFirstAIBot folder . This files contains all the info for CMake to generate and build VisualStudio solutions.
Look for the AIBOT_HEADERS and AIBOT_SRC sections and add/remove files in the list, and regenerate the solution using the rebuild_vis_sln_x64.bat command.
IMPORTANT : It is highly recommanded to add your custom AIBot development files in custom subfolders to ease to process of migrating your code with the future versions of the DevKit.Clean the project
To clean the project, execute the CleanAll.bat command in the Lux-AI-MyFirstAIBot folder. This will remove the build-solution-x64 folder and all temporary files. All other files will be left as is.