Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 2.19 KB

agent.md

File metadata and controls

39 lines (25 loc) · 2.19 KB

Build a brand new agent

  1. Implement the step function in distar/agent/template/agent.py. This function should receive an observation and return a list of actions.

    the observation is a dict with 3 fields:

    • raw_obs: contains observation in form of protobuf (details).

    • opponent_obs: contains opponent's observation similar to raw_obs.

    • action_result: action result of last action the agent made(details).

    the action is a dict with 6 fields:

    • func_id: ability id from pysc2(details).

    • skip_steps: how many frames in game the agent doesn't need an observation, count from current frame.

    • queued: whether to put this action into queue(like human use shift).

    • unit_tags: a list contains unit tags which are selected units in this action.

    • target_unit_tag: a unit tag which is targetd unit in this action.

    • location: the target location in this action.

  2. Change the agent's name from default to template at user_config.yaml

  3. python -m distar.bin.play --game_type agent_vs_agent --model2 <agent you want to play against>

Modify our agent

  1. Create a new branch named : git checkout -b <dev>
  2. Modify any part of the default agent, here are some examples:
  1. Copy the directory of default agent from main branch and rename it main.
  2. Change the agent's name from default to main at user_config.yaml
  3. python -m distar.bin.play --game_type agent_vs_agent --model1 <agent you want to play against> --model2 <your own agent>