Skip to content

Vers-AI/SC2_PiGBot

Repository files navigation

PiG_Bot

A Human-Like StarCraft II Training Opponent

Built using python-sc2 and the ARES framework.

Project Overview

What Inspired This Project?
The default StarCraft II in-game AI makes a terrible training partner. This project aims to provide a more challenging, human-like opponent for competitive players.

Is This For You?

  • StarCraft II players seeking a challenging AI at different skill levels.

Why You'll Love This Bot

  • The bot plays in a way that mimics human opponents.
  • Difficulty is adjustable.
  • The bot adapts to its opponent’s strategies.

How You Can Use This Bot

  • Play against the bot in custom games.
  • Use it as a training partner to improve your skills.

Key Features

  • Builds according to the Bronze to GM macro standard.
  • Scouts and gathers enemy information.
  • Reacts to common cheese (Zergling Rush, Cannon Rush, Probe Rush).
  • Uses disruptors and basic micro (a-move, stutter step).
  • Responds to threats with appropriate unit counters.
  • Maintains 3 bases and 66 probes.
  • Switches builds based on scouting (pre-defined build switches).
  • Fights only when favored.
  • Runs 2 build orders per matchup:
    • PvP: 4 Gate All-in, 2 Gate Expand
    • PvZ: Standard Robo Opener, Double Stargate Phoenix (vs Mutas)
    • PvT: Standard Macro Build, Proxy Rax Response

Tracked Data

  • Opponent race, map name, game result, build order used, build loss flag, time build switched, enemy openings and units seen, air tech detection, fight outcomes, units lost, expansions taken, and more (see code for full list).

📋 Community & Task List: Join the discussion and see current tasks on the VersusAI Community Forum

Getting Started

Prerequisites

  • Python 3.8 or higher
  • StarCraft II (free edition works fine)
  • Poetry package manager

Installation

  1. Clone the repository:
git clone --recursive https://github.com/Vers-AI/SC2_PiGBot.git
  1. Navigate to the root folder:
cd SC2_PiGBot
  1. Install dependencies using Poetry:
poetry install
  1. Configure StarCraft II path (if needed):
    • If you have a non-standard StarCraft 2 installation or are using Linux, adjust MAPS_PATH in run.py

Running the Bot

poetry run python run.py

Project Structure

/bot/             # Core bot logic
├── /utilities/   # Helper functions and utilities
├── /managers/    # Bot behavior managers
/data/            # Game data and configs
/run.py           # Entry point to run the bot

Contributing Guidelines

How to Contribute

  1. Check the community forum thread for current tasks
  2. Fork the repository
  3. Create a feature branch (git checkout -b feature/amazing-feature)
  4. Commit your changes (git commit -m 'Add some amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

Coding Standards

  • Follow PEP 8 style guide for Python code
  • Write meaningful commit messages
  • Add comments for complex logic
  • Update documentation when changing functionality

Resources

License

This project is released under the MIT License.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Want to contribute and be recognized? We invite you to join our AI Makers community: https://versusai.net/join/

Community members get access to contribution opportunities, recognition, and more!

This project follows the all-contributors specification. Contributions of any kind welcome!

About

A Human-Like StarCraft II Training Opponent

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published