Skip to content

Commit 8a539ee

Browse files
authored
Merge pull request #125 from HaliteChallenge/doc-tweaks
Add documentation for hlt_client
2 parents 8ea3735 + fbf1901 commit 8a539ee

File tree

3 files changed

+61
-6
lines changed

3 files changed

+61
-6
lines changed

tools/hlt_client/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Halite Client
2+
3+
## Installation
4+
Download the tool from our [downloads page](https://halite.io/learn-programming-challenge/downloads). Run `python setup.py install` to install the client.
5+
6+
* If you have multiple Python installations, make sure to install using Python 3. You may also need to invoke `hlt` commands with `python3 -m hlt_client` if `hlt` throws errors.
7+
* You may have to `sudo` or use an admin shell.
8+
9+
## Usage
10+
The Halite Client lets you interface with our game servers and play games locally using the command line.
11+
12+
**Authorize your client**
13+
14+
Before you can use most features of the client, you'll need to connect it to your Halite account. Have your Halite API key ready, or generate a new one at https://halite.io/user/settings.
15+
16+
`hlt auth`
17+
18+
19+
**Upload a bot**
20+
21+
Uploads the specified bot onto the Halite game servers.
22+
23+
`hlt bot -b [PATH_TO_ZIP] upload`
24+
25+
26+
**Download current bot**
27+
28+
Downloads your currently-playing bot into a zip archive.
29+
30+
`hlt bot -b [NAME].zip download`
31+
32+
33+
**Run any number of games**
34+
35+
This command runs the number of games you specify, creating save logs and replays as normal, and tells you the win ratio as games are played.
36+
37+
`hlt play -r [BOT_COMMAND] -r [BOT_COMMAND] -b [PATH_TO_HALITE.EXE] --output-dir [OUTPUT_LOCATION] -i [NUMBER_OF_ITERATIONS]`
38+
39+
* You may give two or four `-r [BOT_COMMAND]` parameters to run two or four player games.
40+
* `[BOT_COMMAND]` allows you to specify how to run a bot. The command defaults to Python 3; if only a path is given, the client will run the bot assuming it is a Python bot. You may also mix and match: `hlt play -r "python3 Halite3_Py/MyBot.py" -r "ruby Halite3_Ruby/MyBot.rb" ...` allows you to compare bots in different languages.
41+
* The halite.exe game binary is required to play games. Specify the path after the -b (--binary) parameter: `-b Halite3_Py/halite`
42+
* If you'd like to specify the game map size, you can add `-W [WIDTH] -H [HEIGHT]` parameters. Game maps are 32x32, 40x40, 48x48, 56x56, or 64x64 in width and height.
43+
44+
45+
**Download replays**
46+
47+
* By user: `hlt replay user -i [USER_ID] -l [NUMBER_OF_FILES_WANTED] -d [DOWNLOAD_LOCATION]`
48+
This command will download .hlt replay files of a user by id.
49+
50+
* By date: `hlt replay date -t [DATE] -d [DOWNLOAD_LOCATION]`
51+
52+
This command will download .hlt replay files of all gold ranked games on the given date. The date format is eight numbers YYYYMMDD.
53+
54+
Adding the `-a` flag will include silver replays as well.
55+
56+
Adding the `--decompress` flag to the end of any replay download command will download .json instead of .hlt replay files.

website/learn-programming-challenge/contributing.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ Each turn, every bot is sent:
6363
* A list of this player’s dropoffs.
6464
3. The changed cells on the game map, represented by an update count (how many cells have changed) and the details of changed cells (x, y, halite amount).
6565

66-
Some objects are recreated from scratch each turn, such as ships. Other objects are reused and updated each turn, such as the the map and player. It’s helpful to be clear when writing your starter kit which objects are recreated and which are reused from turn to turn.
67-
6866

6967
<br/>
7068
### Submitting your new starter kit
71-
To submit your starter kit, fork our repo, place your starter package in the `starter-kits/` folder, and send us a pull request! If we accept your PR, your starter package will be added to the site.
69+
To submit your starter kit, fork our repo, place your starter package in the `starter-kits/` folder, and send us a pull request! The Halite repo is licensed under the MIT License; please ensure that your code does not include copyright language. If we accept your PR, your starter package will be added to the site.
7270

7371

7472
**Note:** please include the `run_game.sh` and `run_game.bat` scripts, following the Python3 starter kit as a template.

website/learn-programming-challenge/downloads.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ sort_key: 3
99

1010
<div class="doc-section" markdown="1">
1111

12-
Download a language-specific starter kit to start building your bot. Can’t find your preferred language? We love contributions! Check out our [contribution guide](/learn-programming-challenge/contributing).
13-
1412

15-
---
1613

1714
## STARTER KITS DOWNLOAD
15+
Download a language-specific starter kit to start building your bot. Can’t find your preferred language? We love contributions! Check out our [contribution guide](/learn-programming-challenge/contributing).
16+
1817

1918
<div class="table-container">
2019
<table class="table">
@@ -55,6 +54,8 @@ Download a language-specific starter kit to start building your bot. Can’t fin
5554
</div>
5655
<br>
5756
## Halite Tools and Source Download
57+
Download tools to play games locally. Read the CLI Client Tools README included in the download for installation and usage instructions.
58+
5859

5960
<div class="table-container">
6061
<table class="table">

0 commit comments

Comments
 (0)