* castle_wall map Wall of hazards around the board with dangerous bridges. - add support for all standard board sizes - hazard placement for all board sizes * passage food placement for all board sizes * 4 snake starting positions for all maps * only one food can spawn on a bridge * support 8 snakes for all board sizes support 12 snakes on XLarge and XXLarge board sizes * max 2 food sm/med/lg and max 4 food on xlg/xxlg no food in the first 10 turns * sort generated hazard positions * remove 'uninteresting' castle wall map board sizes * refactor castle wall map to align with #103 * align map castle wall meta Name with ID * set MinPlayers to 1 for castle wall map * pass max snake/food and startPosition to priv func * fix castle wall food placement and refactor tests * avoid food spawn by snake heads on castle wall map - fixes forced food spawning infront of snake issue on large & xlarge maps with double walls |
||
|---|---|---|
| .github | ||
| board | ||
| cli | ||
| client | ||
| maps | ||
| test | ||
| .gitignore | ||
| .goreleaser.yml | ||
| board.go | ||
| board_test.go | ||
| cases_test.go | ||
| CODE_OF_CONDUCT.md | ||
| constants.go | ||
| constrictor.go | ||
| constrictor_test.go | ||
| CONTRIBUTING.md | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| pipeline.go | ||
| pipeline_internal_test.go | ||
| pipeline_test.go | ||
| rand.go | ||
| README.md | ||
| royale.go | ||
| royale_test.go | ||
| ruleset.go | ||
| ruleset_internal_test.go | ||
| ruleset_test.go | ||
| solo.go | ||
| solo_test.go | ||
| standard.go | ||
| standard_test.go | ||
| wrapped.go | ||
| wrapped_test.go | ||
BattlesnakeOfficial/rules
Battlesnake rules and game logic, implemented as a Go module. This code is used in production at play.battlesnake.com. Issues and contributions welcome!
CLI for Running Battlesnake Games Locally
This repo provides a simple CLI tool to run games locally against your dev environment.
Installation
Download precompiled binaries here:
https://github.com/BattlesnakeOfficial/rules/releases
Install as a Go package. Requires Go 1.18 or higher. [Download]
go install github.com/BattlesnakeOfficial/rules/cli/battlesnake@latest
Compile from source. Also requires Go 1.18 or higher.
git clone git@github.com:BattlesnakeOfficial/rules.git
cd rules
go build -o battlesnake ./cli/battlesnake/main.go
Usage
Example command to run a game locally:
battlesnake play -W 11 -H 11 --name <SNAKE_NAME> --url <SNAKE_URL> -g solo -v
For more details, see the CLI README.
FAQ
Can I run games locally?
Yes! See the included CLI.
How is this different from the old Battlesnake engine?
The old game engine was re-written in early 2020 to handle a higher volume of concurrent games. As part of that rebuild we moved the game logic into a separate Go module that gets compiled into the production engine.
This provides two benefits: it makes it much simpler/easier to build new game modes, and it allows the community to get more involved in game development (without the maintenance overhead of the entire game engine).
Feedback
- Do you have an issue or suggestions for this repository? Head over to our Feedback Repository today and let us know!