Skip to main content

No project description provided

Project description

Quality Gate Status

rust-arenaclient

rust-arenaclient was created for ai-arena to act as a proxy between bots and StarCraft II. It was originally written entirely in Python, but due to performance concerns, was rewritten using Rust + pyo3.

It can be used as a stand-alone binary or as a Python library for convenience.

Installation

You can install rust_arenaclient using:

pip install rust_arenaclient

or alternatively build a binary from source using

cargo build --bin rust_ac_bin

Usage

Python

from rust_ac import Server

server = Server("127.0.0.1:8642")
server.run()

Binary

Currently the proxy server starts on 127.0.0.1:8642 when launched. Future updates will enable the user to specify host and port using command line arguments, after which this README will be updated.

Running a game

rust_arenaclient was made for the purpose of being part of a bigger system to run StarCraft II games. The system will interact with the rust_arenaclient through websockets and is known as a supervisor. rust_arenaclient only acts as a proxy between bots and StarCraft II. The starting of bots and creating game config is the supervisor's job. Example of an extremely basic supervisor script in Python:

import os, subprocess, asyncio, aiohttp
from rust_ac import Server

from rust_ac.match_runner import MatchRunner
from rust_ac import GameConfig


m = MatchRunner(bot_directory=r"D:\desktop backup\aiarenaclient\aiarena-client\aiarena-test-bots")
result = m.run_game(game=GameConfig('AutomatonLE', 'loser_bot', 'MicroMachine'))  # One game

games = [GameConfig('AutomatonLE', 'loser_bot', 'basic_bot') for _ in range(20)]

results = m.run_games_multiple(games=games, instances=3)  # Multiple games - Run 3 games at a time

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU GPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

rust_arenaclient-0.1.8-cp37-none-win_amd64.whl (5.7 MB view hashes)

Uploaded CPython 3.7 Windows x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page