Giter VIP home page Giter VIP logo

tstarbot2's Introduction

TStarBot

A rule-based Star Craft II bot. Compatible with pysc2.agents.

Install

cd to the folder and run the command:

pip install -e .

Dependencies

pysc2 (Use Tencent AI Lab fork, required!)
pillow

We recommend pip install each Python package.

How to Run

Run the agent using the scripts from pysc2.bin. Example:

python -m pysc2.bin.agent \
    --map AbyssalReef \
    --feature_screen_size 64 \
    --agent tstarbot.agents.zerg_agent.ZergAgent \
    --agent_race zerg \
    --agent2 Bot \
    --agent2_race zerg

See more examples here.

Evaluate

Evaluate the agent (e.g., winning rate) using tstarbot.bin.eval_agent. Example:

python -m tstarbot.bin.eval_agent \
    --max_agent_episodes 5 \
    --map AbyssalReef \
    --norender \
    --agent1 tstarbot.agents.zerg_agent.ZergAgent \
    --screen_resolution 64 \
    --agent1_race Z \
    --agent2 Bot \
    --agent2_race Z \
    --difficulty 3

See more examples here. In particular, see how a well configured agent plays against difficulty-A (cheat_insane) builtin bot here.

Profiling

Use pysc2.lib.stopwatch to profile the code. As an example, see tstarbot/agents/micro_defeat_roaches_agent.py and run the following command:

python -m pysc2.bin.agent \
    --map DefeatRoaches \
    --feature_screen_size 64 \
    --max_episodes 2 \
    --agent tstarbot.agents.micro_defeat_roaches_agent.MicroDefeatRoachesAgent \
    --agent_race terran \
    --agent2 Bot \
    --agent2_race zerg \
    --profile

AI-vs-AI and Human-vs-AI

See examples here for AI-vs-AI and examples here for Human-vs-AI.

Coding Style

Be consistent with that of pysc2.

tstarbot2's People

Contributors

balderli avatar jchxiong avatar jliu87 avatar lns avatar pengsun avatar slivermoda avatar xinghai-sun avatar zyqlzr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tstarbot2's Issues

cannot reshape array of size 4400 into shape (176,200)

Hello ,I would run “python -m pysc2.bin.agent --map AbyssalReef --feature_screen_size 64 --agent tstarbot.agents.zerg_agent.ZergAgent --agent_race zerg --agent2 Bot --agent2_race zerg”
bu found error:
\TStarBot2-dev-open\tstarbot\data\pool\map_tool.py , line 10, in bitmap2array
array = np.reshape(array, (image.size.y, image.size.x))
ValueError:cannot reshape array of size 4400 into shape (176,200)
my environment is windows 10 sc2 version 4.10 python 3.7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.