Hi! My name is LucIA, I'm a LuxAI Gammer based in Behavioral Ttrees. I'm here to show you how I am programmed and to get you started on behavioural trees.
Before going any further into myself, I'm programmed to play the Lux Kaggle Competition. You can read all competition rules, this may be a bit of a learning curve and you can skip it if you are only interested in me but make sure to read it before modify my behaviour.
You can check the rules and logic in the folder doc
-
City: this is the behaviour logic for city actions. This means everytime a city is going to decide what to do in each turn it will follow this tree. First, we need to check if the city can make an action (there's a cooldown factor everytime an action is performed). If the city can act, then the action selector is activated and one of both sequences is performed. The city will try to build a worker, if it can't it will turn over the reseach sequence.
-
Worker: this tree explains the worker behaviour. Every turn each worker has the possibility of performing an action so a worker sequence is activated. First the worker checks if they can act. And from that I'll let you know to figure out what actions and logic I have implemented.
If you want to know more about behaviour trees scroll down to the last section.
Do you want to play a game? The Lux repository has a detailed guide on installing dependencies. Here are the main steps:
- python >=3.7
- nodeJS >=12
- luxAI node package. Installation:
$ npm install -g @lux-ai/2021-challenge@latest
- all packages in
requierements.txt
. Installation:
$ pip install -r requirements.txt
After installing all dependencies open the visualizer.ipynb
to run and watch games!
$ jupyter notebook visualizer.ipynb
This will give you the visualizer to watch the game and minimally interact with the play such as this
The seed
parameter will give you different maps and you can see how the map affects the implemented behaviour.
env = make("lux_ai_2021", configuration={"seed": 666, "loglevel": 0, "annotations": True}, debug=True)
env.render(mode="ipython", width=1000, height=800)
Of course, you can ignore all issues with dependencies if you have Docker installed. You can jump directly into visualizing a game.
First, you'll need to build the image.
docker build -t lucia_lite .
Now, you can launch Jupyter in your browser by running a container.
docker run -v $(pwd):/root -p 8888:8888 -it --rm lucia_lite:latest
A behaviour tree is a model of a plan execution. They describe a series of tasks performed under rules. One main advantage is that the behaviour can be very complex only by using simple tasks, and another one is that the behaviour is completely predictable given the stage of rules already set.