Battlesnake Plugin

December 5, 2025 ยท View on GitHub

MIT License

Playground for building & debugging battlesnakes in Winter CMS.

Installation

This plugin is available for installation via Composer.

composer require winter/wn-battlesnake-plugin

After installing the plugin you will need to run the migrations and (if you are using a public folder) republish your public directory.

php artisan migrate

Running Local Games

Run local Battlesnake games using your snake templates with the battlesnake:play command:

# Run a game with specific snakes (by slug)
php artisan battlesnake:play snake1 snake2

# Run multiple instances of the same snake
php artisan battlesnake:play local:3

# Mix snakes and counts
php artisan battlesnake:play snake1 snake2:2 snake3

# Interactive mode (prompts for snake selection)
php artisan battlesnake:play

Options

OptionDescriptionDefault
-W, --widthBoard width11
-H, --heightBoard height11
-t, --timeoutRequest timeout in milliseconds500
-r, --seedRandom seed for reproducibility-
-d, --delayDelay between turns in milliseconds-
-g, --gametypeGame type (standard, royale, etc.)standard
-m, --mapMap to usestandard
-b, --browserOpen game in browser viewer-
-o, --outputOutput game log to JSON file-

Examples

# Quick game with browser viewer
php artisan battlesnake:play local:4 --browser

# Slow game for debugging
php artisan battlesnake:play local:2 --delay=500

# Reproducible game with seed
php artisan battlesnake:play snake1 snake2 --seed=12345

# Large board royale game
php artisan battlesnake:play local:8 -W 19 -H 19 -g royale

# Save game log for replay
php artisan battlesnake:play local:4 -o game.json