add dataset updates with doc updates
Build and Push Docker Container / build-and-push (push) Failing after 12m18s
Build and Push Docker Container / build-and-push (push) Failing after 12m18s
This commit is contained in:
@@ -54,4 +54,51 @@ battlesnake play -W 11 -H 11 --name 'Python Starter Project' --url http://localh
|
||||
|
||||
Continue with the [Battlesnake Quickstart Guide](https://docs.battlesnake.com/quickstart) to customize and improve your Battlesnake's behavior.
|
||||
|
||||
## Included Competitive Snake
|
||||
This repo now includes `snakes/BestBattleSnake.py`, a stronger default snake that combines:
|
||||
- collision and head-to-head risk checks
|
||||
- flood-fill space evaluation to avoid traps
|
||||
- food routing that gets more aggressive as health drops
|
||||
- tail access checks for better long-term survival
|
||||
|
||||
Run it explicitly with:
|
||||
|
||||
```sh
|
||||
SNAKE=BestBattleSnake python main.py
|
||||
```
|
||||
|
||||
Optional duel tuning (when only 2 snakes are alive):
|
||||
|
||||
```sh
|
||||
BATTLE_SNAKE_DUEL_STYLE=balanced python main.py
|
||||
```
|
||||
|
||||
Allowed values: `safe`, `balanced`, `aggressive`.
|
||||
|
||||
## Export Training Dataset
|
||||
Game saves now include a `dataset` section with labeled move samples.
|
||||
|
||||
Export all stored samples to JSONL:
|
||||
|
||||
```sh
|
||||
python -m server.DatasetExporter --input data --output data/dataset/good_moves.jsonl
|
||||
```
|
||||
|
||||
Or with `just`:
|
||||
|
||||
```sh
|
||||
just export-dataset
|
||||
```
|
||||
|
||||
To store compact dataset-only records (JSONL) and skip full per-game JSON files:
|
||||
|
||||
```sh
|
||||
STORE_DATASET_ONLY=true DATASET_JSONL_PATH=data/dataset/good_moves.jsonl python main.py
|
||||
```
|
||||
|
||||
Optional compact storage tuning:
|
||||
- `DATASET_ROTATE_DAILY=true` creates one JSONL file per day (default: `true`)
|
||||
- `DATASET_JSONL_MAX_MB=50` rotates when file reaches max size in MB (default: `50`)
|
||||
- `DATASET_COMPRESS_ROTATED=true` gzip-compresses rotated/old JSONL files (default: `true`)
|
||||
|
||||
**Note:** To play games on [play.battlesnake.com](https://play.battlesnake.com) you'll need to deploy your Battlesnake to a live web server OR use a port forwarding tool like [ngrok](https://ngrok.com/) to access your server locally.
|
||||
|
||||
Reference in New Issue
Block a user