How mnbvmnbv2/simple-rts-rl works
Project type and purpose
• From the README and file tree, this is an open-source Python library (“simple‐rts‐rl”) that provides:
• A grid-based real-time strategy (RTS) game environment
• Reinforcement-learning (RL) algorithms (PQN and CARBS-PQN) for training agents
• Utilities for evaluation, benchmarking, visualization, and documentation
• The primary purpose is to enable RL experiments on a minimalist RTS game.
File structure
• Top-level:
• src/ – main package
– src/playable.py – CLI runner for interactive play
– src/rl/ – RL algorithms & evaluation
· pqn.py – PQN algorithm
· carbs_pqn.py – CARBS-PQN integration
· eval.py – evaluation metrics
– src/rts/ – game environment
· config.py – game parameters
· env.py – environment API (reset, step, render)
· state.py – grid/state representation
· utils.py – helper functions
· visualization.py – rendering support
• docs/ – Sphinx documentation sources
• tests/ – unit and benchmark tests
• notebook.ipynb, train.ipynb – Jupyter demos
• pyproject.toml, .python-version – build and dependency config
README for additional insights
• Architecture is not explicitly diagrammed, but key flows:
• Agents (PQN/CARBS) interact with Env via step/reset
• Env uses state+config for game logic and visuals
• Docs built with Sphinx
• Playable interface invokes the environment for manual play
• Benchmark tests simulate episodes to measure performance
Detailed capture of essential elements
• Break “RTS Environment” into sub-modules: Config, State, Utils, Visualization
• RL algorithms under a single “Agent” umbrella but annotate each algorithm
• Test suites as separate flows that import and validate the core modules
• CLI and notebook runners as entry points for both demonstration and training