Skip to main content

MARL benchmark suite in ViZDoom

Project description

COMRAD

COMRAD is a cooperative multi-agent reinforcement learning benchmark built on ViZDoom for first-person visual coordination. This repository contains the benchmark runtime assets, COMRAD-specific environment and model code, a modified Sample Factory training stack, paper artifacts, and the scripts used to produce figures, tables, and diagnostic media.

COMRAD demo

Repository map

Path Purpose
comrad/ Benchmark package: training entrypoints, environment registration, wrappers, models, shipped scenario assets, launchers, tests.
sample_factory/ Modified training engine used by COMRAD.
scripts/ Figure-generation, result aggregation, WAD rendering, and experiment helper scripts.
results/ Committed figures, tables, result summaries, and selected media artifacts.
DoomGen/ Procedural generator used to build and vary scenario WADs.

Directory-level guides are provided in:

Setup

COMRAD is packaged through pyproject.toml and is intended to be run with uv.

uv sync --all-extras
uv run pre-commit install

The project requires Python 3.10 or newer. The package metadata and CI workflow are the authoritative sources for dependency resolution.

Single-run training

The main training entrypoint is comrad.train.

uv run python -m comrad.train \
  --env=stag_hunt_arena \
  --algo=IPPO \
  --train_for_env_steps=10000 \
  --num_workers=4 \
  --num_envs_per_worker=4 \
  --device=cpu

Training outputs are written under train_dir/<experiment>/. The main runtime log is:

tail -n 120 train_dir/<experiment>/sf_log.txt

For launcher-owned benchmark sweeps, use comrad/train_all.py instead of manually reproducing those long commands.

Recording and evaluation

High-resolution checkpoint recording:

uv run python -m comrad.record_video \
  --env=stag_hunt_arena \
  --train_dir=train_dir \
  --experiment=<experiment_name> \
  --load_checkpoint_kind=best \
  --resolution=1280x720

Automap/top-down heatmap rendering:

uv run python -m comrad.record_topdown_heatmap \
  --env=ammo_carrier \
  --train_dir=<train_root> \
  --experiment=<experiment_name> \
  --output_dir=results/videos/ammo_carrier_navigation_heatmap \
  --device=cpu \
  --overwrite

Both commands expect a full experiment directory with at least config.json and the corresponding checkpoint directory.

Benchmark launchers

COMRAD ships several paper-facing launcher profiles through comrad/train_all.py.

  • benchmark: full benchmark suite
  • agent_scaling: Armory Siege agent-count sweep
  • platform_chain_curriculum: curriculum comparison on Platform Chain
  • qmix_lr_sensitivity_pilot: Short sensitivity study
  • qmix_lr_sensitivity_full: Full sensitivity study

Run a launcher profile locally with:

COMRAD_TRAIN_ALL_PROFILE=benchmark \
uv run python -m sample_factory.launcher.run \
  --run=comrad.train_all \
  --backend=processes \
  --max_parallel=1 \
  --pause_between=1

The exact benchmark definitions, algorithms, root directory names, and profile constants live at the top of comrad/train_all.py.

Scenario assets and DoomGen

Runtime scenario assets are stored in comrad/scenarios/ as .cfg and .wad pairs, plus pre-generated batch directories such as batch_platform_chain_curriculum/.

Generation workflows are in DoomGen/. The usual split is:

  • DoomGen/examples/benchmark: procedural generators and geometry logic
  • comrad/scenarios/: runtime WADs and configs consumed by training and evaluation

If a scenario generator changes, rebuild the corresponding WAD in DoomGen/ and copy the regenerated artifact back into comrad/scenarios/ before training or evaluation.

Using DoomGen as a Python library

DoomGen is declared as an optional dependency in the uv workspace. It is not installed by a plain uv sync:

uv sync --extra doomgen      # install doomgen + its deps
# or
uv run --extra doomgen python -m comrad.train ...   # one-off with doomgen available
# or
uv pip install -e DoomGen/   # editable install directly from local checkout

After any of these, import doomgen works from the root Python environment. Without --extra doomgen, the core COMRAD package remains self-contained and DoomGen is not pulled in.

Tests

Run COMRAD and Sample Factory tests with uv:

uv run pytest comrad/tests -v
uv run pytest sample_factory/tests -v

Tests in comrad/tests/ focus on benchmark logic, launchers, and recorder behavior. Tests in sample_factory/tests/ cover the modified training stack.

Outputs and artifacts

  • train_dir/: experiment directories, configs, checkpoints, logs
  • results/: committed figures, tables, result summaries, selected media
  • wandb/: local W&B run state and uploads

See results/README.md for the structure of the committed artifacts.

License and upstream assets

The repository is released under the MIT license in LICENSE. Upstream and third-party assets are documented in the repository itself, including the bundled scripts/wad2image/ tool and the paper's citations to ViZDoom, Sample Factory, HARL, PyMARL, and QPLEX.

Acknowledgements

We would like to thank all researchers, engineers, advisors involved in this work; and the TU/e Supercomputing Center for providing the infrastructure to run the experiments. The environments are built on top of ViZDoom. Our infrastructure is built on top of Sample Factory. Our experiments were managed using Weights & Biases. For on-policy actor-critic methods, we implement IPPO and MAPPO from the original implementation in Sample Factory, and HAPPO following the HARL codebase. For off-policy value decomposition methods, we implement IDQN, VDN, QMIX following the PyMARL framework, and QPLEX following official QPLEX reference implementation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

comrad_bench-1.0.0.tar.gz (13.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

comrad_bench-1.0.0-py3-none-any.whl (13.6 MB view details)

Uploaded Python 3

File details

Details for the file comrad_bench-1.0.0.tar.gz.

File metadata

  • Download URL: comrad_bench-1.0.0.tar.gz
  • Upload date:
  • Size: 13.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for comrad_bench-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8fe73331d1a4fb1083f83deca99648fbceeeb6fe30c3e972527f68a93039fcab
MD5 746354a51ed2147e02a7e3f946e0858e
BLAKE2b-256 163f97e2f6f896b3f792838b368a64c0a4b3b4821891b541672e86633604db28

See more details on using hashes here.

File details

Details for the file comrad_bench-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: comrad_bench-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for comrad_bench-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5d5130422f0e53285084f61b2d64a9e2aee78909e339e351f3fcfec07c139c0
MD5 b3eb757d229a381825477cb64ed9515e
BLAKE2b-256 720476f47f5993bcdaf63cd414b92f399fbe4f42f7c756ce69979203bf950d9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page