Skip to content

colefoster/baton_pass

Repository files navigation

Baton Pass

A Pokemon battle strategy TUI application with MCTS-based decision making, built with Textual. image

Features

  • Monte Carlo Tree Search (MCTS): Advanced AI decision making for Pokemon battles
  • Textual TUI: Beautiful terminal user interface built with Textual
  • Real-time Battle Analysis: Live analysis of battle states and optimal moves
  • Pokemon Showdown Integration: Connect to Pokemon Showdown servers
  • Comprehensive Battle State Management: Full Pokemon battle state tracking

Installation

From PyPI

pip install baton-pass

From Source

git clone https://github.com/yourusername/baton-pass.git
cd baton-pass/src
pip install -e .

Quick Start

Basic Usage

# Start the application
baton-pass

Development Setup

# Install with development dependencies
pip install -e .[dev]

# Run setup for development environment
baton-pass-setup-dev

Usage

Starting the Application

The main application provides a TUI interface for Pokemon battle strategy analysis:

from baton_pass.app import start

# Start the application
start()

MCTS Search Component

The MCTS component provides AI-powered decision making:

from baton_pass.mcts_component import MctsSearchComponent

# Create MCTS search component
mcts = MctsSearchComponent()

Battle State Management

Manage Pokemon battle states:

from baton_pass.battle import BattleState
from poke_engine import State

# Create a battle state
state = State()
battle = BattleState(state)

Development

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=baton_pass

# Run specific test categories
pytest -m "asyncio"
pytest -m "integration"

Code Quality

# Install pre-commit hooks
pre-commit install

# Run pre-commit on all files
pre-commit run --all-files

Project Structure

baton_pass/
├── app.py              # Main application entry point
├── battle.py           # Battle state management
├── mcts_component.py   # MCTS search implementation
├── web_interface.py    # Web interface components
├── constants.py        # Application constants
├── config.toml         # Configuration file
├── ui/                 # UI components
├── scripts/            # Utility scripts
└── tests/              # Test suite

Dependencies

  • textual: Terminal UI framework
  • poke_engine: Pokemon battle engine
  • websockets: WebSocket communication
  • aiohttp: Async HTTP client
  • rich: Rich text and formatting
  • toml: Configuration file parsing

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite
  6. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Pokemon Showdown for the battle protocol
  • Textual for the excellent TUI framework
  • The Pokemon community for inspiration and feedback

Support

About

A Pokemon Showdown (https://github.com/smogon/pokemon-showdown) client with complete auto-battling functionality. Written in Python using Textual

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages