Agdbentures
Setup
Dependencies
- Python3.9 or above is required. Please check your Python3 version.
- gcc
- gdb version 10.1 and higher
- gtk Vim with server mode enabled
- unifdef
- GNU make
Under Ubuntu/Debian, this can be achieved using:
apt install gcc python3 build-essential unifdef vim-gtk3
Optional: xdotool
to allow Agdbentures to modify the window placement.
apt install xdotool
Optional: Visual Studio Code (VScode) to edit levels, althouh any editor can do
the job (modify the config.editor
file accordingly).
See the Debian install page
Getting easytracker
Agdbentures depends on the Easytracker library to communicate with GDB. Easytracker is kept in Agdbentures as a git submodule. To get it:
> git submodule init
> git submodule update
or
> git submodule update --init
(Later, when updating, need only to checkout the last version using:
> git pull
> git submodule update
)
Installing easytracker
After the submodule is checked-out, run the following commands to install the various Python libraries Easytracker depends on, then build the various libraries necessary for Agdbentures.
cd easytracker
pip3 install --user -r requirements.txt
make
cd ..
Note: it may be necessary to install the requirements in a python venv (Virtual Environment) depending on your distribution and whether your python packages are managed by the distribution or by pip, for instance, in the agdbentures root directory:
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
Python PATH
(SHOULD NOT BE NECESSARY ANYMORE)
Add agdbentures and easytracker to your python path:
export PYTHONPATH=$PYTHONPATH:$HOME/.../agdbentures/easytracker:$HOME/.../agdbentures/lib
Installing dependencies
Agdbentures depends on the python Arcade library. Install it using the
following command (this time in the agdbentures
directory, not
easytracker
's submodule).
pip3 install --user -r requirements.txt
Note: it may be necessary to install the requirements in a python venv (Virtual Environment) depending on your distribution and whether your python packages are managed by the distribution or by pip, for instance, in the agdbentures root directory:
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
Running Agdbentures
Generating the engines
Mandatory to do prior to launching agdbentures.
python3 make_engine.py
Running Agdbentures
Normally, at this step, all should work correctly:
./agdbentures
Developping in Agdbentures
Getting ssh access
If you cloned Agdbentures using https:// urls it is more cumbersome to work on
the project (you will have to enter your username and password to push
updates).
Change the urls in your .git/config
, replacing:
url = https://gitlab.inria.fr/CORSE/agdbentures.git
by
url = git@gitlab.inria.fr:CORSE/agdbentures.git
Generating a level
Level generation is done automatically from agdbentures. If necessary, it is possible to manually do it using the following command:
python3 make_level.py levels/local_struct
Creating a level
TODO: explain the general way to do it.
For now, look at an existing level, e.g., levels/tutorial/00_intro
Generating a map
If you need a map for your level: of width 20 and height 10 in file test.tmx
% python3 ./lib/graphic/map_utils.py test.tmx 10 20
Then edit the tmx file with 'tiled' and add the following line to the /* @AGDB tag */ of the .c file:
- arcade_maps: main test.tmx
Notes
The level list and progress is hardcoded in the __init__
function of
ProgressManager class in lib/progress/progress_manager.py
Troubleshooting issues
Graphics problems with Windows Subsystem for Linux (WSL)
Need to install opengl drivers.
apt install mesa-utils
See https://github.com/microsoft/WSL/issues/2855
Maybe need to set the DISPLAY environment variable:
export DISPLAY="`grep nameserver /etc/resolv.conf | sed 's/nameserver //'`:0"