Changelog¶
All notable changes to this project are documented here. The format follows
Keep a Changelog, and the project uses
semantic versioning. Environment IDs carry their own version suffix
(-v0), which increases whenever an environment's dynamics, rewards or observations change.
[1.0.0] - 2026-11-30¶
First public release.
Added¶
- Installable package (
pip install gridhunt) with optionalrender,hat,benchmark,devanddocsextras;import gridhuntno longer requires pygame. - Benchmark: IPPO, MAPPO and HAPPO over 20 seeds with a fixed protocol, sampled-action evaluation, IQM with stratified bootstrap CIs, and per-scenario budgets from a 20M-step pilot.
- Optional explicit communication channel (
gridhunt.make(..., communication=k)). - Scripted prey motion (
prey_motion="flee") and a team reward mode (reward_mode="team"). gridhunt.list_envs(), and registration with PettingZoo's environment registry (pettingzoo.make("parallel", env_id), PettingZoo 1.27 or later).- Tests that replay fixed-action trajectories of every environment and compare them with recorded references, so dynamics cannot change without a version bump.
gridhunt.hat, a human-agent teaming toolkit:HumanSession(keyboard control with reaction times, AI teammates, team-switching and custom buttons, pausing, timers or turn-based steps),SessionLog(JSON Lines per participant session plus metadata) andQuestionnaire(Likert, slider, choice, free text and instruction screens). Examples for a human-in-the-loop game and a human-on-the-loop policy delegation study.HumanSession: episodes that start paused until a button resumes them (start_paused),pause()/resume(), extra key bindings (keys),reset_board()to place everyone again mid-episode,set_button_enabled()andlast_rewards. Every logged event carriesepisode_t, the time since its episode started.Scalequestionnaire items for 0-100 style ratings.ToxicStag(toxic_lifetime=...): how long an uncaught toxic stag stays before it moves, as a fixed number of steps (5, the benchmark's value and the default), a random range orNone. A fixed lifetime lets agents infer that a stag which stays longer is healthy; a range removes that cue.gridhunt.policies: the scripted policies, usable as teammates;GreedyPolicycan be limited to some prey types and told to ignore hidden information (prey_types,avoid_harmful).gridhunt.zoo: the benchmark's trained IPPO, MAPPO and HAPPO teams (median and best seed per scenario) as numpy-only policies, downloaded on first use, checked against SHA-256 hashes and cached. A team plays on its own (team.act(observations)) or as teammates in aHumanSession, andteam.make_env()rebuilds the exact scenario it was trained in.- Continuous integration on Linux and macOS with Python 3.10 to 3.15, the oldest supported dependency versions and a base install without rendering, and a release workflow that publishes to PyPI with trusted publishing.
- Documentation site: scenario pages generated from the registered configurations, guides, the human-agent teaming toolkit and its log format, benchmark results and the API reference. Every scenario page says what the scenario tests, what removing each agent costs and which settings change it, and the benchmark page shows the interdependence ablation.
- Benchmark reproduction:
benchmark/requirements.txtwith the exact library versions behind the published results,package_runs.pyto check and package the runs for archiving, and the interdependence ablation in the committed summary. env.render()andenv.close(), a workingrender_mode="rgb_array", andgui_config["vision_mask"]to choose whose view the renderer shows.env.set_entities()andenv.set_prey()to change human-only cues and prey settings between episodes.
Changed¶
- Team information (
team_reward,captures,prey_positions, Raid's trap events and the communication channel'smessages) is now in every agent's info instead of under an extrainfos["__common__"]key, soinfoshas exactly one entry per agent as PettingZoo expects. Environments converted withparallel_to_aecnow pass PettingZoo's AEC API test, which the extra key made fail. Withuse_action_mask=Trueeach agent's mask is ininfos[agent]["action_mask"](int8, also afterreset) instead ofinfos["__common__"]["action_masks"]. Benchmark results are unaffected. - The SLURM scripts work on any cluster: its account, log folder and environment set-up live in
benchmark/slurm/cluster.env, and scripts are submitted throughbenchmark/slurm/submit.sh. - The benchmark documentation is now
benchmark/README.md. - Rendering draws every board at a cell size that fills about 640 pixels, with the same margin on every side and grid lines of one width, instead of scaling 32-pixel cells by whole numbers.
- Sprites are stored at 128 × 128 pixels, which shrinks the package from 4 MB to 0.4 MB without visibly changing the rendering; an unused sprite was removed.
GridHunt-PIG-v0is nowGridHunt-PigChase-v0. Its dynamics are unchanged.gridhunt.make()rejects unknown settings instead of silently ignoring them, and invalid observation modes raise an error.- GridHunt no longer uses the global
randomornumpy.randomstate, not even when the scenarios are built at import time. - Human-only entities are placed with their own random generator and keep a position they are given, so adding them never changes what the agents experience. No registered environment has entities, so their dynamics are unchanged.
Fixed¶
- Moves of more than one cell checked only the landing cell, so fast agents could jump walls; they now move one cell at a time. Slow terrain can be entered (it ends the move) instead of blocking agents of speed 1. No registered scenario is affected.
- Action masks ignored an agent's own terrain restrictions, terrain immunity and speed, and the
terrain setting
restricted_toaffected only masks, not movement. Movement and masks now follow one set of rules, andenv.action_mask(agent_id)returns an agent's mask. HumanSession: a move key pressed before a frame appeared, such as the second key of a quick double press, was applied to the next turn with a near-zero reaction time. Such keys are now discarded and logged as early.CommunicationWrapper.unwrappedreturned the wrapper instead of the environment underneath.env.render()raisedNotImplementedError, andrender_mode="rgb_array"was accepted but drew nothing.- Pig chase: observations returned right after a capture showed the capture positions and the pig's random respawn cell instead of the reset start positions.