Skip to content

Packaging For Ladders

DrInfy edited this page Aug 29, 2021 · 3 revisions

Dummy bots

Dummy bots can be easily packaged to publish folder as distributable bots with python dummy_ladder_zip. If you want to change their difficulty, you can control their difficulty by adjusting the game_step in config.ini in the sharpy repo root and publish a version with that game_step. Dummy speed mining gets disabled when game_step is higher than 5.

Your custom bots

Your own bot probably isn't structured in similar way as the dummy bots are and you should create your own publish python file. There is an working example in Sharpy Starter Kit. The ladder_zip.py packages the bot as a single zip file in your publish folder.

The published bot should have following structure:

- your_bot_folder(s)
- sharpy
- sc2
- sc2pathlib
- jsonpickle     # Used by data manager to package data in somewhat human readable format
config.ini
config.py
ladder.py
ladderbots.json   # Used by ladder manager and required for bot vs human games
run.py
requirements.txt  # Optional
version.txt       # Optional

You can test your published bot by running it's run.py.

Stand-alone build

Using -e or -exe the bot would be packaged as a stand-alone executable that makes the bot easier to distribute to human players. This method is tested and should work on all standard sharpy bots in Windows with Python 3.9 64-bit.

Clone this wiki locally