Adversarial Pursuit#

../../../_images/magent_adversarial_pursuit.gif

This environment is part of the MAgent environments. Please read that page first for general information.

Import

from pettingzoo.magent import adversarial_pursuit_v4

Actions

Discrete

Parallel API

Yes

Manual Control

No

Agents

agents= [predator_[0-24], prey_[0-49]]

Agents

75

Action Shape

(9),(13)

Action Values

Discrete(9),(13)

Observation Shape

(9,9,5), (10,10,9)

Observation Values

[0,2]

State Shape

(45, 45, 5)

State Values

(0, 2)

../../../_images/magent_adversarial_pursuit_aec.svg

The red agents must navigate the obstacles and tag (similar to attacking, but without damaging) the blue agents. The blue agents should try to avoid being tagged. To be effective, the red agents, who are much are slower and larger than the blue agents, must work together to trap blue agents so they can be tagged continually.

Arguments#

adversarial_pursuit_v4.env(map_size=45, minimap_mode=False, tag_penalty=-0.2,
max_cycles=500, extra_features=False)

map_size: Sets dimensions of the (square) map. Increasing the size increases the number of agents. Minimum size is 7.

minimap_mode: Turns on global minimap observations. These observations include your and your opponents piece densities binned over the 2d grid of the observation space. Also includes your agent_position, the absolute position on the map (rescaled from 0 to 1).

tag_penalty: reward when red agents tag anything

max_cycles: number of frames (a step for each agent) until game terminates

extra_features: Adds additional features to observation (see table). Default False

Action Space#

Key: move_N means N separate actions, one to move to each of the N nearest squares on the grid.

Predator action options: [do_nothing, move_4, tag_8]

Prey action options: [do_nothing, move_8]

Reward#

Predator’s reward is given as:

  • 1 reward for tagging a prey

  • -0.2 reward for tagging anywhere (tag_penalty option)

Prey’s reward is given as:

  • -1 reward for being tagged

Observation space#

The observation space is a 10x10 map for pursuers and a 9x9 map for the pursued. They contain the following channels, which are (in order):

feature

number of channels

obstacle/off the map

1

my_team_presence

1

my_team_hp

1

other_team_presence

1

other_team_hp

1

binary_agent_id(extra_features=True)

10

one_hot_action(extra_features=True)

9/Prey,13/Predator

last_reward(extra_features=True)

1

State space#

The observation space is a 45x45 map. It contains the following channels, which are (in order):

feature

number of channels

obstacle map

1

prey_presence

1

prey_hp

1

predator_presence

1

predator_hp

1

binary_agent_id(extra_features=True)

10

one_hot_action(extra_features=True)

13 (max action space)

last_reward(extra_features=True)

1

Version History#

  • v4: Underlying library fix (1.18.0)

  • v3: Fixed bugs and changed default parameters (1.7.0)

  • v2: Observation space bound fix, bumped version of all environments due to adoption of new agent iteration scheme where all agents are iterated over after they are done (1.4.0)

  • v1: Agent order under death changed (1.3.0)

  • v0: Initial versions release (1.0.0)